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
Thank you so much for these learning videos. I love your teaching style. I have updated the packages in Composer to Framework 11. I had to update version of collision and sanctum as well. After I did this, all (most) of the areas work as before. Only the search does not work. I am not using the Alpine.js search version, but have the wire:model.live.debounce.100ms="search" in this one. The livewire version 3 has not changed. So I don't understand why it is not working. Also the image uploading and changing the pic in profile is not working. Do you have a quick fix for both above problems? It would be great if you could update the code on Github to Framework 11 so that everyone learns based on the latest versions. Here, if you could add to each video, whereever there are changes, in the last 5 minutes, or even a new video, what have you done to make these things work. That would be so charming to learn updating it of the codes, which all have learnt.
If you are using Windows Powershell to install filament, the ^ character needs to be escaped or you could just use the install command without the specific version like composer: require filament/filament -W
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.
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
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
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.
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('/'); } });
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"
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.
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▕ }
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.
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
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
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
@@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?
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
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.
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.
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.
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.
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
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
Thanks for sharing the solution
Thank you so much for these learning videos. I love your teaching style.
I have updated the packages in Composer to Framework 11. I had to update version of collision and sanctum as well. After I did this, all (most) of the areas work as before. Only the search does not work. I am not using the Alpine.js search version, but have the wire:model.live.debounce.100ms="search" in this one. The livewire version 3 has not changed. So I don't understand why it is not working.
Also the image uploading and changing the pic in profile is not working.
Do you have a quick fix for both above problems? It would be great if you could update the code on Github to Framework 11 so that everyone learns based on the latest versions. Here, if you could add to each video, whereever there are changes, in the last 5 minutes, or even a new video, what have you done to make these things work.
That would be so charming to learn updating it of the codes, which all have learnt.
THANKS MAN YOUR VIDEO MAKE MY DAY!
Glad I could help
If you are using Windows Powershell to install filament, the ^ character needs to be escaped or you could just use the install command without the specific version like composer: require filament/filament -W
You also need to enable the intl and zip extensions for php.
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.
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
An other great video, thank you !
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
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.
redirect /login to /admin/login maybe?
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('/');
}
});
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"
@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 ?
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.
How can I make the Laravel button in the left top corner to redirect me to my website home page?
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▕ }
Wow, i think filament is awesome but at same time it's simple but complicated 😂
Haha, yea for simple crud its super easy, but more complex stuff it can get complicated
Amazing 👍
Thank you
hi!
I can't connect with my jetstream code on the admin panel, can you help me?
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
Nice tutorial but what is the best way to deploy this on a cpanel
the Select sould be Select:make('user_id')->label('author') not Select:make('author') ,
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.
You are right, thaks 👍
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
There is a mistake in this episode causing this error. we fix it in future eps. Thanks for watching
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
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
@@yelocode thank you sir, this is my coding error
@@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?
@@AntonioSequeira-me2xgThanks for watching. That is an issue in the code, it's something I fix in upcoming episodes.
thinks Boss
Thanks for watching Hamad
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
If I take this away it works: ->relationship('tags', 'title')
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.
Well, I just made new migration for post_tag so I can continue. Sorry spamming here :)
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.
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.
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.
Thanks, I found I wrote the relationships wrong .. :)
abc
livewire 3 Laravel data attribute how to get value
Need to add wire:mode to the and add a value
something like below:
abc