forked from eatvio/eatvio-infra
PHP Insights added
This commit is contained in:
@@ -39,18 +39,6 @@ class Edit extends Component
|
||||
$this->videoUrl = $blogPost->youtube_url;
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
$rules = [
|
||||
/* 'image' => 'required|image|max:2048', */
|
||||
'state' => 'required|in:active,archived',
|
||||
'description' => 'required|min:3',
|
||||
'videoUrl' => 'nullable|url|max:2048',
|
||||
];
|
||||
|
||||
return $rules;
|
||||
}
|
||||
|
||||
public function parentComponentTagAdded(Tag $tag)
|
||||
{
|
||||
$tagIndex = $tag->id;
|
||||
@@ -61,7 +49,7 @@ class Edit extends Component
|
||||
{
|
||||
$tagToDetach = Tag::where('name', $tag)->first();
|
||||
$this->tags = collect($this->tags)
|
||||
->filter(fn ($curTag) => $curTag['name'] != $tag)
|
||||
->filter(fn ($curTag) => $curTag['name'] !== $tag)
|
||||
->all();
|
||||
|
||||
$this->blogPost->tags()->detach($tagToDetach->id);
|
||||
@@ -101,11 +89,20 @@ class Edit extends Component
|
||||
$user->author_of_blog_post()->attach($post->id);
|
||||
|
||||
return redirect()->route('blog_post.show', $post->id);
|
||||
|
||||
}
|
||||
|
||||
public function render()
|
||||
{
|
||||
return view('livewire.blog-post.edit');
|
||||
}
|
||||
|
||||
protected function rules()
|
||||
{
|
||||
return [
|
||||
/* 'image' => 'required|image|max:2048', */
|
||||
'state' => 'required|in:active,archived',
|
||||
'description' => 'required|min:3',
|
||||
'videoUrl' => 'nullable|url|max:2048',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user