hashim199
Is anyone having livewire 3.5.13 issues? Black splash screen.
i have rolled back to 3.5.12 but still black page
"php": "^8.1",
"filament/filament": "3.2",
"guzzlehttp/guzzle": "^7.2",
"jeffgreco13/filament-breezy": "^2.4",
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.3",
"laravel/tinker": "^2.8",
"livewire/livewire": "3.5.12",
"spatie/laravel-activitylog": "^4.9",
"spatie/laravel-permission": "6.10"
21 replies
Select All option in relationship Select
@Leandro Ferreira
i have a bill table and a service table now the bill and services have a many to many relationship. On one bill one service can be taken multiple times like remove of tooth . but when i select one service from the list it disappears and i cant select it multiple times , so i want that i should be able to select one service multiple times
//service model public function bills() : BelongsToMany { return $this->belongsToMany(Bill::class, 'bill_service') ->withTimestamps(); } //Bill Model public function services() : BelongsToMany { return $this->belongsToMany(Service::class, 'bill_service') ->withTimestamps(); } //Bill Resource Forms\Components\Select::make('service_code') ->relationship('services','code') ->multiple() ->reactive() ->preload() ->live() ->required(),
//service model public function bills() : BelongsToMany { return $this->belongsToMany(Bill::class, 'bill_service') ->withTimestamps(); } //Bill Model public function services() : BelongsToMany { return $this->belongsToMany(Service::class, 'bill_service') ->withTimestamps(); } //Bill Resource Forms\Components\Select::make('service_code') ->relationship('services','code') ->multiple() ->reactive() ->preload() ->live() ->required(),
7 replies
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
$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
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
// 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