codeartisan
codeartisan
FFilament
Created by codeartisan on 5/13/2024 in #❓┊help
Use filament in wirelive
Help me with the link to documentation of how i can use filament in livewire
6 replies
FFilament
Created by codeartisan on 5/2/2024 in #❓┊help
Auto increment column
Am using livewire and filament but I want to add a column that is auto generated with the numbers incrementing
Tables\Columns\TextColumn::make('date')
->date()
->label("Date")
->copyable()
->sortable(),
Tables\Columns\TextColumn::make('customer.name')
->searchable()
->sortable()
->copyable()
->label("Customer Name")
->sortable(),
Tables\Columns\TextColumn::make('coffee.name')
->searchable()
->sortable()
->copyable()
->label("Coffee Type")
->sortable(),
Tables\Columns\TextColumn::make('mc')
->numeric()
->sortable()
->label("MC")
->searchable()
->sortable(),
Tables\Columns\TextColumn::make('date')
->date()
->label("Date")
->copyable()
->sortable(),
Tables\Columns\TextColumn::make('customer.name')
->searchable()
->sortable()
->copyable()
->label("Customer Name")
->sortable(),
Tables\Columns\TextColumn::make('coffee.name')
->searchable()
->sortable()
->copyable()
->label("Coffee Type")
->sortable(),
Tables\Columns\TextColumn::make('mc')
->numeric()
->sortable()
->label("MC")
->searchable()
->sortable(),
6 replies
FFilament
Created by codeartisan on 4/26/2024 in #❓┊help
Join 3 tables
I want to write a query that joins 3 tables in filament that are less related
6 replies
FFilament
Created by codeartisan on 4/26/2024 in #❓┊help
Create a resume like builder in filament php
I want to create a resume builder using filament just asking if that is possible
5 replies
FFilament
Created by codeartisan on 4/7/2024 in #❓┊help
Create an email like table using filament
No description
5 replies
FFilament
Created by codeartisan on 4/1/2024 in #❓┊help
Dynamically create a column in the
Tables\Columns\TextColumn::make('date')
->date()
->sortable(),
Tables\Columns\TextColumn::make('user_amount')
->searchable()
->toggleable()
->sortable()
->label('Money from Safe'),
Tables\Columns\TextColumn::make('system_amount')
->searchable()
->toggleable()
->sortable()
->label('System Amount')
->sortable(),
Tables\Columns\TextColumn::make('difference')
->label('Difference')
->formatStateUsing(function (Model $record) {
die($record);
return $record->user_amount - $record->system_amount;
}),
Tables\Columns\TextColumn::make('type')
->searchable(),
Tables\Columns\TextColumn::make('date')
->date()
->sortable(),
Tables\Columns\TextColumn::make('user_amount')
->searchable()
->toggleable()
->sortable()
->label('Money from Safe'),
Tables\Columns\TextColumn::make('system_amount')
->searchable()
->toggleable()
->sortable()
->label('System Amount')
->sortable(),
Tables\Columns\TextColumn::make('difference')
->label('Difference')
->formatStateUsing(function (Model $record) {
die($record);
return $record->user_amount - $record->system_amount;
}),
Tables\Columns\TextColumn::make('type')
->searchable(),
I want to create a field called difference
22 replies
FFilament
Created by codeartisan on 3/28/2024 in #❓┊help
FormatUsingState is null on a select relationship
Forms\Components\Select::make('sponsor_id')
->relationship('sponsor', 'first_name')
->native(false)
->formatStateUsing(function ($state, $record) {
//console.log($record);
dd($state);
return $record->first_name . ' ' . $record->second_name;
})
->label("Sponsor Name")
->searchable()
->preload(),
Forms\Components\Select::make('sponsor_id')
->relationship('sponsor', 'first_name')
->native(false)
->formatStateUsing(function ($state, $record) {
//console.log($record);
dd($state);
return $record->first_name . ' ' . $record->second_name;
})
->label("Sponsor Name")
->searchable()
->preload(),
5 replies
FFilament
Created by codeartisan on 3/26/2024 in #❓┊help
Getting access to the request object in filament table actions
When an action is performed I need to log the action but at some point I need to get access the request object
public function createAudit(Request $request, $description, $event_type)
{
return AuditLog::create([
'user_id' => auth()->id(),
'description' => $description,
'event_type' => $event_type,
'business_id' => auth()->user()->business->id,
'branch_id' => auth()->user()->branch->id,
'date' => Carbon::now(),
'ip_address' => $request->ip(),
'user_agent' => $request->userAgent(),
'method' => $request->method(),
]);
}
public function createAudit(Request $request, $description, $event_type)
{
return AuditLog::create([
'user_id' => auth()->id(),
'description' => $description,
'event_type' => $event_type,
'business_id' => auth()->user()->business->id,
'branch_id' => auth()->user()->branch->id,
'date' => Carbon::now(),
'ip_address' => $request->ip(),
'user_agent' => $request->userAgent(),
'method' => $request->method(),
]);
}
5 replies
FFilament
Created by codeartisan on 3/24/2024 in #❓┊help
Pick data from 2 tables and display it to the user
I want to pick data from 2 tables and create one final table which am to display to the user .How can I do that in filament?
4 replies
FFilament
Created by codeartisan on 3/22/2024 in #❓┊help
Create default filter to be today
I have a table and I want to make the default filter to be today so that today's record are showned initially
11 replies
FFilament
Created by codeartisan on 3/22/2024 in #❓┊help
Export Data Automatically
I have export buttons on my tables but I want these buttons to start exporting automatically once pressed
2 replies
FFilament
Created by codeartisan on 3/21/2024 in #❓┊help
Conditional Rendering in filament forms
I have a form and I want when a use selects sponsorChild I show the children dropdown , when i select Rescue Baby I show the baby dropdown
->schema([
Forms\Components\Select::make('sponsor.sponor_id')
->relationship('sponsor', 'first_name')
->native(false)
->label("Sponsor Name")
->searchable()
->preload(),
Forms\Components\Select::make('type')
->live()
->options([
'RescueBaby' => 'Rescue Baby',
'SponsorChild' => 'Sponsor Child',
])
->searchable()
->preload()
->label("Type")
->required(),
Forms\Components\Select::make('child_id')
->label('Children Name')
->options(Children::all()->pluck('first_name', 'id'))
->searchable()
->visible(fn (Form $component) => $component->getState() === 'SponsorChild')
->preload(),
Forms\Components\Select::make('baby_id')
->label('Babies Homes')
->options(Children::all()->pluck('first_name', 'id'))
->searchable()
->visible(fn (Form $component) => $component->getState() === 'RescueBaby')
->preload(),
]);
->schema([
Forms\Components\Select::make('sponsor.sponor_id')
->relationship('sponsor', 'first_name')
->native(false)
->label("Sponsor Name")
->searchable()
->preload(),
Forms\Components\Select::make('type')
->live()
->options([
'RescueBaby' => 'Rescue Baby',
'SponsorChild' => 'Sponsor Child',
])
->searchable()
->preload()
->label("Type")
->required(),
Forms\Components\Select::make('child_id')
->label('Children Name')
->options(Children::all()->pluck('first_name', 'id'))
->searchable()
->visible(fn (Form $component) => $component->getState() === 'SponsorChild')
->preload(),
Forms\Components\Select::make('baby_id')
->label('Babies Homes')
->options(Children::all()->pluck('first_name', 'id'))
->searchable()
->visible(fn (Form $component) => $component->getState() === 'RescueBaby')
->preload(),
]);
2 replies
FFilament
Created by codeartisan on 3/20/2024 in #❓┊help
Edit Does not show the user image
I have a form that has an option of the image upload but the challenge is when editting i dont see the image yet it appears on the list children page
Forms\Components\FileUpload::make('profile_picture')
->directory('children')
->image()
->label('Child Image')
->required(),
Forms\Components\FileUpload::make('profile_picture')
->directory('children')
->image()
->label('Child Image')
->required(),
3 replies
FFilament
Created by codeartisan on 3/18/2024 in #❓┊help
Tailwindcss Does not Load on the production server
Am deploying a laravel website on a subdomain on a cpanel I do run npm run build and the css compiles but the css files to load on my prodction server when I check the console I find this
http://127.0.0.1:5173/@vite/client net::ERR_BLOCKED_BY_CLIENT
public/:24


GET http://127.0.0.1:5173/resources/css/app.css net::ERR_BLOCKED_BY_CLIENT on the production server the css does not load
http://127.0.0.1:5173/@vite/client net::ERR_BLOCKED_BY_CLIENT
public/:24


GET http://127.0.0.1:5173/resources/css/app.css net::ERR_BLOCKED_BY_CLIENT on the production server the css does not load
I have tried solutions on the internet but seems none is working for me at the moment
36 replies
FFilament
Created by codeartisan on 3/15/2024 in #❓┊help
Delete Action Not Working
I am using a filament table component in my livewire application but the delete action instead redirects to the show details page
ActionTable::make('delete')
->label('Delete')
->requiresConfirmation()
->color('danger')
->icon('heroicon-o-trash')
->url(function ($record) {
return route('customers.delete', $record);
}),
ActionTable::make('delete')
->label('Delete')
->requiresConfirmation()
->color('danger')
->icon('heroicon-o-trash')
->url(function ($record) {
return route('customers.delete', $record);
}),
27 replies
FFilament
Created by codeartisan on 3/14/2024 in #❓┊help
Add Other Options on filament Sidebar
I want to add more options on the sidebar that are not from filament like logout , help and settings. How best can I do that
29 replies
FFilament
Created by codeartisan on 3/10/2024 in #❓┊help
Summarize Help
I have a table called balancing and a table called coffee types but in the balancing table I store the coffee type id right now I want to sum the money for milling in balancing based on the coffee type id I captured and display it at the bottom . How best can I do that?
2 replies
FFilament
Created by codeartisan on 3/10/2024 in #❓┊help
Change filter layout
I am using filament tables in my livewire project and everything works fine but I want to shift the filters above my table How best can I do that tried this method but seems not to work and also I am using to find the trait that can do that
use Filament\Tables\Filters\Layout;

protected function getTableFiltersLayout(): ?string
{
return Layout::AboveContent;
}
use Filament\Tables\Filters\Layout;

protected function getTableFiltersLayout(): ?string
{
return Layout::AboveContent;
}
6 replies
FFilament
Created by codeartisan on 3/8/2024 in #❓┊help
Create a customized query for custom table component in livewire
I have used the filament table in my livewire but i want to customize the query
return $table
->query(Customer::query())
return $table
->query(Customer::query())
5 replies
FFilament
Created by codeartisan on 3/8/2024 in #❓┊help
Change Filter Position on a custom table component
I created a custom table component in livewire but I want to change the filter positions to be at the top how best can i do that .I have used this layout method but seems not to work
protected function getTableFiltersLayout(): ?string
{

return Layout::AboveContent;
}
protected function getTableFiltersLayout(): ?string
{

return Layout::AboveContent;
}
but does not work
3 replies