Helge Sverre
Helge Sverre
FFilament
Created by Helge Sverre on 4/17/2024 in #❓┊help
How to set the "primary" table action?
i dont want to edit the record url, i want it to do one of the actions i already have pre-defined in the actions list, but mark one of them as the "when i click the row anywhere not on the action button, run this action"-action
7 replies
FFilament
Created by Oddman on 11/9/2023 in #❓┊help
Repeater relationship failing as it returns null
6 replies
FFilament
Created by Helge Sverre on 1/2/2024 in #❓┊help
Max height on FileUpload or modal?
Code:
Actions\Action::make('upload')
->label('Last opp lønnslipp')
->form(form: [

FileUpload::make('files')
->imagePreviewHeight('40px')
->multiple()
->acceptedFileTypes(['application/pdf'])
->directory('payslips')
->storeFileNamesIn('original_file_names')
->getUploadedFileNameForStorageUsing(
fn (TemporaryUploadedFile $file) => sprintf('file_%s.%s', Str::random(), $file->getClientOriginalExtension())
)
->columnSpanFull(),
])
->modalSubmitActionLabel('Opprett')
->action(function ($data) {

foreach ($data['files'] as $file) {

$payslip = Payslip::create([
'user_id' => Auth::id(),
'path' => $file,
'size' => rescue(fn () => Storage::size($file), report: false),
'mime' => Storage::mimeType($file) ?: null,
'filename' => $data['original_file_names'][$file] ?? null,
]);

ScanPayslip::dispatch($payslip);
}

}),
Actions\Action::make('upload')
->label('Last opp lønnslipp')
->form(form: [

FileUpload::make('files')
->imagePreviewHeight('40px')
->multiple()
->acceptedFileTypes(['application/pdf'])
->directory('payslips')
->storeFileNamesIn('original_file_names')
->getUploadedFileNameForStorageUsing(
fn (TemporaryUploadedFile $file) => sprintf('file_%s.%s', Str::random(), $file->getClientOriginalExtension())
)
->columnSpanFull(),
])
->modalSubmitActionLabel('Opprett')
->action(function ($data) {

foreach ($data['files'] as $file) {

$payslip = Payslip::create([
'user_id' => Auth::id(),
'path' => $file,
'size' => rescue(fn () => Storage::size($file), report: false),
'mime' => Storage::mimeType($file) ?: null,
'filename' => $data['original_file_names'][$file] ?? null,
]);

ScanPayslip::dispatch($payslip);
}

}),
3 replies
FFilament
Created by Helge Sverre on 12/22/2023 in #❓┊help
Prefilling a Field in "Create New Option" Modal of a Select Component in FilamentPHP**
Alternatively, is there a way to use a function that will eb executed after the form in the modal has been hydrated, in which case, i can jerry-rig it using Get/Set
5 replies
FFilament
Created by Oddman on 11/9/2023 in #❓┊help
Repeater relationship failing as it returns null
Not trying to spam, but the solution for those searching for this is most likely the same or related to the scenario i posted here (Repeatable belongstomany with fields that map to pivot columns where one of them is a select that is related to something else): https://discord.com/channels/883083792112300104/1173585043592069191/1187040221917880320
6 replies
FFilament
Created by antiquarian_capsaicin on 11/13/2023 in #❓┊help
create option form error
No description
6 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
what do you expect it to output?
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
what does $data output?
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
Would be useful for stuff where the primary action starts with an upload, and everything else comes after type of stuff
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
but anyways, ramble from my side.
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
but maybe one can fudge it by triggering the file input via $this->js("click the input") when the modal opens automatically
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
instead of clicking upload- > open modal -> click file selector you go click upload -> file selector -> form or action with file already selected
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
so skipping 1 step kind of
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
yours opens a modal where the file upload is a field, what iwant is to skip the modal part, and simply by clicking the action button it opens the file selector (finder/explorer) and then submits the action, or opens the form with the file pre-filled
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
im sure it's probably doable as a custom field or something, but meh, dont have time to build it myself atm.
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
So you'd click "upload" (the action button), the file selector shows up, and then you can either use that in a form, or just trigger an action straight away with the selected file.
27 replies
FFilament
Created by ba_mbi_07 on 12/18/2023 in #❓┊help
can we add job when uploading large size files in file upload
I wish there was a way for an action to itself be the file selector trigger
27 replies
FFilament
Created by ПIᄃK on 12/17/2023 in #❓┊help
Admin panel isn't loading correctly
also, composer install before you npm build, as it might be missing some vendor scripts stuff
5 replies
FFilament
Created by ПIᄃK on 12/17/2023 in #❓┊help
Admin panel isn't loading correctly
try running it again but change :cache to :clear on all the commands
5 replies
FFilament
Created by Nays on 12/13/2023 in #❓┊help
Disable Topbar
sure, but sometimes what is advised in the docs is incompatible with the desired outcome 😛
7 replies