sadiqgoni13
sadiqgoni13
Explore posts from servers
FFilament
Created by sadiqgoni13 on 11/14/2024 in #❓┊help
System Overheating due to Vite CSS
Eversince I used vite to customize my the css, my system will be overheating and the fan making noise, so my afraid is i dont want the same thing to happen in diffrent environments on production
5 replies
FFilament
Created by sadiqgoni13 on 10/6/2024 in #❓┊help
Navigation Container
No description
6 replies
FFilament
Created by sadiqgoni13 on 9/30/2024 in #❓┊help
Custom Modal Issue
I have been trying this for hours but not working, i want to create a livewire custom modal with filament form , i followed the docs well , but instead i got this error
Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/sadiqgoni/hotel-management/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56
Filament\Resources\Pages\ListRecords::form(): Argument #1 ($form) must be of type Filament\Forms\Form, Filament\Infolists\Infolist given, called in /Users/sadiqgoni/hotel-management/vendor/filament/infolists/src/Concerns/InteractsWithInfolists.php on line 56
and i have not put any infolist in my code This is my OrderResource
->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\ViewAction::make(),
Tables\Actions\DeleteAction::make(),

// Custom Action for the Payment Modal
Action::make('openPaymentModal')
->label('Make Payment')
->icon('heroicon-o-banknotes')
->modalHeading('Make Payment')
->modalWidth('lg')
->modalContent(fn (Order $record) => view('livewire.table-order-component', ['record' => $record]))
->action(fn (Order $record) => null),
])

->actions([
Tables\Actions\EditAction::make(),
Tables\Actions\ViewAction::make(),
Tables\Actions\DeleteAction::make(),

// Custom Action for the Payment Modal
Action::make('openPaymentModal')
->label('Make Payment')
->icon('heroicon-o-banknotes')
->modalHeading('Make Payment')
->modalWidth('lg')
->modalContent(fn (Order $record) => view('livewire.table-order-component', ['record' => $record]))
->action(fn (Order $record) => null),
])

This is my 'App/Livewire'
class TableOrderComponent extends Component implements HasForms
{
use InteractsWithForms;
public function form(Form $form): Form
{
return $form
->schema([
Select::make('paymentMethod')
->label('Payment Method')
->options([
'cash' => 'Cash',
'card' => 'Card',
])
->required(),])
public function render()
{
return view('livewire.table-order-component');
}
class TableOrderComponent extends Component implements HasForms
{
use InteractsWithForms;
public function form(Form $form): Form
{
return $form
->schema([
Select::make('paymentMethod')
->label('Payment Method')
->options([
'cash' => 'Cash',
'card' => 'Card',
])
->required(),])
public function render()
{
return view('livewire.table-order-component');
}
and my blade
<div>
<form wire:submit.prevent="submit">
{{ $this->form }}
<button type="submit" class="btn btn-primary">
Make Payment
</button>
</form>
</div>
<div>
<form wire:submit.prevent="submit">
{{ $this->form }}
<button type="submit" class="btn btn-primary">
Make Payment
</button>
</form>
</div>
1 replies
FFilament
Created by sadiqgoni13 on 9/20/2024 in #❓┊help
Recreating Restaurant Menu Page
No description
4 replies
FFilament
Created by sadiqgoni13 on 9/12/2024 in #❓┊help
Triggering on Card to show table
Even after emitting the event and clicking the card, the showTable method does not seem to be triggering as expected. It does not show the table
class StatsOverview extends BaseWidget
{
protected static ?int $sort = 3;
protected function getStats(): array
{
return [
$this->getCheckedInGuests(),
];
}


protected function getCheckedInGuests(): Card
{
$count = Reservation::where('status', 'Checked In')->count();

return Card::make('Checked-In Guests', $count)
->description('Number of guests currently checked in')
->descriptionIcon('heroicon-o-user-group')
->color('success')
->extraAttributes([
'class' => 'cursor-pointer hover:#54effd7a md:col-span-2 lg:col-span-2',
'wire:click' => "\$emit('showCheckedInGuests')"
]);
}
}
class StatsOverview extends BaseWidget
{
protected static ?int $sort = 3;
protected function getStats(): array
{
return [
$this->getCheckedInGuests(),
];
}


protected function getCheckedInGuests(): Card
{
$count = Reservation::where('status', 'Checked In')->count();

return Card::make('Checked-In Guests', $count)
->description('Number of guests currently checked in')
->descriptionIcon('heroicon-o-user-group')
->color('success')
->extraAttributes([
'class' => 'cursor-pointer hover:#54effd7a md:col-span-2 lg:col-span-2',
'wire:click' => "\$emit('showCheckedInGuests')"
]);
}
}
The table --
class LatestChecked extends BaseWidget
{
public $showTable = false;

protected $listeners = ['showCheckedInGuests' => 'showTable'];

public function showTable()
{
$this->showTable = true;
Log::info('showTable triggered: ' . $this->showTable);
}

protected function getTableQuery(): Builder
{
if ($this->showTable) {
Log::info('Table should be shown.');
return CheckInCheckOut::query()->latest();
}

Log::info('Table is hidden.');
return CheckInCheckOut::query()->whereNull('id');
}

}
class LatestChecked extends BaseWidget
{
public $showTable = false;

protected $listeners = ['showCheckedInGuests' => 'showTable'];

public function showTable()
{
$this->showTable = true;
Log::info('showTable triggered: ' . $this->showTable);
}

protected function getTableQuery(): Builder
{
if ($this->showTable) {
Log::info('Table should be shown.');
return CheckInCheckOut::query()->latest();
}

Log::info('Table is hidden.');
return CheckInCheckOut::query()->whereNull('id');
}

}
class Dashboard extends BaseDashboard { use BaseDashboard\Concerns\HasFiltersForm; protected static ?int $navigationSort = -2; protected static string $routePath = 'Dashboard'; protected static ?string $title = 'Dashboard'; public function getWidgets(): array { return [ AccountWidget::class, FilamentInfoWidget::class, StatsOverview::class, LatestChecked::class, ]; } }```
3 replies
FFilament
Created by sadiqgoni13 on 3/22/2024 in #❓┊help
Navigation Group Arrangement
No description
5 replies
FFilament
Created by sadiqgoni13 on 3/12/2024 in #❓┊help
Dashboard Filter Page
No description
1 replies
FFilament
Created by sadiqgoni13 on 3/7/2024 in #❓┊help
Group By in table
No description
6 replies
FFilament
Created by sadiqgoni13 on 1/26/2024 in #❓┊help
Add Image to Login Page
No description
18 replies
FFilament
Created by sadiqgoni13 on 1/25/2024 in #❓┊help
Add background to Login Page
Please how can i change and add background image to background of LOGIN page
7 replies
FFilament
Created by sadiqgoni13 on 1/24/2024 in #❓┊help
Increase Image Height
No description
11 replies
FFilament
Created by sadiqgoni13 on 1/19/2024 in #❓┊help
Table with sub-rows tree
Please Is there any solution to having collapsible rows or rows that have "sub-rows" that can collapse/expand? I am working on this Chart Of Account that needs a parent child CRUD just like Quickbook
6 replies
FFilament
Created by sadiqgoni13 on 1/3/2024 in #❓┊help
Clients Side Custom Input
So I have a form with 5 inputs and each inputs has its own logic , my clients wants a situation that in the future he may wants to add another more inputs and also labeled them by himselves (example he can create another 2 inputs lets say 'gender','qualification'), how can I allow him do that , any suggestion?
3 replies
FFilament
Created by sadiqgoni13 on 12/7/2023 in #❓┊help
Import Filament V3.1
Import was working perfect on localhost but having issue on production
Class "Filament\Actions\ImportAction" not found
Class "Filament\Actions\ImportAction" not found
namespace App\Filament\Finance\Resources\MonthlySalaryStructureResource\Pages;



use App\Filament\Finance\Resources\MonthlySalaryStructureResource;

use App\Filament\Imports\MonthlyImporter;

use Filament\Actions;

use Filament\Resources\Pages\ListRecords;



class ListMonthlySalaryStructures extends ListRecords

{

protected static string $resource = MonthlySalaryStructureResource::class;



protected function getHeaderActions(): array

{

return [

Actions\ImportAction::make()

->importer(MonthlyImporter::class),

Actions\CreateAction::make(),

];

}

}
namespace App\Filament\Finance\Resources\MonthlySalaryStructureResource\Pages;



use App\Filament\Finance\Resources\MonthlySalaryStructureResource;

use App\Filament\Imports\MonthlyImporter;

use Filament\Actions;

use Filament\Resources\Pages\ListRecords;



class ListMonthlySalaryStructures extends ListRecords

{

protected static string $resource = MonthlySalaryStructureResource::class;



protected function getHeaderActions(): array

{

return [

Actions\ImportAction::make()

->importer(MonthlyImporter::class),

Actions\CreateAction::make(),

];

}

}
4 replies
FFilament
Created by sadiqgoni13 on 11/20/2023 in #❓┊help
Model Label Based on User ID
Please i tried this but it is not working
public static function getModelLabel(): string
{
if (auth()->user()->isHrAdmin()) {
return __('Appraisal Investment');

}
return __('Appraisal Request');

}
public static function getModelLabel(): string
{
if (auth()->user()->isHrAdmin()) {
return __('Appraisal Investment');

}
return __('Appraisal Request');

}
3 replies
FFilament
Created by sadiqgoni13 on 11/14/2023 in #❓┊help
Two Resource One Model
I have two resource sharing one model, I want to delete a data in the first resource I dont want it to reflect the second resource, how can i do that please
7 replies
FFilament
Created by sadiqgoni13 on 11/14/2023 in #❓┊help
Implementing Car Selection Logic in without using Session
I spent the entire day attempting to implement this logic without success. I have two models: 'CAR' and 'car_tenancy.' I only add car names to the 'car' resource. Currently, when I'm working on 'car_tenancy,' I want to ensure that if I select a car and return to create another entry, I shouldn't see the previously selected car. I've implemented the logic using 'session,' but I know it's not suitable for production. Could someone suggest an alternative? Here's a look at my code:
Forms\Components\Select::make('car_id')
->options(function () {
// Retrieve selected car IDs from the session
$selectedCarIds = Session::get('selectedCarIds', []);

// Filter out cars that have already been selected
$availableCars = Car::whereNotIn('id', $selectedCarIds)
->pluck('name', 'id')
->all();

return $availableCars;
})
->reactive()
->required()
->searchable()
->preload()
->required()
->afterStateUpdated(function ( $set, $state) {
// Retrieve and update the selected car IDs in the session
$selectedCarIds = Session::get('selectedCarIds', []);
$selectedCarIds[] = $state;
Session::put('selectedCarIds', $selectedCarIds);

$car = Car::find($state);
if ($car) {
}
}),
Forms\Components\Select::make('car_id')
->options(function () {
// Retrieve selected car IDs from the session
$selectedCarIds = Session::get('selectedCarIds', []);

// Filter out cars that have already been selected
$availableCars = Car::whereNotIn('id', $selectedCarIds)
->pluck('name', 'id')
->all();

return $availableCars;
})
->reactive()
->required()
->searchable()
->preload()
->required()
->afterStateUpdated(function ( $set, $state) {
// Retrieve and update the selected car IDs in the session
$selectedCarIds = Session::get('selectedCarIds', []);
$selectedCarIds[] = $state;
Session::put('selectedCarIds', $selectedCarIds);

$car = Car::find($state);
if ($car) {
}
}),
6 replies
FFilament
Created by sadiqgoni13 on 11/14/2023 in #❓┊help
Using Two Resource Table for Storing and Update
Is there a way to have two tables in the database—one for storing initial item details like item name, price, quantity, and date, and another with the same data but we can performing increments and decrements, continuously updating the data? Ideally, when we 'create' an initial resource the data should be automatically added to both tables in sequence?
7 replies
FFilament
Created by sadiqgoni13 on 11/12/2023 in #❓┊help
Email Notification To Individual User
Hello is it possible to send email notification such that I have this resource form shared by both admin and user such that when the user fill a form and then submit then a notification will then be send to the admin's email ("user1 is waiting for you to mark his appraisal") ...
3 replies
FFilament
Created by sadiqgoni13 on 11/7/2023 in #❓┊help
Filling a form temporary
Please is it possible for users information to be saved temporary when filling a form before submitting I have this appraisal form that an individual user will fill and then when he saved it it will be visible at the admin panel I want the user to temporarily saved his form and then can come back and fill it and then submit it
5 replies