ashattack
Sometimes Vendor CSS (and JS) are not found after installing
Hi everyone,
Sometimes when installing a new plugin I get a net:ERR_ABORTED 404 (Not Found) message in my console for said plugins css/js.
It occurred for both JS and CSS with filament-database-schedule (#husam-database-schedule) and recently it occurred when I pulled filament-slim-scrollbar.
For the latter for example:
There are no publishable assets, and I ran npm run dev / npm run build. Apart from manually pulling them in - what is the correct way to go about correcting this?
Thank you!
7 replies
After moving resources into a 'shared' directory - browser sync refresh during dev doesn't occur
Hi guys,
So basically I developed a resource in the admin panel (Filament/Admin/**) directory.
Recently I moved a resource and its accompaning resource directory from
Filament/Admin/
to Filament/Resources/
I added a new ->discoverResources
in the Admin panel provider, and everything seemed to be dandy.
However now when I edit the resource in the new directory and hit save in my IDE, it no longer refreshes the browser. The browser of me being in the admin panel, only refreshes when I edit a resource within the admin directory but doesn't when i edit the resource in the new directory.
I restarted my server, dumped the autoload, cleared routes, cleared the optimize, nothing.
Any suggestions on what to do?4 replies
How to inject a livewire component into form builder?
Hello to all of you beautiful human beings,
I was working on a simple resource - create form. Part of the form contains a DatePicker. The context is order processing. In most cases, the default value would be "now()" or todays date (YYYY-MM-DD). However I wanted to add a few buttons such as 'Today / Yesterday / 2 Days Ago / 3 Days Ago' that when clicked, auto populates the date picker value to be whatever date matches the button action - if no button action - then the user can anyway freely edit the form and the default is anyway
now()
.
I have trouble finding what the best way to accomplish this. I thought initially I could create a Livewire component through the php artisan make:livewire blahblah
command:
and a blade template:
Then in my form builder I was hoping to inject Livewire::make('App\Livewire\FulFillmentFragmentDateCompletedHelper
but then I realize I may need to create an entirely custom form based through livewire.
What would be the best way to achieve this? Is there a way to inline an input field based on a custom livewire component along the normal form schema or what would be the ideal way to implement something like this? Appreciate any pointers!3 replies
How do I create a custom Table Action
Hi guys,
I have a resource let's title it StorefrontResource. I created a custom page based on this resource called ManageWorkers. It allows me to add members to the store.
I registered the page in getPages() of the warehouse resource:
On the default list view of the StorefrontResource, how can I attach an action titled 'Manage' on the table so that when clicking it - it'll bring me to the manage workers page of the Storefront record?
Storefront Resource
-->Actions/ManageAction.php
-->Pages/...ManageWorkers.php
--StorefrontResource.php
I don't want to add code in the redirect within the resource file, but rather I'd like to have a seperate action file. Is there an artisan command for creating a table action? What is the proper convention to reference the route? I'm unsure what to override in the Manage Action class. Any pointers?
4 replies
How to have a dehydrated function in edit operation but not in create operation
Hi community - hoping someone could point me in the right direction.
In my user resource, I have the form function contain
->dehydrated(function (?array $state, ?Model $user){...}
that should only be used on the edit page. However the form logic currently serves both the create and edit form. I'd like to separate the two.
However on the create user page, this dehydrate call will attempt to instantiate a $user model but it's obviously not instantiable on create (since the user hasn't been created yet).
How can I only have the dehydrated call occur on the edit operation but not on the create page? Like how can I split up the form function based on whether its on the create or edit page?
14 replies
The ideal way to setup permissions
Hi filament community!
New to filament, it's been a pleasure so far. I have a filament deployment with a few panels (admin, ops, service, and community). The service and community are tenanted. I'm looking to implement user management and permissions along with it being configured through the admin panel.
That said, in the past I've always used spatie-permissions to set everything up. However I noticed that filament has a few permission plugins that work off spatie. Before I get to implementing the hasTenants thing - it's logic will be based on permissions and I want to go for the most optimal route:
The way I (naively) see it I have a few options:
1. Using spatie/laravel-permission and implementing it manually (Currently what I have pulled in to my project, haven't implemented much yet)
2. Use Spatie Roles Permission (filament support plugin) which uses spatie/laravel-permission
3. Use Shield by Bezhan Salleh which also uses spatie/laravel-permission and work of that.
I'm inclined to pull in (3) Shield. Would I be correct in saying that I can handle my entire apps permissions using Shield? Sorry if this seems like a dumb question, the descriptions for the plugins were a bit ambiguous for me.
7 replies