skyrowl
skyrowl
FFilament
Created by skyrowl on 10/26/2024 in #❓┊help
Create single record from HasMany relationship in infolist actions
if I can add anything to this, I'd like to do something like the following knowing that the main record is Project: (infolist component)
Actions::make([
Actions\Action::make('create-version')
->form([
SpatieMediaLibraryFileUpload::make('test')
->model(new ProjectVersion(['project_id' => $infolist->getRecord()->id]))
])
->action(function (array $data, Project $project, Form $form) {
$form->saveRelationships();
})
]),
Actions::make([
Actions\Action::make('create-version')
->form([
SpatieMediaLibraryFileUpload::make('test')
->model(new ProjectVersion(['project_id' => $infolist->getRecord()->id]))
])
->action(function (array $data, Project $project, Form $form) {
$form->saveRelationships();
})
]),
3 replies
FFilament
Created by TheEvilTomat0 on 10/24/2024 in #❓┊help
Saved data not showing in multiselect field
Can you add ->rules(['array']) to your component ? I had a similar issue where the component needed to validate as an array for it to output the data
10 replies
FFilament
Created by lodeki on 10/28/2023 in #❓┊help
Wizard blade component ?
There is no custom wizard component tho you could setup a form with a wizard and create custom field components as explained here https://filamentphp.com/docs/3.x/forms/fields/custom This way you can easily have a wizard with your own custom logic and components
4 replies
FFilament
Created by raheel3031 on 10/26/2024 in #❓┊help
path filament plugin in navigation menu
It depends on the plugin, every plugins are PHP packages located in the vendor folder Tho I don't know if there's an easy way to retrieve all of those knowing that many of those don't even need registration in the panels
17 replies
FFilament
Created by Liam on 10/26/2024 in #❓┊help
Filament: panelLayout('grid') on SpatieMediaLibraryFileUpload
You can probably create a custom theme overriding filepond classes to use object cover on those images
4 replies
FFilament
Created by flex on 10/26/2024 in #❓┊help
School-Class-Manager Usability-Problem
Then you can add a second layer with a BelongsToMany for schools in the teacher model You can even create two different panels, one for the school owners with tenancy on schools to manage teachers and one with tenancy on teachers to manage classes This could work quite well but will add a lot of complexity Something that could be more simple would be to use policies well configured and query scoping
7 replies
FFilament
Created by Matthew on 10/26/2024 in #❓┊help
Using rules on data not inside the form
I don't understand everything honestly so I might be wrong Tho it looks like you can add a hidden readonly field to get your type or add custom validation after the form submission If your custom validation fail you can throw a ValidationException with a custom message and it will show it in red like any field would for a ->required() for example
4 replies
FFilament
Created by flex on 10/26/2024 in #❓┊help
School-Class-Manager Usability-Problem
that looks like you need to implement tenancy, one tenant could be a class and each teacher have many tenants (classes) take a look here https://filamentphp.com/docs/3.x/panels/tenancy
7 replies
FFilament
Created by H4L1M on 10/26/2024 in #❓┊help
Redirect to Profile On UsersRessource
if you're using filament panels you can set up a policy for your users it will be something like
public function viewAny(User $user)
{
// if the user can access the list
return true;
// if he can't
return false;
// or
return $user->isAdmin() // your own logic
}

public function view(User $user, User $record)
{
// if he can access other records
return $user->is($record);
// if he can't
return false;
// or
return $user->isAdmin() // your own logic
}
public function viewAny(User $user)
{
// if the user can access the list
return true;
// if he can't
return false;
// or
return $user->isAdmin() // your own logic
}

public function view(User $user, User $record)
{
// if he can access other records
return $user->is($record);
// if he can't
return false;
// or
return $user->isAdmin() // your own logic
}
this is pretty the same with other gates like edit, delete, ... and it will be automatically applied if you're using panels as said above else if you don't use panels you can still set up policies but you'd have to check if they can do whatever things they want to do to check just do something like auth()->user()->can('viewAny', User::class), auth()->user()->can('view', $record)
5 replies
FFilament
Created by skyrowl on 10/15/2024 in #❓┊help
CheckboxList ->in() validation not working
yeah I did, problem is in validation rules I dumped them and it missed the array rule
6 replies
FFilament
Created by skyrowl on 10/15/2024 in #❓┊help
CheckboxList ->in() validation not working
found out that CheckboxList is not considered an array until adding a rule related to arrays as such as ->minItems(1) I probably should open an issue but don't really know how to fix this rn
6 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
Not necessarily on this app honestly, tho I have a bigger app with multi db tenancy to rebuild with octane It's sort of a training before diving in hell 😅
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
Honestly it seems not to be that bad with volt, only thing I'm a bit scared of is octane caching Always a pain to check everything
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
I probably could but I'd need way more knowledges, hope I'll have that level in the future 😁
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
Seems to be way over what I can engineer 😵‍💫
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
Just to know for future reference and because I'll mainly use livewire with volt Is volt injecting scripts ?
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
Yeah I understand, I'm sorry about that I can't even reproduce it myself ... I downgraded then updated to latest did filament:upgrade && npm run build Maybe I had an asset that was flawed ?
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
I found the problem ... ->panelAspectRatio('16:1') this line is messing tho I couldn't reproduce the growing container (the problem why I've put the ratio) I can't really share this exact repo but if I ever get the growing container I'll do the best reproduction I can
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
No description
60 replies
FFilament
Created by skyrowl on 10/4/2024 in #❓┊help
Filepond overflow
just tested, so, it doesn't come directly from volt, I tested with a component like so layout > view component > livewire component
60 replies