Show relationship in textbox

Hi, so I'm using laravel as my backend. In my front end people can fill out a contactform and either include a car or just a general contactform. In the database the id of the car gets saved. But I would like to be able to show the brand name + model of the car in the form and make it clickable so it goes to the car the form was filled in about. In my cars table the brand is an id which has a relationship to a brand table How would I best go about this?
8 Replies
Dan Harrin
Dan Harrin2y ago
where should they click? inside a form?
Absolium
AbsoliumOP2y ago
Yes, wait I'm getting some more info to make things clearer: this is a message seeder:
[
'car_id' => $carIds->random(),
'first_name' => 'Bob',
'last_name' => 'Doe',
'email' => '[email protected]',
'phone' => '987-654-3210',
'comments' => 'Is this car still available?',
],
[
'car_id' => $carIds->random(),
'first_name' => 'Bob',
'last_name' => 'Doe',
'email' => '[email protected]',
'phone' => '987-654-3210',
'comments' => 'Is this car still available?',
],
Absolium
AbsoliumOP2y ago
Absolium
AbsoliumOP2y ago
In here the Car select box I want to change to a textbox with as value the brand name + car model And since there can be multiple same cars (used car dealership) It would be very useful to be able to click on the car and be sent to my car page Which should just be /admin/cars/id This is my messageResource
Dan Harrin
Dan Harrin2y ago
you can use markdown in the helperText() of a field pass a function, get the $state of the field, and use markdown to write a link
Absolium
AbsoliumOP2y ago
Thank you How could i go about passing the brand name and car model in the field?
Dan Harrin
Dan Harrin2y ago
Car::find($state)
Absolium
AbsoliumOP2y ago
Thank you a lot You guys rock
Want results from more Discord servers?
Add your server