Skip to content
Advertisement

Laravel – Undefined variable: Instructor

I am trying to pass users with a specific role_id through a form on a create.blade.php see below;

JavaScript

User.php

JavaScript

CoursesController.php

My create function:

JavaScript

The following error is being returned:

Undefined variable: Instructor (View: C:xampphtdocstestresourcesviewsadmincoursescreate.blade.php)

I am not sure where I have gone wrong. Thanks for any help.

Referring to my latest comment:

Referring to my latest comment

Advertisement

Answer

In the controller, you missing pass Instructor to your view:

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement