hashim199
hashim199
FFilament
Created by igmltd on 6/15/2024 in #❓┊help
Add form to list view
i have gone through this but the widget is still blank
7 replies
FFilament
Created by igmltd on 6/15/2024 in #❓┊help
Add form to list view
No description
7 replies
FFilament
Created by Trauma Zombie on 3/24/2023 in #❓┊help
How to calculate field value based on two other fields?
$ser = $get('service_code'); $panell = $get('Panel'); filed must be stored in database in order to calculate the sumcharges i was not storing them.
13 replies
FFilament
Created by Trauma Zombie on 3/24/2023 in #❓┊help
How to calculate field value based on two other fields?
I have solved it 🚀
13 replies
FFilament
Created by Trauma Zombie on 3/24/2023 in #❓┊help
How to calculate field value based on two other fields?
@toeknee
13 replies
FFilament
Created by Trauma Zombie on 3/24/2023 in #❓┊help
How to calculate field value based on two other fields?
TextInput::make('total') ->placeholder(function (Get $get,Set $set) { $ser = $get('service_code'); $panell = $get('Panel');
$codes = []; $allcharges = []; $sumcharges=[];
if ($ser !== null && $panell !== null) { $codes = Service::whereIn('id', $ser) ->pluck('code') ->toArray();
$charges = Service::where('panel_name', $panell) ->whereIn('code', $codes) ->pluck('charges') ->toArray(); $allcharges = array_merge($allcharges, $charges); $sumcharges=array_sum($allcharges);
} $set('total', $sumcharges); }) ->reactive() ->live(), it is not working on edit page it show empty field
13 replies
FFilament
Created by fikurimax on 2/4/2024 in #❓┊help
Update field state every time other field updated without using $set()
@Tin Modric
14 replies
FFilament
Created by fikurimax on 2/4/2024 in #❓┊help
Update field state every time other field updated without using $set()
TextInput::make('total') ->placeholder(function(Get $get){ $ser = $get('service_code'); $panell = $get('Panel');
// Initialize an array to store the codes $codes = []; $allcharges = []; $sumcharges=0;
// Check if both $ser and $panell are not null if ($ser !== null && $panell !== null) { // Retrieve codes from the database based on $ser $codes = Service::whereIn('id', $ser) ->pluck('code') ->toArray();
// Implement the query to fetch charges based on $panell // Assuming you have a table named "charges" with columns "panel_name" and "charge" $charges = Service::where('panel_name', $panell) ->whereIn('code', $codes) ->pluck('charges') ->toArray();
// Insert charges into $allcharges array $allcharges = array_merge($allcharges, $charges); $sumcharges=array_sum($allcharges); }
// Print the extracted codes and charges using var_dump // var_dump($sumcharges);
return $sumcharges; }) ->live(), it is not saving the data in the database
14 replies
FFilament
Created by YusifHajiyev on 11/29/2023 in #❓┊help
TopNavigation
@YusifHajiyev have you solved it?
5 replies
FFilament
Created by Gediminas on 11/23/2023 in #❓┊help
Custom form action help
@Leandro Ferreira solved now how can i open the action in new window, shouldOpenInNewTab will not work here any suggestions ->action( function ($data) { $companyName=$data['companyname']; $fromDate=$data['from']; $toDate=$data['to']; return redirect()->route('invoice-genrate',[$companyName,$fromDate,$toDate]); } ),
10 replies
FFilament
Created by Gediminas on 11/23/2023 in #❓┊help
Custom form action help
10 replies
FFilament
Created by Gediminas on 11/23/2023 in #❓┊help
Custom form action help
@Leandro Ferreira now its is not going inside function and there is no error 😦 Actions\Action::make('PanelInvoice')->form([ TextInput::make('companyname') ->label('Company Name'), DatePicker::make('from')->default(null), DatePicker::make('to')->default(null), ]) ->action( function (array $data) {
$companyName=$data['companyname']; $fromDate=$data['from']; $toDate=$data['to']; return route('invoice-genrate',[$companyName,$fromDate,$toDate]);
} ) Route::get('/invoice-genrate/{companyName}/{fromDate}/{toDate}', [BillPanelReports::class, 'createInvoice'])->name('invoice-genrate'); public function createInvoice(Request $request) { $companyName = $request->input('companyname'); $fromDate = $request->input('from'); $toDate = $request->input('to'); dd($companyName,$fromDate,$toDate); }
10 replies
FFilament
Created by Gediminas on 11/23/2023 in #❓┊help
Custom form action help
@Leandro Ferreira Send the data of form to controller function from a custom action, i will be thankful to you for the help Actions\Action::make('PanelInvoice')->form([ TextInput::make('companyname') ->label('Company Name'), DatePicker::make('from')->default(null), DatePicker::make('to')->default(null), ]) ->action(function (array $data) {
return route('invoice.create',$data); }) Routes: I have tried both i doest not Route::get('/invoice-genrate/{data}', [BillPanelReports::class, 'createInvoice'])->name('invoice-genrate'); Route::post('/invoice-cerate', [BillPanelReports::class, 'createInvoice'])->name('invoice.create'); controller function public function createInvoice(Request $request) { dd('hello'); $companyName = $request->input('companyname'); $fromDate = $request->input('from'); $toDate = $request->input('to');
}
10 replies
FFilament
Created by Patrick1989 on 3/1/2024 in #❓┊help
get a field value in an action
@Dennis Koch sorry to bother you but i am stuck if i eturn route('panel-invoice', $parameters['companyname']); it shows no error just reload now if i return return route('panel-invoice', $parameters); error Missing required parameter for [Route: panel-invoice] [URI: panel-invoice/{data}] [Missing parameter: data]. Route::get('/panel-invoice/{data}', [BillPanelReports::class, 'createInvoice'])->name('panel-invoice'); public function createInvoice( $data) { dd($data);
} Actions\Action::make('PanelInvoice')->form([ TextInput::make('companyname') ->label('Company Name'), DatePicker::make('from')->default(null), DatePicker::make('to')->default(null), ])->action(function (array $data) { $parameters = [ 'companyname' => $data['companyname'], 'from'=>$data['from'], 'to'=>$data['to'], // other parameters if needed ]; return route('panel-invoice', $parameters);}) ,
13 replies
FFilament
Created by Patrick1989 on 3/1/2024 in #❓┊help
get a field value in an action
Error: Array callback must have exactly two elements Actions\Action::make('PanelInvoice')->form([ TextInput::make('companyname') ->label('Company Name'), DatePicker::make('from')->default(null), DatePicker::make('to')->default(null), ])->action(function (array $data) {

$company=$data('companyname'); return route('panel-bill',$company); }) ,
13 replies
FFilament
Created by Patrick1989 on 3/1/2024 in #❓┊help
get a field value in an action
@Dennis Koch
13 replies
FFilament
Created by Patrick1989 on 3/1/2024 in #❓┊help
get a field value in an action
@Patrick1989
13 replies
FFilament
Created by Patrick1989 on 3/1/2024 in #❓┊help
get a field value in an action
error: Typed property Filament\Forms\Components\Component::$container must not be accessed before initialization
13 replies
FFilament
Created by Patrick1989 on 3/1/2024 in #❓┊help
get a field value in an action
Actions\Action::make('PanelInvoice')->form([ TextInput::make('companyname') ->label('Company Name'), DatePicker::make('from')->default(null), DatePicker::make('to')->default(null), ])->url(function (Get $get) {

$data=$get('companyname'); dd($get('companyname')); return route('panel-bill',$data); }, shouldOpenInNewTab: true) ,
13 replies
FFilament
Created by chinmaya on 4/5/2024 in #❓┊help
Sending data to controller
@Oumuamua
5 replies