π•Ύπ–†π–ˆπ–—π–Šπ–’π–Šπ–“π–™π–šπ–˜
π•Ύπ–†π–ˆπ–—π–Šπ–’π–Šπ–“π–™π–šπ–˜
FFilament
Created by π•Ύπ–†π–ˆπ–—π–Šπ–’π–Šπ–“π–™π–šπ–˜ on 3/7/2024 in #β“β”Šhelp
Best way to fill hint action data from component it is hinting from
Sorry if that doesn't really make sense but in the below code, I have a text box and a hint action on there, I need to be able to get the value of the text box to populate the options of the radio field in the action slideover, i have tried before form filled where i can get the value of connection but returning $data['directories'] as an array so ['test'=>'test'] does not fill this, when i do the options i need to be able to get this from the connection information. https://gist.github.com/sabuto/6d4ec88e7f1315ea1a12865357dc59b2
24 replies
FFilament
Created by π•Ύπ–†π–ˆπ–—π–Šπ–’π–Šπ–“π–™π–šπ–˜ on 12/12/2023 in #β“β”Šhelp
dynamic model
Hi All I am wondering if you can help me, I am building a custom page, the custom data is working fine however when I try and do an Action::make it trys to get it from the default table for the model like it is set before mounting below is my page for the custom logic, the table data itself is filled out and working however the error I get is php SQLSTATE[42S02]: Base table or view not found: 1146 Table 'tenantfoo.user_datasets' doesn't exist I cant include the whole file because of discord limits, if you want the rest let me know but it builds the form correctly. the $dynamicTableName property on the UserDataSet just sets the table in the constructor. ```php public function mount(int|string $record): void { $this->record = Dataset::where('id', $record)->first(); UserDataSet::$dynamicTableName = "ds" . $this->record->table_name; $this->dataSet = UserDataSet::all(); static::authorizeResourceAccess(); } public function table(Table $table): Table { return $table->columns($this->getFormSchema()) ->query(UserDataSet::query()) ->headerActions([ \Filament\Tables\Actions\Action::make('create') ->form([ TextInput::make('name')->label('Name') ])->action(function (array $data, UserDataSet $record): void { dd($data); })->mountUsing(function () { dd('hello'); }) ]); } } ```
11 replies