Admin Panel | Build Blog with Laravel, Livewire & Filament #8

แชร์
ฝัง
  • เผยแพร่เมื่อ 22 ก.ย. 2024

ความคิดเห็น • 50

  • @francosimonini7103
    @francosimonini7103 ปีที่แล้ว +1

    I am trying to install Filament but I always get this error "Your requirements could not be resolve to an installable set of packages". How can I solve this issue? Thanks

    • @francosimonini7103
      @francosimonini7103 ปีที่แล้ว +2

      Solved,... in my case: PHP version 8.1,2, I had firstly to uncomment extension=intl in the php.ini file then install php8.1.intl

    • @yelocode
      @yelocode  ปีที่แล้ว

      Thanks for sharing the solution

  • @umairmalik6685
    @umairmalik6685 9 หลายเดือนก่อน +1

    THANKS MAN YOUR VIDEO MAKE MY DAY!

    • @yelocode
      @yelocode  9 หลายเดือนก่อน

      Glad I could help

  • @scientist.entity6609
    @scientist.entity6609 9 หลายเดือนก่อน +1

    An other great video, thank you !

  • @kuroneko3685
    @kuroneko3685 8 หลายเดือนก่อน +1

    Hello, this is indeed a great video!
    but i have some error, i get this
    "SQLSTATE[42S22]: Column not found: 1054 Unknown column 'category_post.category_id' in 'on clause'
    select distinct `categories`.* from `categories` left join `category_post` on `categories`.`id` = `category_post`.`category_id` where (`title` like %php%) order by `categories`.`title` asc limit 50"

  • @daneymsjosh
    @daneymsjosh 2 หลายเดือนก่อน

    I had a problem with filament installation saying that, "Your requirements could not be resolve to an installable set of packages". Is this a good solution?
    I found that when I run this command, instead of the one in the documentation, it would install it:
    composer require filament/filament:"^3.2.52" -W

  • @ousssika5359
    @ousssika5359 ปีที่แล้ว +3

    the Select sould be Select:make('user_id')->label('author') not Select:make('author') ,

    • @yelocode
      @yelocode  ปีที่แล้ว +2

      I tested it out, it seems to work on updates so I didn't notice the issue, but not when creating, I'll fix that in the next episode. Thanks for letting me know.

    • @ivanbarta2821
      @ivanbarta2821 11 หลายเดือนก่อน +1

      You are right, thaks 👍

  • @RafaelSorto
    @RafaelSorto ปีที่แล้ว +1

    @yelocode is there a way to stop the slug from automatically updating if it has been manually set by the admin to avoid overwritting it ?

    • @yelocode
      @yelocode  ปีที่แล้ว

      Yes, you can do that, there is a trick on the filament website about this :
      v2.filamentphp.com/tricks/generate-slugs-without-overriding
      There is also a plugin for slugs with more features, but I personally haven't used it :
      github.com/camya/filament-title-with-slug
      May be helpful for your usecase.

  • @kreaweb-be
    @kreaweb-be ปีที่แล้ว +1

    We now have 2 login routes: /login and /admin/login
    The first uses Jetstream, the latter Filament. This rases 2 questions:
    1. How will you eliminate one of them and make the other work for both?
    2. How can you redirect users to the Admin panel after login on JetStream?
    Thanks.

    • @dimyatiutoyo8655
      @dimyatiutoyo8655 ปีที่แล้ว

      redirect /login to /admin/login maybe?

    • @yelocode
      @yelocode  ปีที่แล้ว +2

      Well since, we also have regular users who should not have access to the admin panel, I don't think in most cases you would want to remove the filament login route.
      But if you really want only one login route, you can
      1. with jetstream, since it uses fortify you can remove the login / all auth pages that have a view by setting
      'views' => false, inside the foritfy.php config file. Although the logout route will still work as far as I know it just removes the pages that return a blade file.
      2. For this one, you will need to create a custom login response and then redirect the user to admin page if they are and admin, a simple solution like below would work:
      inside app/Providers/FortifyServiceProvider.php:
      use Laravel\Fortify\Contracts\LoginResponse;
      $this->app->instance(LoginResponse::class, new class implements LoginResponse
      {
      public function toResponse($request)
      {
      if ($request->user()->is_admin) {
      return redirect()->intended('/admin/dashboard');
      }
      return redirect()->intended('/');
      }
      });

  • @ahmoodrizale
    @ahmoodrizale 10 หลายเดือนก่อน +1

    Hi Nice Tutorials, but i have a question how to show suggestion when type like afterStateUpdated and just tab to complete it , because my laravel/vscode didn't show it and i must manually import use Filament\Forms\Components\TextInput in my code otherwise it will error.

    • @yelocode
      @yelocode  10 หลายเดือนก่อน

      Thanks for watching. You need to install a php plugin for vs code to get the auto suggestion, I cover the 2 most popular options in this video: Top VS Code Plugins for Laravel Development
      Top VS Code Plugins for Laravel Development
      th-cam.com/video/Fecxmo3IDSQ/w-d-xo.html

  • @NathanNjaha
    @NathanNjaha 6 หลายเดือนก่อน

    hi!
    I can't connect with my jetstream code on the admin panel, can you help me?

  • @emobg7771
    @emobg7771 8 หลายเดือนก่อน

    How can I make the Laravel button in the left top corner to redirect me to my website home page?

  • @WEESPlayzZz
    @WEESPlayzZz ปีที่แล้ว +2

    Wow, i think filament is awesome but at same time it's simple but complicated 😂

    • @yelocode
      @yelocode  ปีที่แล้ว

      Haha, yea for simple crud its super easy, but more complex stuff it can get complicated

  • @exeis1052
    @exeis1052 9 หลายเดือนก่อน

    I've done something dumb and it's showing this error, Is there any process to unistall filament and re-install it? if no then how do i fix this problem?
    public static function make(): static
    16▕ {
    ➜ 17▕ return new static('No default Filament panel is set. You may do this with the `default()` method inside
    a Filament provider\'s `panel()` configuration.');
    18▕ }

  • @ivanbarta2821
    @ivanbarta2821 11 หลายเดือนก่อน

    Amazing 👍

    • @yelocode
      @yelocode  11 หลายเดือนก่อน

      Thank you

  • @frederickosei4553
    @frederickosei4553 6 หลายเดือนก่อน

    Nice tutorial but what is the best way to deploy this on a cpanel

  • @ReynaldoPutra-j5w
    @ReynaldoPutra-j5w 10 หลายเดือนก่อน

    I cant login to filament /admin, but when i try login using jetstream i can access /admin filament. Im using laravel 10 with filament 3

  • @quamenass552
    @quamenass552 3 หลายเดือนก่อน

    please guys i am getting this error after working on the creating post with the Admin page
    SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value
    i need help

    • @yelocode
      @yelocode  3 หลายเดือนก่อน

      There is a mistake in this episode causing this error. we fix it in future eps. Thanks for watching

  • @HamadAbdulla_7
    @HamadAbdulla_7 ปีที่แล้ว +1

    thinks Boss

    • @yelocode
      @yelocode  ปีที่แล้ว

      Thanks for watching Hamad

  • @jhalmu
    @jhalmu ปีที่แล้ว +1

    Thanks for these. I have to just figure out why editing wants post_tag and I have tag_post in my database... migration file is good, have migrated fresh and seeded again...
    SELECT
    `tags`.*,
    `post_tag`.`post_id` AS `pivot_post_id`,
    `post_tag`.`tag_id` AS `pivot_tag_id`
    FROM
    `tags`
    INNER JOIN `post_tag` ON `tags`.`id` = `post_tag`.`tag_id`
    WHERE
    `post_tag`.`post_id` = 1

    • @jhalmu
      @jhalmu ปีที่แล้ว

      If I take this away it works: ->relationship('tags', 'title')

    • @jhalmu
      @jhalmu ปีที่แล้ว

      OK I changed it to: Select::make('author_id')
      ->label('Author')
      ->options(User::all()->pluck('name', 'id'))
      ->searchable()
      Which is better anyway. But strange still.
      That too do not work.

    • @jhalmu
      @jhalmu ปีที่แล้ว

      Well, I just made new migration for post_tag so I can continue. Sorry spamming here :)

    • @yelocode
      @yelocode  ปีที่แล้ว +2

      Thanks for watching. The default convention in laravel is to have pivot table name, ordered alphabetically. So that is why I used category_post, since c comes before p. If you use this convention laravel can then automatically detect your table, but if you are not using this convention you can then tell laravel your table name manually and it should solve the issue
      something like bellow should work:
      public function tags()
      {
      return $this->belongsToMany(Tag::class,'tag_post');
      }
      This is required because, laravel doesn't have a way to know your table name.

    • @yelocode
      @yelocode  ปีที่แล้ว +1

      Select::make('author_id')
      ->label('Author')
      ->options(User::all()->pluck('name', 'id'))
      ->searchable()
      This solution will work, but because it's loading all the users in the database, if you have a large table with 10k or so uses for example, it will slow down your application. When using the relationship, filament will only load what you have searched for. So it should be faster on larger tables.

  • @abdulrahmanalharthy9335
    @abdulrahmanalharthy9335 11 หลายเดือนก่อน

    Hello, can you help? I am getting this error:
    SELECT
    `categories`.*,
    `category_post`.`post_id` AS `pivot_post_id`,
    `category_post`.`category_id` AS `pivot_category_id`
    FROM
    `categories`
    INNER JOIN `category_post` ON `categories`.`id` = `category_post`.`category_id`
    WHERE
    `category_post`.`post_id` = 1
    I followed your steps exactly, but I got this error after I added the relationships.

    • @abdulrahmanalharthy9335
      @abdulrahmanalharthy9335 11 หลายเดือนก่อน

      Thanks, I found I wrote the relationships wrong .. :)

  • @yamonemyatmoe2417
    @yamonemyatmoe2417 11 หลายเดือนก่อน

    I'm following your tutorial starting for ep 1. When i create post I have an error "SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value" . Normally in laravel, Auth()->id works but in this case I canno't find what's wrong. How can I solve this issue? Thanks for creating valuable tutorials

    • @yelocode
      @yelocode  11 หลายเดือนก่อน +1

      Thanks for watching.
      It might be due to $fillable inside your User Model class. Check if user_id is there. I have had a similar issue in the past and it's usually due to this reason. If not, I have the full code on github, maybe you can double check it with the working version to see what could be missing.
      github.com/yelocode/laravel-blog-project

    • @yamonemyatmoe2417
      @yamonemyatmoe2417 11 หลายเดือนก่อน

      @@yelocode thank you sir, this is my coding error

    • @AntonioSequeira-me2xg
      @AntonioSequeira-me2xg 10 หลายเดือนก่อน +1

      @@yelocode Thanks for your tutorial. great job. I was following it but got stuck with this issue. Only solved by changing the Select name: Select::make('user_id'). Am I missing something else?

    • @yelocode
      @yelocode  10 หลายเดือนก่อน

      ​@@AntonioSequeira-me2xgThanks for watching. That is an issue in the code, it's something I fix in upcoming episodes.

  • @eramitgupta271
    @eramitgupta271 ปีที่แล้ว +1

    abc
    livewire 3 Laravel data attribute how to get value

    • @yelocode
      @yelocode  ปีที่แล้ว

      Need to add wire:mode to the and add a value
      something like below:
      abc