DEV Community

Md Abdullah al noor
Md Abdullah al noor

Posted on

laravel resource url depend on model?

laravel resource url depend on model?

1

i am run this command for model, migration, resource controller. php artisan make:model QuestionAnswer -mc -r ..

Resource Route Route::resource('faq','QuestionAnswerController');

My Edit Function

public function edit(QuestionAnswer $questionAnswer)
    {
        // return $questionAnswer
        return view('backend.faq.edit',get_defined_vars());
    }

Edit Route {{route('admin.faq.edit',$questionAnswer->id)}}

Edit function return $questionAnswer return null

Below Picture

enter image description here

enter image description here

When i Change resource route

Top comments (0)