Skip to content

Commit 5f46fd8

Browse files
authored
Merge pull request #13 from Litecms/develop
Updated
2 parents e7133e6 + f1d5fc3 commit 5f46fd8

File tree

8 files changed

+180
-416
lines changed

8 files changed

+180
-416
lines changed

database/migrations/2021_08_23_100001_create_blog_categories_table.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

database/migrations/2021_08_23_100001_create_blog_tags_table.php

Lines changed: 0 additions & 43 deletions
This file was deleted.

database/migrations/2021_08_23_100001_create_blogs_table.php

Lines changed: 36 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
use Illuminate\Database\Migrations\Migration;
44
use Illuminate\Support\Facades\Schema;
5-
use Illuminate\Database\Schema\Blueprint;
65

76
class CreateBlogsTable extends Migration
87
{
@@ -27,23 +26,54 @@ public function up()
2726
$table->text('tags')->nullable();
2827
$table->integer('viewcount')->nullable();
2928
$table->string('slug', 255)->nullable();
30-
$table->enum('published', ['yes','no'])->nullable();
29+
$table->enum('published', ['yes', 'no'])->nullable();
3130
$table->text('published_at')->nullable();
3231
$table->integer('user_id')->nullable();
3332
$table->string('user_type', 255)->nullable();
3433
$table->softDeletes();
3534
$table->nullableTimestamps();
3635
});
36+
37+
/*
38+
* Table: tags
39+
*/
40+
Schema::create('blog_tags', function ($table) {
41+
$table->increments('id');
42+
$table->string('name', 255)->nullable();
43+
$table->string('slug', 255)->nullable();
44+
$table->enum('status', ['show', 'hide'])->nullable();
45+
$table->integer('user_id')->nullable();
46+
$table->string('user_type', 255)->nullable();
47+
$table->softDeletes();
48+
$table->nullableTimestamps();
49+
});
50+
51+
/*
52+
* Table: categories
53+
*/
54+
Schema::create('blog_categories', function ($table) {
55+
$table->increments('id');
56+
$table->string('name', 255)->nullable();
57+
$table->string('slug', 255)->nullable();
58+
$table->enum('status', ['show', 'hide'])->nullable();
59+
$table->integer('user_id')->nullable();
60+
$table->string('user_type', 255)->nullable();
61+
$table->softDeletes();
62+
$table->nullableTimestamps();
63+
});
64+
3765
}
3866

3967
/*
40-
* Reverse the migrations.
41-
*
42-
* @return void
43-
*/
68+
* Reverse the migrations.
69+
*
70+
* @return void
71+
*/
4472

4573
public function down()
4674
{
4775
Schema::drop('blogs');
76+
Schema::drop('blog_tags');
77+
Schema::drop('blog_categories');
4878
}
4979
}

database/seeds/BlogTableSeeder.php

Lines changed: 134 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,140 @@ public function run()
5858

5959
]);
6060

61+
DB::table('blog_categories')->insert([
62+
[
63+
'id' => 1,
64+
'name' => 'Arts and Entertainment',
65+
'slug' => NULL,
66+
'status' => 'show',
67+
'user_id' => 1,
68+
'user_type' => 'App\Models\User',
69+
],
70+
[
71+
'id' => 2,
72+
'name' => 'Branding',
73+
'slug' => NULL,
74+
'status' => 'show',
75+
'user_id' => 1,
76+
'user_type' => 'App\Models\User',
77+
],
78+
[
79+
'id' => 3,
80+
'name' => 'Design Tutorials',
81+
'slug' => NULL,
82+
'status' => 'show',
83+
'user_id' => 1,
84+
'user_type' => 'App\Models\User',
85+
],
86+
[
87+
'id' => 4,
88+
'name' => 'Designing',
89+
'slug' => NULL,
90+
'status' => 'show',
91+
'user_id' => 1,
92+
'user_type' => 'App\Models\User',
93+
],
94+
[
95+
'id' => 5,
96+
'name' => 'Feature',
97+
'slug' => NULL,
98+
'status' => 'show',
99+
'user_id' => 1,
100+
'user_type' => 'App\Models\User',
101+
],
102+
]);
103+
104+
DB::table('blog_tags')->insert([
105+
[
106+
'id' => 1,
107+
'name' => 'Advertisements',
108+
'slug' => NULL,
109+
'status' => 'show',
110+
'user_id' => 1,
111+
'user_type' => 'App\Models\User',
112+
],
113+
[
114+
'id' => 2,
115+
'name' => 'Artistry',
116+
'slug' => NULL,
117+
'status' => 'show',
118+
'user_id' => 1,
119+
'user_type' => 'App\Models\User',
120+
],
121+
[
122+
'id' => 3,
123+
'name' => 'Blog',
124+
'slug' => NULL,
125+
'status' => 'show',
126+
'user_id' => 1,
127+
'user_type' => 'App\Models\User',
128+
],
129+
[
130+
'id' => 4,
131+
'name' => 'Conceptual',
132+
'slug' => NULL,
133+
'status' => 'show',
134+
'user_id' => 1,
135+
'user_type' => 'App\Models\User',
136+
],
137+
[
138+
'id' => 5,
139+
'name' => 'Design',
140+
'slug' => NULL,
141+
'status' => 'show',
142+
'user_id' => 1,
143+
'user_type' => 'App\Models\User',
144+
],
145+
[
146+
'id' => 6,
147+
'name' => 'Fashion',
148+
'slug' => NULL,
149+
'status' => 'show',
150+
'user_id' => 1,
151+
'user_type' => 'App\Models\User',
152+
],
153+
[
154+
'id' => 7,
155+
'name' => 'Inscription',
156+
'slug' => NULL,
157+
'status' => 'show',
158+
'user_id' => 1,
159+
'user_type' => 'App\Models\User',
160+
],
161+
[
162+
'id' => 8,
163+
'name' => 'Smart',
164+
'slug' => NULL,
165+
'status' => 'show',
166+
'user_id' => 1,
167+
'user_type' => 'App\Models\User',
168+
],
169+
[
170+
'id' => 9,
171+
'name' => 'Quotes',
172+
'slug' => NULL,
173+
'status' => 'show',
174+
'user_id' => 1,
175+
'user_type' => 'App\Models\User',
176+
],
177+
[
178+
'id' => 10,
179+
'name' => 'Unique',
180+
'slug' => NULL,
181+
'status' => 'show',
182+
'user_id' => 1,
183+
'user_type' => 'App\Models\User',
184+
],
185+
[
186+
'id' => 11,
187+
'name' => 'Concepts',
188+
'slug' => NULL,
189+
'status' => 'show',
190+
'user_id' => 1,
191+
'user_type' => 'App\Models\User',
192+
],
193+
]);
194+
61195
DB::table('permissions')->insert([
62196
[
63197
'slug' => 'blog.blog.view',

0 commit comments

Comments
 (0)