Laravel 8 Blog - 6: How to Add Posts with Form Request using Eloquent and Fetch data in Laravel 8

Поділитися
Вставка
  • Опубліковано 9 лис 2024

КОМЕНТАРІ • 17

  • @mohsennoor8232
    @mohsennoor8232 2 роки тому +1

    Nice work sir, thanks

  • @dev-maniac2349
    @dev-maniac2349 Місяць тому

    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

  • @hackit1540
    @hackit1540 2 роки тому

    love tou bro😘😘😘😘

  • @mohsennoor8232
    @mohsennoor8232 2 роки тому

    is there any way to change admin layout from LTR to RTL

  • @spacelover2868
    @spacelover2868 2 роки тому

    complete 😀😀😀😀😀😀

  • @TusharZambare
    @TusharZambare 2 роки тому

    show if using multiple categories and also tags

    • @fundaofwebit
      @fundaofwebit  2 роки тому

      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.

    • @TusharZambare
      @TusharZambare 2 роки тому

      @@fundaofwebit after using checkbox method ( Illuminate\Database\Grammar::parameterize(): Argument #1 ($values) must be of type array, string given, called in ) got this error

    • @TusharZambare
      @TusharZambare 2 роки тому

      The category id must be an array.
      The tag id must be an array.

    • @TusharZambare
      @TusharZambare 2 роки тому

      $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();

    • @TusharZambare
      @TusharZambare 2 роки тому

      Category
      @foreach ($category as $item)


      {{ $item->name}}

      @endforeach




      Tags
      @foreach ($tag as $item)


      {{ $item->name}}

      @endforeach