Adnan Yalahow
Adnan Yalahow
FFilament
Created by Adnan Yalahow on 6/25/2024 in #❓┊help
make create and create buttons always display on form screen even when scrolling
It's quite boring to go all the way down to save changes while i only made change to my top input so is there any way filament to make these buttons fixed
15 replies
FFilament
Created by Adnan Yalahow on 6/9/2024 in #❓┊help
Form Action appearance
how do move all my buttons in the form Create, Save changes, Cancel to the top of the page globally
3 replies
FFilament
Created by Adnan Yalahow on 6/2/2024 in #❓┊help
Table Repeater Export
Is there anyway I can use filament export action in table repeater
3 replies
FFilament
Created by Adnan Yalahow on 5/14/2024 in #❓┊help
weird select option behavior on relationship
i have this select option
Forms\Components\Select::make('customer_id')
->label('Customer')->live(debounce: 300)
->required()->searchable()
->relationship('customer', ignoreRecord: true)
->getOptionLabelFromRecordUsing(function (Model $record) {
return $record['name'];
})
->options(function (Forms\Get $get) {
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(debounce: 300)
->required()->searchable()
->relationship('customer', ignoreRecord: true)
->getOptionLabelFromRecordUsing(function (Model $record) {
return $record['name'];
})
->options(function (Forms\Get $get) {
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');
}
})
when am in create form no data is displayed in the select options and on edit the name of the customer can bee seen as label on the otherhand if I comment the relationship function the opposite happens in create the select option is ok but in edit i see the id and not the name I need help Please
17 replies
FFilament
Created by Adnan Yalahow on 5/12/2024 in #❓┊help
Can I create something like this in filament
No description
4 replies
FFilament
Created by Adnan Yalahow on 4/29/2024 in #❓┊help
relationship won't delete if repeater is empty when updating the form
I am trying to update my receipt form and there is repeater with relationship() that is only shown when receipt_to is customer but if I try to update with may be supplier and the repeater is empty and hidden in this case then in the relationship table there is still previous data for the customer and it should have removed. is there anyway I could handle this
2 replies
FFilament
Created by Adnan Yalahow on 4/28/2024 in #❓┊help
how can i add requiresConfirmation when creating records
i have trid this
protected function getCreateFormAction(): Action
{
return Action::make('create')
->action('create')
->requiresConfirmation();
}
protected function getCreateFormAction(): Action
{
return Action::make('create')
->action('create')
->requiresConfirmation();
}
but nothing seems to be working someone help me please
7 replies
FFilament
Created by Adnan Yalahow on 4/22/2024 in #❓┊help
can't assign role to customer
No description
11 replies
FFilament
Created by Adnan Yalahow on 3/31/2024 in #❓┊help
getSaveFormAction prevents data from updating record and its relationships
i want to hide or disable save changes button and do its own trigger action when not hidden or disabled this is what i did now
protected function getSaveFormAction(): Action
{
return Action::make('save_changes')
->disabled(function (Warehouse $record) {
$warehouse = app(Warehouse::class);
$linkedTransactions = $warehouse->checkLink($record['id']);
if (empty($linkedTransactions)) {
return false;
}
return true;
});
}
protected function getSaveFormAction(): Action
{
return Action::make('save_changes')
->disabled(function (Warehouse $record) {
$warehouse = app(Warehouse::class);
$linkedTransactions = $warehouse->checkLink($record['id']);
if (empty($linkedTransactions)) {
return false;
}
return true;
});
}
please help me find a solution
4 replies
FFilament
Created by Adnan Yalahow on 3/23/2024 in #❓┊help
move repeater actions inline with the components
No description
5 replies
FFilament
Created by Adnan Yalahow on 3/7/2024 in #❓┊help
image not loading but accessible via URL
No description
15 replies
FFilament
Created by Adnan Yalahow on 10/4/2023 in #❓┊help
Struggling to Populate Repeater with Data Based on Selected Item
No description
5 replies
FFilament
Created by Adnan Yalahow on 9/17/2023 in #❓┊help
Read data into repeater based on selected filed
No description
6 replies
FFilament
Created by Adnan Yalahow on 8/17/2023 in #❓┊help
repeater returns single array of components instead of multiple arrays of components
please help me i need to get all products with the selected mark_id and show it in repeater
return $form
->schema([
Forms\Components\Card::make()
->schema([
Forms\Components\Select::make('mark_id')
->label('Mark')
->reactive()
->options(Mark::all()->pluck('name', 'id'))->required()->searchable()->reactive()
])->columns(2),
Forms\Components\Repeater::make('Products')->reactive()
->schema(function (\Closure $get) {
$markId = $get('mark_id');

if (!$markId) {
return [Forms\Components\Placeholder::make('Select Mark First')];
}
$warehouseProducts = WarehouseProducts::where('mark_id', $markId)->get();

if ($warehouseProducts->isEmpty()) {
return [Forms\Components\Placeholder::make('No products available for the selected mark')];
}
$products=[];
foreach ($warehouseProducts as $product) {
$products[] =Forms\Components\TextInput::make('pd_id'.$product->id)
->reactive()
->default($product->product_name);
}
return $products;
})


]);
return $form
->schema([
Forms\Components\Card::make()
->schema([
Forms\Components\Select::make('mark_id')
->label('Mark')
->reactive()
->options(Mark::all()->pluck('name', 'id'))->required()->searchable()->reactive()
])->columns(2),
Forms\Components\Repeater::make('Products')->reactive()
->schema(function (\Closure $get) {
$markId = $get('mark_id');

if (!$markId) {
return [Forms\Components\Placeholder::make('Select Mark First')];
}
$warehouseProducts = WarehouseProducts::where('mark_id', $markId)->get();

if ($warehouseProducts->isEmpty()) {
return [Forms\Components\Placeholder::make('No products available for the selected mark')];
}
$products=[];
foreach ($warehouseProducts as $product) {
$products[] =Forms\Components\TextInput::make('pd_id'.$product->id)
->reactive()
->default($product->product_name);
}
return $products;
})


]);
3 replies
FFilament
Created by Adnan Yalahow on 8/10/2023 in #❓┊help
create multiple rows in repeater when select option is changed
2 replies
FFilament
Created by Adnan Yalahow on 8/9/2023 in #❓┊help
Repeater immediately change field after another field changes
6 replies