Elquent Relation to VUEjs

Posted 3 months ago by virgiltu

I am trying to create a cascade drop down menu. The example is simple. Create an option lets say car makers and add car models to it

What I did. Create table for both options and value. Create a relation ship has many on the Make side. now when I pull do : FYI using blade

  @foreach ($makes->value as $carModel)
         {{ $carModel->name }}

I get the models create. - Great that works

I figured out that I can pull my Makes in Vue by using this {!! json_encode($Makes) !!}

however how can I iterate through each option so create the value for the second drop down.

Thank you for all the help. I am still going through tutorials but this one is taking a lot longer that I would like and I honest gave up.

Please sign in or create an account to participate in this conversation.

Reply to

Use Markdown with GitHub-flavored code blocks.