Gianmarco Varrone
Gianmarco Varrone
FFilament
Created by Gianmarco Varrone on 12/12/2023 in #❓┊help
Is there a way to build and admin panel exclusively consuming an external API?
Ok, but how do you hook up your data and how do you mange auth using an external endpoint?
4 replies
FFilament
Created by Gianmarco Varrone on 7/31/2023 in #❓┊help
Form field not updating with reactive()
Also, this form is being used in a foreach loop, could this be the reson? Is there a way to pass an unique identifier to the form?
5 replies
FFilament
Created by Gianmarco Varrone on 7/31/2023 in #❓┊help
Form field not updating with reactive()
public function mount($relayNumber, $controlUnit) { $this->relayNumber = $relayNumber; $this->controlUnit = $controlUnit; $pointOfSale = PointOfSale::find($controlUnit->point_of_sale_id); $this->shop_opening_time = $pointOfSale->opening_time; $this->shop_closing_time = $pointOfSale->closing_time; $relays = $this->controlUnit->relays()->get(); } protected function getFormSchema() : array { return[ TextInput::make("name")->required()->label("Identificatore relay"), TimePicker::make('turn_on_at')->label("Orario accensione relay")->reactive(), Checkbox::make("turn_on_opening") ->label("Accendi questo interruttore all'apertura del negozio") ->inline() ->reactive() ->afterStateUpdated(fn ($state, callable $set)=> $set("turn_on_at", $this->shop_opening_time)), Checkbox::make("turn_on_closing")->label("Accendi questo interruttore alla chiusura del negozio")->inline(), TimePicker::make('turn_off_at')->label("Orario spegnimento relay"), Checkbox::make("turn_off_opening")->label("Spegni questo interruttore all'apertura del negozio")->inline(), Checkbox::make("turn_off_closing")->label("Spegni questo interruttore alla chiusura del negozio")->inline(), ]; }
5 replies
FFilament
Created by Gianmarco Varrone on 6/23/2023 in #❓┊help
Editing multiple images
Thank you
10 replies
FFilament
Created by Gianmarco Varrone on 6/23/2023 in #❓┊help
Editing multiple images
Is there anybody that can help with this matter?
10 replies
FFilament
Created by Gianmarco Varrone on 6/23/2023 in #❓┊help
Editing multiple images
Now, I would like to allow the user, from the EditPage to be able to adit the previously uploaded images. The issue is that I don't know how i can show all the uploaded images to the user
10 replies
FFilament
Created by Gianmarco Varrone on 6/23/2023 in #❓┊help
Editing multiple images
And in the after create I'm doing : protected function afterCreate(): void { foreach($this->data['photos'] as $key=>$value){ $data = [ 'point_of_sale_id'=>$this->record->id, 'do_cdn_url' => 'https://closbox.ams3.cdn.digitaloceanspaces.com/' . $value, ]; PosImage::create($data); } }
10 replies
FFilament
Created by Gianmarco Varrone on 6/23/2023 in #❓┊help
Editing multiple images
This is the file upload I'm using in the form: Section::make('Fotografie') ->description("Carica almeno 10 fotografie") ->schema([ Forms\Components\FileUpload::make('photos') ->multiple() ->enableDownload() ->enableOpen() ->enableReordering() ->disk('do_spaces') ->directory("photos/". Carbon::now()->format('Y'). "/".Carbon::now()->format('m'). "/".Carbon::now()->format('d'). "/") ->visibility('public') ->image() ->imageResizeMode('cover') ->imageCropAspectRatio('16:9') ->imageResizeTargetWidth('1920') ->imageResizeTargetHeight('1080'), ])->columns(1)
10 replies
FFilament
Created by Gianmarco Varrone on 5/13/2023 in #❓┊help
How to get the current record in lifecycle hook after() method on pop up
yes
11 replies
FFilament
Created by Gianmarco Varrone on 5/13/2023 in #❓┊help
How to get the current record in lifecycle hook after() method on pop up
same null
11 replies
FFilament
Created by Gianmarco Varrone on 5/13/2023 in #❓┊help
How to get the current record in lifecycle hook after() method on pop up
I also tried $this->record
11 replies
FFilament
Created by Gianmarco Varrone on 5/13/2023 in #❓┊help
How to get the current record in lifecycle hook after() method on pop up
the dd() keeps returning null, while $data has the form data
11 replies
FFilament
Created by Gianmarco Varrone on 5/13/2023 in #❓┊help
How to get the current record in lifecycle hook after() method on pop up
Following the code I'm trying : Actions\CreateAction::make()->mutateFormDataUsing(function (array $data) { if($data["is_recursive"]){ $data["status"] = "ongoing"; }else{ $data["status"] = "created"; } return $data; })->after(function(array $data, $record){ dd($record); RevolutPayment::create(); }),
11 replies
FFilament
Created by Gianmarco Varrone on 5/13/2023 in #❓┊help
How to get the current record in lifecycle hook after() method on pop up
Hey. Thanks for the reply
11 replies
FFilament
Created by Gianmarco Varrone on 4/17/2023 in #❓┊help
Prevent user from viewing a resource
The policy works just perfect!
8 replies
FFilament
Created by Gianmarco Varrone on 4/17/2023 in #❓┊help
Prevent user from viewing a resource
Oh ok, that simple. So regular laravel policy
8 replies
FFilament
Created by Gianmarco Varrone on 4/15/2023 in #❓┊help
Multiple forms on custom page
Ok, thank you. I'll give it a try.
39 replies
FFilament
Created by Gianmarco Varrone on 4/15/2023 in #❓┊help
Multiple forms on custom page
Filament\Resources\Pages\ViewRecord::getRecord(): Return value must be of type Illuminate\Database\Eloquent\Model, string returned
39 replies
FFilament
Created by Gianmarco Varrone on 4/15/2023 in #❓┊help
Multiple forms on custom page
So i tried to change to $this->record but i get:
39 replies
FFilament
Created by Gianmarco Varrone on 4/15/2023 in #❓┊help
Multiple forms on custom page
Which is being thrown at : 'chatForm' => $this->makeForm() ->schema($this->getChatFormSchema()) ->model($this->ticket),
39 replies