dimanche 29 novembre 2015

Model not found Error - Laravel 5

User Model

class User_Model extends Model
{
    protected $table = "user";
    protected $primaryKey = "UserID";

    public function classes() {
        return $this->hasOne('App\Models\Classes_Model');
    }
}

Classes Model

class Classes_Model extends Model
{
    protected $table = "classes";
    protected $primaryKey = "ClassID";
}

User Conroller

class UserController extends Controller
{
    public function index()
    {
        $users = \App\Models\User_Model::find(1)->classes();
        return View("\user\user", array("users" =>  $users));
    }
}

When Controller Action Method runs...I get below error.

Class '/app/Models/Classes_Model' not found

My app structure is below

enter image description here



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/1TlQqC5
via IFTTT

Aucun commentaire:

Enregistrer un commentaire