EL REKT
Explore posts from serversTLCTuto's Laravel Corner
•Created by EL REKT on 5/24/2024 in #💡filament
Searchable for models/relationships with different database connections
6 replies
Redirect to index after creation
I used modification when creating a record with the
handleRecordCreation
function, but the function to create notifications and redirect to index doesn't work, is there a proper way to solve this? so far that's what I've done..
protected function handleRecordCreation(array $data): Model
{
$create = DB::select(
'EXEC create_ticket ?, ?, ?, ?, ?, ?, ?',
[
$data['location_id'],
$data['priority_id'],
$data['type_id'],
$data['created_by'],
$data['ticket_name'],
$data['ticket_desc'],
$data['images'],
]
);
$id = DB::scalar('SELECT ' . $create[0]->Id);
return TicketHeader::find($id);
}
protected function afterCreate(): void
{
Notification::make()
->success()
->title('Ticket Created!')
->body('Trouble ticket created successfully.');
}
protected function getRedirectUrl(): string
{
return $this->getResource()::getUrl('index');
}
10 replies
TLCTuto's Laravel Corner
•Created by EL REKT on 2/7/2024 in #💡filament
Three level dependent select
i have 3 table like this :
table a => id, name
table b =>id, table_a_id, name
table c => id, table_b_id, name
How do I create a relationship in table model C to get data related to tables B and A? anyone can help ?4 replies
Route in Nested Resources
I created nested resources by following the steps from here: https://laraveldaily.com/post/filament-v3-nested-resources-trait-pages
but I still have 1 more resource under child resource (in this case under LessonResource), how do I write the route?
5 replies
TLCTuto's Laravel Corner
•Created by EL REKT on 1/21/2024 in #💡filament
How to integrate filament v3 with stored procedure
I want to use stored procedures for CRUD needs. But I'm confused about how to call the stored procedure function from the create/edit button, or when I want to display the resulting data from the stored procedure in a table. anyone can help ?
12 replies
How to integrate filament v3 with stored procedure
I want to use stored procedures for CRUD needs. But I'm confused about how to call the stored procedure function from the create/edit button, or when I want to display the resulting data from the stored procedure in a table. anyone can help ?
3 replies