Dimitar Papazov DEV
Dimitar Papazov DEV
FFilament
Created by gigiloouu on 11/5/2024 in #❓┊help
When i upload file and click to download its writting that file doest exist
try creating and using custom ->disk('public') or something like that; also try ->directory('custom_dir')->visibility('public')
8 replies
FFilament
Created by SuperUserDo on 10/15/2024 in #❓┊help
Custom Column Clickable - Prevent
6 replies
FFilament
Created by bwurtz999 on 10/15/2024 in #❓┊help
Refresh Form Data in Modal
do a $record->refresh() at the end of an action it will reload it
4 replies
FFilament
Created by BKF Dev on 10/12/2024 in #❓┊help
Custom FileUpload action
have you tried?
FileUpload::make('file')
->saveUploadedFileUsing(function ($record, $file) {
// todo
})
FileUpload::make('file')
->saveUploadedFileUsing(function ($record, $file) {
// todo
})
4 replies
FFilament
Created by Dimitar Papazov DEV on 10/9/2024 in #❓┊help
Action->form() not getting filled when reusing form
Also the action form submit in the modal doesnt get saved, how to trigger the save, or how to get the action form state and save it manualy if I need to?
5 replies
FFilament
Created by Richard Bowen on 10/10/2024 in #❓┊help
CSS not working after fresh install of filament
How is your vite file looking? Maybe there is a miss. also try runing sail npm run dev to start the watcher and it should work. If you would like to run without the watcher, you should run the sail npm run build to create the files. (you can omit the "sail" if you dont use it)
25 replies
FFilament
Created by Rolland on 10/10/2024 in #❓┊help
Interact with Pivot attributes in Relation Manager
You should probably add it to the table with ->wtih('userHasDepartments') and modify the query like so: https://filamentphp.com/docs/3.x/tables/filters/getting-started#modifying-the-base-query Also look at this: https://filamentphp.com/docs/3.x/panels/resources/relation-managers#editing-with-pivot-attributes
4 replies
FFilament
Created by Dimitar Papazov DEV on 10/9/2024 in #❓┊help
Action->form() not getting filled when reusing form
For some reason when I tried it yesterday it didnt work, now it does; Thanks a lot!
5 replies
FFilament
Created by TheSoulrester on 10/9/2024 in #❓┊help
ViewAction::Make() in users list to show transactions of a user
Please provice code sample, until then, hop on the docs and try this: Create a view page for each transaction: https://filamentphp.com/docs/3.x/panels/resources/viewing-records#adding-a-view-page-to-an-existing-resource and also add the view action in the table: https://filamentphp.com/docs/3.x/panels/resources/viewing-records#adding-a-view-page-to-an-existing-resource
11 replies
FFilament
Created by KingNii on 8/9/2024 in #❓┊help
Fileupload
25 replies
FFilament
Created by Sujay Barma on 8/18/2024 in #❓┊help
Popup Model With Multi-Step Form
5 replies
FFilament
Created by sven on 7/10/2024 in #❓┊help
Custom action before EditRecord
Please show a code sample so we can get idea where and what are you want. For now, here is an example on how to show modal on some action: https://filamentphp.com/docs/3.x/actions/modals#modal-forms
3 replies
FFilament
Created by bardolf_6969 on 7/12/2024 in #❓┊help
If a relationship is hidden on a resource form does filament still try to submit it?
You can try to dd the subitted data and check whats passing. Just add the method mutateFormDataBeforeCreate in the Create** in the resource folder. ```php // in Create(resource name).php EXAMPLE: CreatePage.php protected function mutateFormDataBeforeCreate(array $data): array { dd($data); } ``` You can check if is null and remove it from the data. Same can be done for Edit.
4 replies
FFilament
Created by AngryTestie on 7/12/2024 in #❓┊help
Get the active tenant id
Is your "tenant" a Company? If it is you can get the current tenant : $tenant = Filament::getTenant(); Ref: https://filamentphp.com/docs/3.x/panels/tenancy#accessing-the-current-tenant or if tenant has nothing to do with the company, and you need the logged user's company, you should be able to get it like this: auth()->user()->companies()->first() or apply a scope to filter the current one.
3 replies
FFilament
Created by AngryTestie on 7/12/2024 in #❓┊help
Attached user to a tenant
5 replies
FFilament
Created by AngryTestie on 7/12/2024 in #❓┊help
Attached user to a tenant
Can you provide the UserResource code here, so we can see? Basicly you have to have a company relationship in the User model and on the call it like this: Select::make('company')->relationship('company','name')
5 replies
FFilament
Created by Dimitar Papazov DEV on 7/8/2024 in #❓┊help
Modify query on AttachAction
Solved! After many hours and tests, figure it out. Refrence: https://filamentphp.com/docs/2.x/admin/resources/relation-managers#customizing-the-saving-process Solution:
Tables\Actions\AttachAction::make()
->using(function (Model $record, array $data): Model {
$record->variants()->attach($this->getOwnerRecord()->id, ['color' => $data['color']]);
$this->getOwnerRecord()->variants()->attach($record->id, ['color' => $data['color']]);
return $record;
})
Tables\Actions\AttachAction::make()
->using(function (Model $record, array $data): Model {
$record->variants()->attach($this->getOwnerRecord()->id, ['color' => $data['color']]);
$this->getOwnerRecord()->variants()->attach($record->id, ['color' => $data['color']]);
return $record;
})
3 replies
FFilament
Created by Dimitar Papazov DEV on 5/22/2024 in #❓┊help
Help, Setting runtime config only for one FileUpload
Yes they do, the diffrence will be in using them:
Forms\Components\S3FileUpload::make('image')
->label('Image to be uploaded to s3 via S3 presigned urls, meaning, livewire temp dir needs to change')
->disk('s3')
->directory('category/index')
// only here I need the livewire temp dir to be changed only for this ocmponents execution
->image(),

Forms\Components\FileUpload::make('image')
->label('Image to be uploaded to local disk')
->disk('uploads')
->directory('category/images')
->image(),

Forms\Components\S3FileUpload::make('image')
->label('Image to be uploaded to s3 via S3 presigned urls, meaning, livewire temp dir needs to change')
->disk('s3')
->directory('category/index')
// only here I need the livewire temp dir to be changed only for this ocmponents execution
->image(),

Forms\Components\FileUpload::make('image')
->label('Image to be uploaded to local disk')
->disk('uploads')
->directory('category/images')
->image(),

Any idea how to approach this?
6 replies
FFilament
Created by Dimitar Papazov DEV on 2/11/2024 in #❓┊help
Multiple FIleUpload Reorderable
bump
6 replies