Bloom
Bloom
FFilament
Created by Bloom on 9/11/2024 in #❓┊help
Tab on custom page
Is there a way to implement tab on a custom page just like on list record getTab() method
6 replies
FFilament
Created by Bloom on 7/25/2024 in #❓┊help
Autofocus Search
Is there a way to make the search field autofocus when page is loaded
5 replies
FFilament
Created by Bloom on 7/12/2024 in #❓┊help
Two tables in a custom page
I have made a custom page and render a table there, but i want to display two tables side by side. The two tables are from the same database with different condition. Is there a way to do it.
6 replies
FFilament
Created by Bloom on 7/9/2024 in #❓┊help
Autofocus after submitting form
I make a custom page and render filament form as below
public function form(Form $form): Form
{
return $form
->schema([
Select::make('product_id')
->searchable()
->autofocus()
->label('Search Product')
->getSearchResultsUsing(fn (string $search): array => Product::where('product_name', 'like', "%{$search}%")
->orWhere('barcode', 'like', "%{$search}%")
->limit(20)->pluck('product_name', 'id')->toArray())
->noSearchResultsMessage('No products found.')
->searchPrompt('Search by name or barcode')
->searchingMessage('Searching products...')
->required()
->native(false),
TextInput::make('quantity')
->label('quantity')
->numeric()
->default(1)
->required(),
])->columns(2)
->statePath('data');
}
public function form(Form $form): Form
{
return $form
->schema([
Select::make('product_id')
->searchable()
->autofocus()
->label('Search Product')
->getSearchResultsUsing(fn (string $search): array => Product::where('product_name', 'like', "%{$search}%")
->orWhere('barcode', 'like', "%{$search}%")
->limit(20)->pluck('product_name', 'id')->toArray())
->noSearchResultsMessage('No products found.')
->searchPrompt('Search by name or barcode')
->searchingMessage('Searching products...')
->required()
->native(false),
TextInput::make('quantity')
->label('quantity')
->numeric()
->default(1)
->required(),
])->columns(2)
->statePath('data');
}
And handle the form submission as below
public function save(): void
{
try {
$data = $this->form->getState();
$product = Product::find($data['product_id']);
$data = [
'user_id'=> auth()->user()->id,
'product_id' => $product->id,
'quantity' => $data['quantity'],
'cost_price'=>$product->cost_price,
'selling_price' => $product->selling_price,
'discount' =>0,
];
SaleCart::create($data);
$this->updateTotal();
$this->form->fill();
} catch (Halt $exception) {
//throw $th;
}
}
public function save(): void
{
try {
$data = $this->form->getState();
$product = Product::find($data['product_id']);
$data = [
'user_id'=> auth()->user()->id,
'product_id' => $product->id,
'quantity' => $data['quantity'],
'cost_price'=>$product->cost_price,
'selling_price' => $product->selling_price,
'discount' =>0,
];
SaleCart::create($data);
$this->updateTotal();
$this->form->fill();
} catch (Halt $exception) {
//throw $th;
}
}
When first loading the page the autofocus on Select works well but after submitting and handling with save how can i make select be autofocus again. Is there is a filament way of handling this.
6 replies
FFilament
Created by Bloom on 6/28/2024 in #❓┊help
Global Search like style in form
From my previous filament project and from the document as i have seen, when i want to search a list i used Select form component but is there a way to implement a text input like how a global search work
4 replies
FFilament
Created by Bloom on 6/12/2024 in #❓┊help
Changing Navbar Color
No description
17 replies
FFilament
Created by Bloom on 6/10/2024 in #❓┊help
Resource not in sidebar
I have installed new filament application and Resources is not appearing in navigation menu. I have read from this trick https://v2.filamentphp.com/tricks/admin-panel-resource-not-in-sidebar but i don't have any policy on my app.
19 replies
FFilament
Created by Bloom on 3/13/2024 in #❓┊help
Edit modal action not working
I have a resource which i made using --simple flag, i add edit table action to it but when i click nothing is displayed, the url show the id of the record but modal is not shown. Please help
5 replies
FFilament
Created by Bloom on 3/7/2024 in #❓┊help
Backgrounds plugin by SWIS
I try to use this plugin by SWIS https://filamentphp.com/plugins/swisnl-backgrounds#remember which is a background changer on auth page. I can see it on the local server but no image is shown on live shared hosting server
2 replies
FFilament
Created by Bloom on 2/13/2024 in #❓┊help
Help on table eloquent relationship
I have Sale and Branch Model with one to Many relationship. I made custom page with query like
public function table(Table $table): Table
{
return $table
->relationship(fn (): HasMany => $this->branch->sales())
->inverseRelationship('branch')
->columns([
TextColumn::make('branch_name'),
]);
}
public function table(Table $table): Table
{
return $table
->relationship(fn (): HasMany => $this->branch->sales())
->inverseRelationship('branch')
->columns([
TextColumn::make('branch_name'),
]);
}
But unfortunately no result came. I tried debugging using debug bar but no query regarding this join is visible
2 replies
FFilament
Created by Bloom on 2/7/2024 in #❓┊help
Maximum execution time of 30 seconds exceeded Error
I have hosted my filament apps on godaddy.com, some navigation works and some navigation give me "Maximum execution time of 30 seconds exceeded". Is there a fix to it
4 replies
FFilament
Created by Bloom on 2/6/2024 in #❓┊help
Custom Theme Error
What i did: I already create a project and on that i install custom theme according to the documentation https://filamentphp.com/docs/3.x/panels/themes So i got the error : [postcss] Cannot find module 'postcss-nesting' Require stack: - C:\Users\Cyber\code\baptistbookroom\node_modules\tailwindcss\lib\postcss-plugins\nesting\plugin.js - C:\Users\Cyber\code\baptistbookroom\node_modules\tailwindcss\lib\postcss-plugins\nesting\index.js - C:\Users\Cyber\code\baptistbookroom\node_modules\tailwindcss\nesting\index.js - C:\Users\Cyber\code\baptistbookroom\postcss.config.js I know its not entirely filament problem but if anyone can help me I would be really glad
2 replies
FFilament
Created by Bloom on 1/25/2024 in #❓┊help
How to access the current data in edit page?
How can i get the current state of a data in edit page to be manipulated using mutateFormDataBeforeFill, i saw the below code on documentation but instead of auth()->id() i want to query data
protected function mutateFormDataBeforeFill(array $data): array
{
$data['user_id'] = auth()->id();

return $data;
}
protected function mutateFormDataBeforeFill(array $data): array
{
$data['user_id'] = auth()->id();

return $data;
}
3 replies
FFilament
Created by Bloom on 1/24/2024 in #❓┊help
Problem with split form components
When i try to use split i get an error Use of unknown class: 'Filament\Forms\Components\Split'. I already import the class. What could be the reason
2 replies
FFilament
Created by Bloom on 12/5/2023 in #❓┊help
Declaration of Filament\Actions\Concerns\InteractsWithRecord::getModel()
i am using InteractsWithRecord on custom page and i get the above error, can anyone help me with it?
14 replies
FFilament
Created by Bloom on 12/5/2023 in #❓┊help
How to separate navigation item in the same navigation group
No description
8 replies
FFilament
Created by Bloom on 11/29/2023 in #❓┊help
Unable to locate a class or view for component [filament-support::button].
I upgrade my v2 filament app to v3 and i get this error, can anyone help me with it.
5 replies
FFilament
Created by Bloom on 10/31/2023 in #❓┊help
Custom query in summaries
->columns([
TextColumn::make('mainStock.item.item_name'),
TextColumn::make('quantity'),
TextColumn::make('cost_price')
->label('Cost Price'),
TextColumn::make('mrp')
->summarize(Summarizer::make()
->label('Total')
->using(fn (Builder $query): string => $query->sum('mrp'))),
])
->columns([
TextColumn::make('mainStock.item.item_name'),
TextColumn::make('quantity'),
TextColumn::make('cost_price')
->label('Cost Price'),
TextColumn::make('mrp')
->summarize(Summarizer::make()
->label('Total')
->using(fn (Builder $query): string => $query->sum('mrp'))),
])
Instad of just getting the sum i want to display a sum of mrp multiplied by each quantity
2 replies
FFilament
Created by Bloom on 10/30/2023 in #❓┊help
Autofocus on custom form
How to autofocus form after submit in custom livewire page. i have saw on the document to clear the form using
$this->form->fill();
$this->form->fill();
But is it possible to autofocus on the form after submitting
4 replies
FFilament
Created by Bloom on 10/28/2023 in #❓┊help
Header action to the left of the page
How to place header action to the left of the page instead of the default right side
4 replies