YASSIN459
YASSIN459
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
i thinq the problem is with the relationship i can try again
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
yeah discord is already show you are using phone , i want to use frontend resource in separet project without filament (i dont thinq is can be used)
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
but i have another question how can i use filament frontend resource in separed project
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
ah the bl resource
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
but i have another question
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
yeah it is a bit complicated but not so mush
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
thanq you sire this is the code https://github.com/yassin459dz/CAR-WORKSHOP
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
i dont want to make you tired for me sire
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
in phpmyadmin it is work good
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
i can opload the source code in git hub
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
this work but if the client dont have the matrucul i try to add it manualy , but because the matrucul table is another table the record is not validate
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
when i select the client it will show the car is related with and the matrucule
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
am sorry the discord dont want for post all the code in one single time
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
Wizard\Step::make('Delivery') ->schema([ TextInput::make('km')->required()->numeric(), TextInput::make('bl_number')->required(), TextInput::make('product')->required(), TextInput::make('price')->numeric(), ]), Wizard\Step::make('Billing') ->schema([ TextInput::make('qte') ->numeric(), TextInput::make('total') ->numeric(), // TextInput::make('remark') // ->maxLength(255), ]), ]) ]);
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
TextInput::make('matricule') ->label('Matricule') ->live() ->afterStateUpdated(function ($state, callable $set, $get) { $clientId = $get('client_id'); $carId = $get('car_id'); if (!$clientId || !$carId) { $set('matricule_id', null); return; } $set('matricule', $state); }), TextInput::make('matricule_id') ->label('Matricule ID'), ]),
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
->live() ->afterStateUpdated(function ($state, $set, $get) { $clientId = $get('client_id'); if ($clientId && $state) { $matricule = Matricule::where('client_id', $clientId) ->where('car_id', $state) ->first(); if ($matricule) { $set('matricule_id', $matricule->id); $set('matricule', $matricule->mat); } else { $set('matricule_id', null); $set('matricule', ''); } } else { $set('matricule_id', null); $set('matricule', ''); } }),
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
Select::make('car_id') ->label('Car') ->searchable() ->options(function ($get) { return $get('car_options') ?: []; }) ->createOptionForm([ TextInput::make('model')->required(), ]) ->createOptionUsing(function ($data, $set, $get) { $car = Car::create($data); $clientId = $get('client_id'); if ($clientId) { $carsRelated = Car::where('client_id', $clientId)->pluck('model', 'id')->toArray(); $otherCars = Car::whereNotIn('id', array_keys($carsRelated))->pluck('model', 'id')->toArray(); $carOptions = [ 'Related Cars' => $carsRelated, 'Other Cars' => $otherCars, ]; $set('car_options', $carOptions); } return $car->id; })
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
} else { $set('car_id', null); $set('car_options', []); $set('matricule_id', null); $set('matricule', ''); }
34 replies
FFilament
Created by YASSIN459 on 9/7/2024 in #❓┊help
am tired from try and try pls help
->live() ->afterStateUpdated(function ($state, $set) { $client = Client::find($state); if ($client) { $firstCar = $client->cars()->first(); if ($firstCar) { $set('car_id', $firstCar->id); $carsRelated = $client->cars()->pluck('model', 'id')->toArray(); $otherCars = Car::whereNotIn('id', array_keys($carsRelated))->pluck('model', 'id')->toArray(); $carOptions = [ 'Related Cars' => $carsRelated, 'Other Cars' => $otherCars, ]; $set('car_options', $carOptions); $matricule = Matricule::where('client_id', $client->id) ->where('car_id', $firstCar->id) ->first(); if ($matricule) { $set('matricule_id', $matricule->id); $set('matricule', $matricule->mat); } else { $set('matricule_id', null); $set('matricule', ''); } } else { $set('car_id', null); $set('car_options', []); $set('matricule_id', null); $set('matricule', ''); }
34 replies