12 Replies
you can access the model via
static::getModel()
@Shiv if it works mark this as solvedi want the record
it just return the string
@Shiv have you tried using the model in any way? you can query, create, delete, etc
Mmm i don't want that you have misunderstood me
I want the current record not the model class
For example i want the current order id not the order model class
Something like
ok so, why you trying to access the record in the
form()
method? what are you trying to do?
https://filamentphp.com/docs/2.x/admin/resources/editing-records#customizing-data-before-filling-the-form
check that link, you can handle form data in multiple ways
but yeah it would also be more convenient if you explain what you're trying to do ❓The orders have multiple products and those products belongs to a category
I want to show all products with their category name in textinput
[product 1 - category 1]
[Product 2 - category 2]
@Shiv I have the same problem.
Did you manage to access the record?
it doesnt have that feature you can either use select field or show 2 seperate fields using fieldinput
I found a little hack to get the record id, so i can find() the model:
$form->getlivewire()->record->id