Adnan Yalahow
Adnan Yalahow
FFilament
Created by Adnan Yalahow on 7/4/2024 in #❓┊help
Change side bar background color
Thank you it worked
7 replies
FFilament
Created by Adnan Yalahow on 7/4/2024 in #❓┊help
Change side bar background color
I am quite confused on which file do i need to make change ?
7 replies
FFilament
Created by Adnan Yalahow on 6/25/2024 in #❓┊help
make create and create buttons always display on form screen even when scrolling
Very weird behavior 🤔 I don't know if a certain height is applicable here, but while my page was long enough to be scrolled I could not see any changes, surprisingly when added more useless form components to my form I see the change. anyway Thank you.
15 replies
FFilament
Created by Adnan Yalahow on 6/25/2024 in #❓┊help
make create and create buttons always display on form screen even when scrolling
still no change
15 replies
FFilament
Created by Adnan Yalahow on 6/25/2024 in #❓┊help
make create and create buttons always display on form screen even when scrolling
No description
15 replies
FFilament
Created by Adnan Yalahow on 6/25/2024 in #❓┊help
make create and create buttons always display on form screen even when scrolling
I have added this line to my AppServiceProvider in the boot function but i can't see any changes. would you please explore more? Thank you
15 replies
FFilament
Created by Adnan Yalahow on 6/2/2024 in #❓┊help
Table Repeater Export
this is my code
->extraActions([
Forms\Components\Actions\Action::make('exportData')
->icon('heroicon-m-inbox-arrow-down')
->hidden(fn($operation) => $operation == 'create')
->action(function (array $arguments, TableRepeater $component, $state, $livewire) {
ExportAction::make()
->exporter(PackageExporter::class)
->modifyQueryUsing(fn (PackagedProducts $query) => $query->where('lcl_package_id', $livewire->record->id));
}),
])
->extraActions([
Forms\Components\Actions\Action::make('exportData')
->icon('heroicon-m-inbox-arrow-down')
->hidden(fn($operation) => $operation == 'create')
->action(function (array $arguments, TableRepeater $component, $state, $livewire) {
ExportAction::make()
->exporter(PackageExporter::class)
->modifyQueryUsing(fn (PackagedProducts $query) => $query->where('lcl_package_id', $livewire->record->id));
}),
])
no response no error no downloads what am i doing wrong
3 replies
FFilament
Created by Sawal on 4/5/2024 in #❓┊help
current url, /livewire/update
I am not in Post modal am in another modal thats why i can't get record
14 replies
FFilament
Created by Sawal on 4/5/2024 in #❓┊help
current url, /livewire/update
am in modal and i needed to have that id in this case 35
14 replies
FFilament
Created by Sawal on 4/5/2024 in #❓┊help
current url, /livewire/update
after following instructions am getting null
14 replies
FFilament
Created by Sawal on 4/5/2024 in #❓┊help
current url, /livewire/update
so how do i get my actual url this one http://localhost:8000/posts/35/edit
14 replies
FFilament
Created by Sawal on 4/5/2024 in #❓┊help
current url, /livewire/update
for example my actual url is http://localhost:8000/posts/35/edit but dd(url()->current()); is showing "http://localhost:8000/livewire/update"
14 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
this is still making no difference but Thank God i figured out something that solved my problem and this is what i did
Forms\Components\Select::make('customer_id')
->label('Customer')->live()
->required()->searchable()->preload()
->relationship(name: 'customer', titleAttribute: 'name',ignoreRecord: true)
->options(function (Forms\Get $get, Builder $query) {
if ($get('related_to')) {
$data = [];
if ($get('related_to') === 'fcl job') {
$data = Customer::whereHas('fcl_expense', function ($query) {
$query->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'lcl job') {
$data = Customer::whereHas('lcl_expense', function ($query) {
$query->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'clearance') {
$data = Customer::whereHas('clearance_expense', function ($query) {
$query->where('status', 'pending')->where('stage', 'approved');
})->get();
}
return $data->pluck('name', 'id');
}
})
Forms\Components\Select::make('customer_id')
->label('Customer')->live()
->required()->searchable()->preload()
->relationship(name: 'customer', titleAttribute: 'name',ignoreRecord: true)
->options(function (Forms\Get $get, Builder $query) {
if ($get('related_to')) {
$data = [];
if ($get('related_to') === 'fcl job') {
$data = Customer::whereHas('fcl_expense', function ($query) {
$query->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'lcl job') {
$data = Customer::whereHas('lcl_expense', function ($query) {
$query->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'clearance') {
$data = Customer::whereHas('clearance_expense', function ($query) {
$query->where('status', 'pending')->where('stage', 'approved');
})->get();
}
return $data->pluck('name', 'id');
}
})
in edit I see the name and in create I see my customers with certain conditions. And thank you guys for taking time to solve this too.
17 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
still no change this is what i did
->relationship(
name: 'customer',
titleAttribute: 'name',
modifyQueryUsing: function (Forms\Get $get, Builder $query) {
if ($get('related_to')) {
if ($get('related_to') === 'fcl job') {
return $query->whereHas('fcl_expense', function ($fclQuery) {
$fclQuery->where('status', 'pending')->where('stage', 'approved');
})->pluck('name', 'id');
} elseif ($get('related_to') === 'lcl job') {
return $query->whereHas('lcl_expense', function ($LCLQuery) {
$LCLQuery->where('status', 'pending')->where('stage', 'approved');
})->pluck('name', 'id');
} elseif ($get('related_to') === 'clearance') {
return $query->whereHas('clearance_expense', function ($clQuery) {
$clQuery->where('status', 'pending')->where('stage', 'approved');
})->pluck('name', 'id');
}
}
},
ignoreRecord: true,
)
->getOptionLabelFromRecordUsing(function (Model $record) {
return $record['name'];
})
->relationship(
name: 'customer',
titleAttribute: 'name',
modifyQueryUsing: function (Forms\Get $get, Builder $query) {
if ($get('related_to')) {
if ($get('related_to') === 'fcl job') {
return $query->whereHas('fcl_expense', function ($fclQuery) {
$fclQuery->where('status', 'pending')->where('stage', 'approved');
})->pluck('name', 'id');
} elseif ($get('related_to') === 'lcl job') {
return $query->whereHas('lcl_expense', function ($LCLQuery) {
$LCLQuery->where('status', 'pending')->where('stage', 'approved');
})->pluck('name', 'id');
} elseif ($get('related_to') === 'clearance') {
return $query->whereHas('clearance_expense', function ($clQuery) {
$clQuery->where('status', 'pending')->where('stage', 'approved');
})->pluck('name', 'id');
}
}
},
ignoreRecord: true,
)
->getOptionLabelFromRecordUsing(function (Model $record) {
return $record['name'];
})
17 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
i tried to dd the $data before if ($get('related_to')) still nothing is shown
17 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
Ihave done this
Forms\Components\Select::make('customer_id')
->label('Customer')->live(debounce: 300)
->required()->searchable()
->relationship(
name: 'customer',
titleAttribute: 'name',
modifyQueryUsing: function (Forms\Get $get, Builder $query) {
if ($get('related_to')) {
$data = [];
if ($get('related_to') === 'fcl job') {
$data = $query->whereHas('fcl_expense', function ($fclQuery) {
$fclQuery->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'lcl job') {
$data = $query->whereHas('lcl_expense', function ($LCLQuery) {
$LCLQuery->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'clearance') {
$data = $query->whereHas('clearance_expense', function ($clQuery) {
$clQuery->where('status', 'pending')->where('stage', 'approved');
})->get();
}
return $data->pluck('name', 'id');
}
},
ignoreRecord: true,
)
->getOptionLabelFromRecordUsing(function (Model $record) {
return $record['name'];
}),
Forms\Components\Select::make('customer_id')
->label('Customer')->live(debounce: 300)
->required()->searchable()
->relationship(
name: 'customer',
titleAttribute: 'name',
modifyQueryUsing: function (Forms\Get $get, Builder $query) {
if ($get('related_to')) {
$data = [];
if ($get('related_to') === 'fcl job') {
$data = $query->whereHas('fcl_expense', function ($fclQuery) {
$fclQuery->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'lcl job') {
$data = $query->whereHas('lcl_expense', function ($LCLQuery) {
$LCLQuery->where('status', 'pending')->where('stage', 'approved');
})->get();
} elseif ($get('related_to') === 'clearance') {
$data = $query->whereHas('clearance_expense', function ($clQuery) {
$clQuery->where('status', 'pending')->where('stage', 'approved');
})->get();
}
return $data->pluck('name', 'id');
}
},
ignoreRecord: true,
)
->getOptionLabelFromRecordUsing(function (Model $record) {
return $record['name'];
}),
now in edit its showing id instead of name and in create am not getting any options what am i doing wrong?
17 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
so how do i prevent that i need to get customers using a relationship while showing the name in edit
17 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
any volunteers please 🙏
17 replies