Laravel Filament Admin Panel: [4] Roles & Relation Manager

  Рет қаралды 11,581

Designated Coder

Designated Coder

Күн бұрын

How to build a Laravel Admin Panel. Built with Laravel 9, Filament, Spatie's Laravel-Permissions, Jetstream, Livewire, and Tailwind CSS.
In this part, we set up Roles and include permissions using a relation manager.
Project name will be Coder's Filament Admin Panel.
We will only be using the default authentication setup with Laravel, Jetstream, and Sanctum.
===================================================
📓 Video Chapters:
0:00 Laravel Filament Admin Panel: [4] Roles & Relation Manager
===================================================
✔️ Click to subscribe: / @designatedcoder
===================================================
✔️ github.com/des...
===================================================
🔗 Documentation:
Filament: filamentphp.com/
Spatie's Laravel-Permission: spatie.be/docs...
===================================================
//SHOW SUPPORT:
○ Buy Me a Beer: www.buymeacoff...
//FOLLOW ME:
○ Twitter: / dezignatedcoder
//TOOLS & SERVICES I USE:
○ Get $100 or more free credit for 60 days from DigitalOcean: m.do.co/c/7936...
DISCLAIMER: Links included in this description might be affiliate or referral links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you! Thank you for supporting my channel so I can continue to provide you with free content each week!
#designatedcoder #codersfilamentadminpanel #filamentadminpanel

Пікірлер: 32
@DesignatedCoder
@DesignatedCoder Жыл бұрын
How to build a Laravel Admin Panel. Built with Laravel 9, Filament, Spatie's Laravel-Permissions, Jetstream, Livewire, and Tailwind CSS. In this part, we set up Roles and include permissions using a relation manager. Project name will be Coder's Filament Admin Panel. We will only be using the default authentication setup with Laravel, Jetstream, and Sanctum. =================================================== 📓 Video Chapters: 0:00 Laravel Filament Admin Panel: [4] Roles & Relation Manager =================================================== ✔ Click to subscribe: kzbin.info/door/GRi3eupIN5rOP_tDLxLs2w =================================================== ✔ github.com/designatedcoder/coders_filament_admin_panel =================================================== 🔗 Documentation: Filament: filamentphp.com/ Spatie's Laravel-Permission: spatie.be/docs/laravel-permission/v5/introduction =================================================== //FOLLOW ME: ○ Twitter: twitter.com/DezignatedCoder //TOOLS & SERVICES I USE: ○ Get $100 or more free credit for 60 days from DigitalOcean: m.do.co/c/793677d3bf86 DISCLAIMER: Links included in this description might be affiliate or referral links. If you purchase a product or service with the links that I provide I may receive a small commission. There is no additional charge to you! Thank you for supporting my channel so I can continue to provide you with free content each week! #designatedcoder #codersfilamentadminpanel #filamentadminpanel
@devpro6702
@devpro6702 Жыл бұрын
your my love i love your voice and your panel its awesome 😍😍😍😍😍😍💗💗💗💗💗💔
@haythamaldamen3578
@haythamaldamen3578 Жыл бұрын
Filament\Forms\Components\MultiSelect' is deprecated. instead please use : Select::make('permissions') ->multiple() ->relationship('permissions', 'name') ->preload()
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there Haytham Aldamen. Thanks for watching. Welcome to the channel! 😎 And thanks for catching that for me, I appreciate that. I'll fix it in the repo later today.
@haythamaldamen3578
@haythamaldamen3578 Жыл бұрын
@@DesignatedCoder Thank you for your valuable information you are presenting in your channel and that information makes your channel the best one in Laravel learning channel and we all appreciate you and your channel and hope you and your channel the best. BTW what is your name?
@SanderCokart
@SanderCokart Жыл бұрын
I am running into the issue that Tables\Actions\AssociateAction::make() ->preloadRecordSelect(), doesn't preload at all
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there Sander Cokart. Thanks for watching. Welcome to the channel! 😎 I've not used that action so I wouldn't be able to give you reliable info on it. You could check out the filament repo and see if there are issues already posted about it and if not you could ask about it there. Hope this helps and good luck to you. github.com/filamentphp/filament
@kreaweb-be
@kreaweb-be Жыл бұрын
Why do the roles ADMIN and SUPER-ADMIN have exact the same permissions?
@vugarkhalil
@vugarkhalil 11 ай бұрын
Respect
@winwift
@winwift Жыл бұрын
Hi, Any idea why Perrmissions dont show up after adding PermissionsRelationManager::class ? imports are all there.
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Not really sure why that is, Lukáš Zavadil. Are you sure you followed all steps?
@MikitaVlasau
@MikitaVlasau Жыл бұрын
filament is already published permission & roles package. filament-spatie-roles-permissions Just install this and use it. Beside of this, want to see how to add sign up page?
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there @user-mn8ds4ns4i. Thanks for watching. Welcome to the channel! 😎 We didn't use any filament specific packages for this series but you're more than able to use what you want for your own project. Also, we've finished this series several months ago and I won't be using making Filament videos for a long time as I've been working with it for nearly a year and a half and ready to move on since this is not a Filament channel. Thanks for your input and I'll keep note of these for any future Filament videos. Lots of luck to you.
@tharindumadushan1569
@tharindumadushan1569 Жыл бұрын
Hello how to Insert each number from the "Numbers" field as a new row in the MySQL table, keeping the data of all other fields the same
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there @tharindumadushan1569. Thanks for watching. Welcome to the channel! 😎 I'm not really sure what you're talking about. The numbers field?
@kreaweb-be
@kreaweb-be Жыл бұрын
There is a problem with this setup! You use a SELECT (multiple) to display the permissions for this role and underneath you use a the GETRELATIONS PermissionsRelationManager to again display the permissions for this role. When you remove a permission from the SELECT, the permisson is DETACHED from the role. This is what you would want and what you could or would expect. When you remove a permission from the RELATIONMANAGER, the permission is DELETED from the permissions table and thus removed from all other roles. This is NOT wat you want and what you could or would expect. Can you please explain? Thanks. Proposed solution : In the relationmanager, do not use CREATEACTION, EDITACTION or DELETEACTION. Only use ATTACHACTION, DETACHACTION and BULKDETACHACTION. ->headerActions([ Tables\Actions\AttachAction::make(), ]) ->actions([ Tables\Actions\DetachAction::make(), ]) ->bulkActions([ Tables\Actions\BulkActionGroup::make([ Tables\Actions\DetachBulkAction::make(), ]), ])
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there @kreaweb-be. Thanks for watching. Welcome to the channel! 😎 Great questions and thanks for asking. I'm answering both of your questions here so you don't have to go looking elsewhere for my responses to them. I highly recommend you pass along issues/suggestions with how things work directly to the FILAMENT team. I am not affiliated with them nor involved with the DEVELOPMENT of the package. I can only share my EXPERIENCE with trying it and figuring out what it does, and in this case we used just the default setup for the relation managers. It's not a big deal if it doesn't work to your exact specifications. The series itself is taken from a project I created for a client so their specs where how I implemented it. They didn't want/need relation managers so that was a FREE bonus for my audience from an existing project. In the end, YOU should take this series as what it is which is a DEMO where I show you HOW to use it. You don't even NEED to use the relation manager. I wouldn't and haven't for my own projects as it doesn't make sense for me to have that type of functionality on the same page as the resource. I PREFER to keep things separate and either making changes on the specific resource or at the very least a distinct modal. It CLEARLY gets confusing real fast when you don't know what it is or how it works. Filament should be easy without having to reinvent the wheel. I demonstrated a variety of things in this series because it's useful content for a variety of different projects. To answer your SECOND question about why the SUPER-ADMIN and ADMIN have the same PERMISSIONS. Sometimes I make demos and series on projects that I create specifically for the channel. Sometimes I create series/demos from projects I've CREATED and SOLD and try to make it more consumable and broad for this channel. Sometimes it comes down to just my preference. These methods are a great way to keep the content FREE for people to use relevant parts for their own projects. My reasons vary and not always relevant to every single person/entity. Like everything on my channel, if it's something you don't want to implement then that's up to you and your project. I gear my channel to people who may want to learn something or even just are curious about how something works. None of the projects on my channel are hyper specific to any one project, EXCEPT for the project I intend to build. This is so that features can be added and manipulated or even completely removed for different contexts. Try your solution. If it works better for you, that's great! There's more than one way to do anything. Hope this helps and lots of luck to you on your development journey!
@MusicaPaLarumba
@MusicaPaLarumba Жыл бұрын
Hi, how can we replace the filement login with jetstreeam, we are loosing 2fa and things like that provided by jetstream. also we are loosing the profile page provided by jetsteam.
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there Leonardo Salas. Thanks for watching. Welcome to the channel! 😎 Filament is an admin panel with it's own environment that is designed to work with Laravel and Livewire and is responsible for authorization. It works a lot like Voyager in that way. Jetstream is responsible for setting up authentication. I haven't addressed all of the the authorization capabilities yet which is the focus for us learning to use Filament. So, no you can't add Jetstream to filament. You also lose nothing that Jetstream provides as it works for all users in your app. Please stay tuned to see what I mean as it's hard for me to explain in writing. Authorization and authentication are not the same thing.
@DevEager
@DevEager 11 ай бұрын
Hi there, May I ask if it possible to encrypt the id in url in Edit Page? then decrypt it when updating?
@DesignatedCoder
@DesignatedCoder 11 ай бұрын
Hey there @DevEager. Thanks for watching. Welcome to the channel! 😎 I think that you might be able to tap into the lifecycle hooks to manipulate it that way. I haven't looked at the Filament docs for Filament 3 to be able to point you something to see it. You may want to reach out to the Filament team and see if they can offer you some assistance for that. Hope this helps and good luck to you.
@DevEager
@DevEager 11 ай бұрын
@@DesignatedCoder I will take a looked again to the Filament docs under lifecycle hooks. thank you for the response highly appreciate your videos, great work
@yanethramirez4290
@yanethramirez4290 Жыл бұрын
Hello dear, I have a question, how can you prevent a permission that is already assigned to a role from being deleted? How is the user notified?
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there, Yaneth Ramirez! I'm sorry I'm not clear on your question. If you aren't deleting anything then nothing should be deleted. Filament gives a toast notification for actions.
@yanethramirez4290
@yanethramirez4290 Жыл бұрын
@@DesignatedCoder I have a specific example: currently I have a table of countries and states, in the state table I store country_id. If I want to delete a country with child records in the state table, the system throws an exception, in this case I need a Toast notification, reporting the error.
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Ah ok, from the docs it looks like you can intercept the deletion process with something like this and it also includes notifications. I haven't tried it but they give an example. Have a look. filamentphp.com/docs/2.x/admin/resources/deleting-records#halting-the-deletion-process Hope this helps and good luck to you.
@yanethramirez4290
@yanethramirez4290 Жыл бұрын
@@DesignatedCoder Thank you very much, congratulations for your channel. I love your classes.
@abkdev770
@abkdev770 Жыл бұрын
hi thanks for the video its amazing , using spatie translable ; i want to insert english and frensh name , but name->fr and name->en are not considered as a name. how to fixe this issue. i make that : class Category extends Model { use HasTranslations; public $translatable = ['name']; and return $form ->schema([ Forms\Components\TextInput::make('name->en') ->required() ->maxLength(255), Forms\Components\TextInput::make('name->fr') ->required() ->maxLength(255), ]);
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there @abkdev770. Thanks for watching. Welcome to the channel! 😎 I can't answer this as I've never used this package.
@gludovatzattila1911
@gludovatzattila1911 10 ай бұрын
I think, there is no need to use this extension. If you type this code: Forms\Components\TextInput::make('name')->label(__('fields.name')) you need to create lang / en / fields.php and there you should create an associative array with key-value pair: [ "name" => "name" ], as well as in the lang / fr / fields.php the same array must be exists with French "name" value.
@wabekatech1709
@wabekatech1709 Жыл бұрын
Please provide the source code Please ,Thank you
@DesignatedCoder
@DesignatedCoder Жыл бұрын
Hey there wabeka tube. Thanks for watching. Welcome to the channel! 😎 I provide all of the links on each video in the description and as a pinned comment. Please look in those areas for what you need. Thanks.
Laravel Filament Admin Panel: [5] User Resource w/ Soft Deletes
19:59
Designated Coder
Рет қаралды 10 М.
Laravel Filament Admin Panel: [1] Project Setup
9:24
Designated Coder
Рет қаралды 17 М.
Whoa
01:00
Justin Flom
Рет қаралды 58 МЛН
Violet Beauregarde Doll🫐
00:58
PIRANKA
Рет қаралды 53 МЛН
Laravel Filament Admin Panel: [8] Translations & Widgets
20:09
Designated Coder
Рет қаралды 11 М.
Cursor Is Beating VS Code (...by forking it)
18:00
Theo - t3․gg
Рет қаралды 85 М.
Change Admin UI without Code
3:21
Legofi
Рет қаралды 54
The Tools I Use to Build Products in Laravel
19:00
Josh Cirre
Рет қаралды 28 М.
10 common mistakes with the Next.js App Router
20:37
Vercel
Рет қаралды 211 М.
[0] Laravel Admin Panel - Adminlte & Inertia
3:09
Designated Coder
Рет қаралды 226
Write Laravel, not PHP (feat. Aaron Francis) | 029
58:45
Backend Banter
Рет қаралды 17 М.
Laravel and Gmail
23:52
Designated Coder
Рет қаралды 469
Laravel Filament Admin Panel: [9] Custom Themes
7:33
Designated Coder
Рет қаралды 15 М.
Whoa
01:00
Justin Flom
Рет қаралды 58 МЛН