There are 2 ways for it. 1st which I have done it like category and posts. 2nd the Posts, where you are going to select from checkbox or multi select option dropdown list, that under this, this categories, your post will be coming.
@@fundaofwebit after using checkbox method ( Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, string given, called in ) got this error
Nice work sir, thanks
Sir, why do we have to create slug , meta title, description and meta keyword for post While category also have them? I'm so confused
love tou bro😘😘😘😘
you*
is there any way to change admin layout from LTR to RTL
complete 😀😀😀😀😀😀
show if using multiple categories and also tags
There are 2 ways for it.
1st which I have done it like category and posts.
2nd the Posts, where you are going to select from checkbox or multi select option dropdown list, that under this, this categories, your post will be coming.
@@fundaofwebit after using checkbox method ( Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, string given, called in ) got this error
The category id must be an array.
The tag id must be an array.
$data = $request->validated();
$post = new Post;
$post->name = $data['name'];
$post->slug = Str::slug($data['slug']);
$post->description = $data['description'];
if($request->hasfile('image'))
{
$file = $request->file('image');
$filename = time() . '.' . $file->getClientOriginalExtension();
$file->move('uploads/post/', $filename);
$post->image = $filename;
}
$post->author = $data['author'];
$post->yt_s = $data['yt_s'];
$post->refrences = $data['refrences'];
$post->meta_title = $data['meta_title'];
$post->meta_description = $data['meta_description'];
$post->meta_keyword = $data['meta_keyword'];
$post->status = $request->status == true ? '1':'0';
$post->category_id = $data['category_id'];
$post->tag_id = $data['tag_id'];
$post->created_by = Auth::user()->id;
$post->save();
Category
@foreach ($category as $item)
{{ $item->name}}
@endforeach
Tags
@foreach ($tag as $item)
{{ $item->name}}
@endforeach