gon.exe
gon.exe
FFilament
Created by gon.exe on 12/20/2023 in #❓┊help
Upgrade v3. Alpine issue
No description
7 replies
FFilament
Created by gon.exe on 12/19/2023 in #❓┊help
v3 Upgrade. MaxWidth not found
Hi everyone! I am updating my app. I have solved a lot of things so far, but I could not find a solution for the error "Class "App\Providers\Filament\MaxWidth" not found" when I want to use "->maxContentWidth(MaxWidth::Full)" on my AdminPanelProvider.php . I attach my app information: Environment Application Name . Green Ambiental
Laravel Version . 10.0.0 PHP Version . 8.1.0 Composer Version . 2.6.6 Environment . local Debug Mode . ENABLED URL . 127.0.0.1:8000 Maintenance Mode . OFF Cache Config . NOT CACHED Events . NOT CACHED
Routes . NOT CACHED Views . NOT CACHED Drivers Broadcasting . log Cache . file Database . pgsql Logs . stack / single Mail . smtp Queue . sync Session . file Filament Packages . filament, forms, notifications, support, tables Version . v3.0.0
Views . NOT PUBLISHED Livewire Livewire . v3.0.0 Thanks in advance!
30 replies
FFilament
Created by gon.exe on 11/1/2023 in #❓┊help
Avoid the creation of the same record from a relationship
No description
21 replies
FFilament
Created by gon.exe on 10/24/2023 in #❓┊help
Action does not open a custom modal
Hi everyone! I have a custom query defined on my List Page to group and sum inventory quantity based on locations:
namespace App\Filament\Resources\InventoryResource\Pages;

protected function getTableQuery(): Builder
{

// Return all inventories records but group by asset_id and sum the quantity
return Inventory::selectRaw('
random() as id,
asset_id,
location_id,
sum(quantity) as quantity
')
->addSelect('assets.name as asset_name')
->addSelect('locations.name as location_name')
->groupBy('asset_id', 'location_id', 'asset_name', 'location_name')
->leftJoin('assets', 'assets.id', '=', 'inventories.asset_id')
->leftJoin('locations', 'locations.id', '=', 'inventories.location_id');
//

}
namespace App\Filament\Resources\InventoryResource\Pages;

protected function getTableQuery(): Builder
{

// Return all inventories records but group by asset_id and sum the quantity
return Inventory::selectRaw('
random() as id,
asset_id,
location_id,
sum(quantity) as quantity
')
->addSelect('assets.name as asset_name')
->addSelect('locations.name as location_name')
->groupBy('asset_id', 'location_id', 'asset_name', 'location_name')
->leftJoin('assets', 'assets.id', '=', 'inventories.asset_id')
->leftJoin('locations', 'locations.id', '=', 'inventories.location_id');
//

}
I need a button on each row to display the grouped value detail records. The following code does not open a modal:
namespace App\Filament\Resources;
public static function table(Table $table): Table {
return $table
->columns([
...
])
->actions([
// Show Inventory records
Action::make('show_records')
->label(__('Show Records'))
->action(fn ($record) => $record->advance())
->modalContent(fn ($record) => view('filament.pages.actions.inventory-show-records', ['record' => $record]))
//
])
}
namespace App\Filament\Resources;
public static function table(Table $table): Table {
return $table
->columns([
...
])
->actions([
// Show Inventory records
Action::make('show_records')
->label(__('Show Records'))
->action(fn ($record) => $record->advance())
->modalContent(fn ($record) => view('filament.pages.actions.inventory-show-records', ['record' => $record]))
//
])
}
Simple blade code to test it:
<x-filament::modal>
<x-slot name="header">
Show Records
</x-slot>

<div>
{{ $this->id }}
</div>
</x-filament::modal>
<x-filament::modal>
<x-slot name="header">
Show Records
</x-slot>

<div>
{{ $this->id }}
</div>
</x-filament::modal>
Thanks in advance!
16 replies
FFilament
Created by gon.exe on 10/23/2023 in #❓┊help
Clickable row on custom page table
Hi, I have a custom Page where I defined getTableQuery(), getTableColumns(), getTableFilters(), getTableFiltersFormColumns(), getTableActions(), and getData() and I need know if exists some function like recordUrl() to execute an action to open a modal when I click the row. Thanks in advance!
2 replies
FFilament
Created by gon.exe on 9/14/2023 in #❓┊help
How to create a dynamically hidden header button?
No description
5 replies
FFilament
Created by gon.exe on 8/8/2023 in #❓┊help
Create multiple records at once
25 replies
FFilament
Created by gon.exe on 8/7/2023 in #❓┊help
Keeping GET parameters through livewire ajax executions
I know this needed was already discussed in different moments because I saw the responses from that but I am not able to do this suggestions on my code. I need to keep a GET parameters through livewire ajax executions to invoke different functions on form function. At first I get the value by "request()->query('purchase_requisition_id');" but then I lose it. The only way I found to do that is: app\Filament\Resources\PurchaseOrderResource.php ->
public static function form(Form $form) : Form
{

// Purchase Order data
$array_form = [
... code for few fields ...
];

// Get purchase_requisition_id
$url = $_SERVER["HTTP_REFERER"] ?? $_SERVER["REQUEST_URI"] ?? null;
$purchase_requisition_id = explode('?purchase_requisition_id=', $url)[1] ?? null;

if ($purchase_requisition_id) {
$array_form = array_merge($array_form, self::createTablePurchaseOrder($purchase_requisition_id));
}
else{
$array_form = array_merge($array_form, self::createTableRepeater());
}

// Return form
return $form
->schema($array_form)
->columns(4);
//
}
public static function form(Form $form) : Form
{

// Purchase Order data
$array_form = [
... code for few fields ...
];

// Get purchase_requisition_id
$url = $_SERVER["HTTP_REFERER"] ?? $_SERVER["REQUEST_URI"] ?? null;
$purchase_requisition_id = explode('?purchase_requisition_id=', $url)[1] ?? null;

if ($purchase_requisition_id) {
$array_form = array_merge($array_form, self::createTablePurchaseOrder($purchase_requisition_id));
}
else{
$array_form = array_merge($array_form, self::createTableRepeater());
}

// Return form
return $form
->schema($array_form)
->columns(4);
//
}
Where I have to add the public property and mount function to replace the way I am getting and keeping the GET parameter? Thanks in advance!
18 replies