Skip to content

Commit 59ef793

Browse files
authored
Merge pull request #15 from Litecms/develop
Update frontend views.
2 parents 05c7dc0 + 7d15aa7 commit 59ef793

23 files changed

+413
-617
lines changed

config/config.php

Lines changed: 66 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -5,59 +5,62 @@
55
/**
66
* Provider.
77
*/
8-
'provider' => 'litecms',
8+
'provider' => 'litecms',
99

1010
/*
1111
* Package.
1212
*/
13-
'package' => 'blog',
13+
'package' => 'blog',
1414

1515
/*
1616
* Modules.
1717
*/
18-
'modules' => ['blog', 'category', 'tag'],
18+
'modules' => ['blog', 'category', 'tag'],
1919

20-
'blog' => [
20+
'blog' => [
2121
'model' => [
2222
'model' => \Litecms\Blog\Models\Blog::class,
2323
'repository' => \Litecms\Blog\Repositories\Eloquent\BlogRepository::class,
2424
'table' => 'blogs',
25-
'hidden'=> [],
25+
'hidden' => [],
2626
'visible' => [],
2727
'guarded' => ['*'],
28-
'slugs' => ['slug' => 'name'],
28+
'slugs' => ['slug' => 'title'],
2929
'dates' => ['deleted_at', 'createdat', 'updated_at'],
3030
'appends' => [],
31-
'fillable' => ['id', 'category_id', 'title', 'description', 'images', 'tags', 'viewcount', 'slug', 'published', 'published_at', 'user_id', 'user_type', 'created_at', 'updated_at', 'deleted_at'],
31+
'fillable' => [
32+
'id', 'category_id', 'title', 'description', 'images', 'tags', 'viewcount',
33+
'slug', 'status', 'user_id', 'user_type', 'created_at', 'updated_at', 'deleted_at',
34+
],
3235
'translatables' => [],
3336
'upload_folder' => 'blog/blog',
3437
'uploads' => [
35-
/*
36-
'file' => [
37-
'count' => 1,
38-
'type' => 'file',
39-
],
40-
*/
41-
'images' => [
38+
/*
39+
'file' => [
4240
'count' => 1,
43-
'type' => 'image',
44-
],
41+
'type' => 'file',
42+
],
43+
*/
44+
'images' => [
45+
'count' => 1,
46+
'type' => 'image',
47+
],
4548
],
4649

4750
'casts' => [
48-
/*
49-
51+
/*
52+
5053
'file' => 'array',
51-
*/
52-
'images' => 'array',
54+
*/
55+
'images' => 'array',
5356
],
5457

5558
'revision' => [],
5659
'perPage' => '20',
57-
'search' => [
58-
'name' => 'like',
60+
'search' => [
61+
'name' => 'like',
5962
'status',
60-
]
63+
],
6164
],
6265

6366
'controller' => [
@@ -66,46 +69,46 @@
6669
'module' => 'Blog',
6770
],
6871
],
69-
'category' => [
72+
'category' => [
7073
'model' => [
7174
'model' => \Litecms\Blog\Models\Category::class,
7275
'repository' => \Litecms\Blog\Repositories\Eloquent\CategoryRepository::class,
7376
'table' => 'blog_categories',
74-
'hidden'=> [],
77+
'hidden' => [],
7578
'visible' => [],
7679
'guarded' => ['*'],
7780
'slugs' => ['slug' => 'name'],
7881
'dates' => ['deleted_at', 'createdat', 'updated_at'],
7982
'appends' => [],
80-
'fillable' => ['id', 'name', 'slug', 'status', 'user_id', 'user_type', 'created_at', 'updated_at', 'deleted_at'],
83+
'fillable' => ['id', 'name', 'slug', 'status', 'user_id', 'user_type', 'created_at', 'updated_at', 'deleted_at'],
8184
'translatables' => [],
8285
'upload_folder' => 'blog/category',
8386
'uploads' => [
84-
/*
85-
'images' => [
86-
'count' => 10,
87-
'type' => 'image',
88-
],
89-
'file' => [
90-
'count' => 1,
91-
'type' => 'file',
92-
],
93-
*/
87+
/*
88+
'images' => [
89+
'count' => 10,
90+
'type' => 'image',
91+
],
92+
'file' => [
93+
'count' => 1,
94+
'type' => 'file',
95+
],
96+
*/
9497
],
9598

9699
'casts' => [
97-
/*
98-
'images' => 'array',
99-
'file' => 'array',
100-
*/
100+
/*
101+
'images' => 'array',
102+
'file' => 'array',
103+
*/
101104
],
102105

103106
'revision' => [],
104107
'perPage' => '20',
105-
'search' => [
106-
'name' => 'like',
108+
'search' => [
109+
'name' => 'like',
107110
'status',
108-
]
111+
],
109112
],
110113

111114
'controller' => [
@@ -114,46 +117,46 @@
114117
'module' => 'Category',
115118
],
116119
],
117-
'tag' => [
120+
'tag' => [
118121
'model' => [
119122
'model' => \Litecms\Blog\Models\Tag::class,
120123
'repository' => \Litecms\Blog\Repositories\Eloquent\TagRepository::class,
121124
'table' => 'blog_tags',
122-
'hidden'=> [],
125+
'hidden' => [],
123126
'visible' => [],
124127
'guarded' => ['*'],
125128
'slugs' => ['slug' => 'name'],
126129
'dates' => ['deleted_at', 'createdat', 'updated_at'],
127130
'appends' => [],
128-
'fillable' => ['id', 'name', 'slug', 'status', 'user_id', 'user_type', 'created_at', 'updated_at', 'deleted_at'],
131+
'fillable' => ['id', 'name', 'slug', 'status', 'user_id', 'user_type', 'created_at', 'updated_at', 'deleted_at'],
129132
'translatables' => [],
130133
'upload_folder' => 'blog/tag',
131134
'uploads' => [
132-
/*
133-
'images' => [
134-
'count' => 10,
135-
'type' => 'image',
136-
],
137-
'file' => [
138-
'count' => 1,
139-
'type' => 'file',
140-
],
141-
*/
135+
/*
136+
'images' => [
137+
'count' => 10,
138+
'type' => 'image',
139+
],
140+
'file' => [
141+
'count' => 1,
142+
'type' => 'file',
143+
],
144+
*/
142145
],
143146

144147
'casts' => [
145-
/*
146-
'images' => 'array',
147-
'file' => 'array',
148-
*/
148+
/*
149+
'images' => 'array',
150+
'file' => 'array',
151+
*/
149152
],
150153

151154
'revision' => [],
152155
'perPage' => '20',
153-
'search' => [
154-
'name' => 'like',
156+
'search' => [
157+
'name' => 'like',
155158
'status',
156-
]
159+
],
157160
],
158161

159162
'controller' => [

database/migrations/2021_08_23_100001_create_blogs_table.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ public function up()
2121
$table->increments('id');
2222
$table->integer('category_id')->nullable();
2323
$table->string('title', 255)->nullable();
24+
$table->text('summary')->nullable();
2425
$table->text('description')->nullable();
2526
$table->text('images')->nullable();
26-
$table->text('tags')->nullable();
27+
$table->string('tags', 225)->nullable();
2728
$table->integer('viewcount')->nullable();
2829
$table->string('slug', 255)->nullable();
29-
$table->enum('published', ['yes', 'no'])->nullable();
30-
$table->text('published_at')->nullable();
30+
$table->enum('status', ['draft', 'completed', 'approved', 'published'])->nullable();
3131
$table->integer('user_id')->nullable();
3232
$table->string('user_type', 255)->nullable();
3333
$table->softDeletes();

0 commit comments

Comments
 (0)