Skip to content

Commit d366822

Browse files
committed
upgrade npm and composer stack
fix article publish and un-published
1 parent b4f1b17 commit d366822

File tree

17 files changed

+9017
-14804
lines changed

17 files changed

+9017
-14804
lines changed

.eslintignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/public
1+
/public

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ _ide_helper.php
1212
/public/js/
1313
/public/css/
1414
/public/fonts/
15-
/public/mix-manifest.json
15+
/public/mix-manifest.json
16+
/*.log

app/Article.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ class Article extends Model
1717
*/
1818
protected $table = 'articles';
1919

20-
protected $fillable = ['title', 'slug', 'description', 'content'];
20+
protected $fillable = ['title', 'slug', 'description', 'content', 'published', 'published_at'];
2121

2222
/**
2323
* The attributes that should be mutated to dates.

app/Http/Controllers/Api/ArticleController.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public function publishedArticles()
3636
/**
3737
* Get single published article
3838
*
39-
* @param $id
39+
* @param $slug
4040
* @return mixed
4141
*/
4242
public function publishedArticle($slug)
@@ -112,7 +112,6 @@ public function update(ArticleRequest $request, $id)
112112

113113
$data = $request->validated();
114114
$data['slug'] = str_slug($data['title']);
115-
116115
$article->update($data);
117116

118117
return response()->json($article, 200);

app/Http/Requests/ArticleRequest.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ public function rules()
2828
'title' => 'required|min:3',
2929
'description' => 'required|min:10',
3030
'content' => 'required|min:10',
31-
'publised' => 'boolean',
32-
'publised_at' => 'date',
31+
'published' => 'nullable|boolean',
32+
'published_at' => 'nullable|date',
3333
];
3434
}
3535
}

0 commit comments

Comments
 (0)