3

3 weeks agoby Vishal Arora

Class 'App\restros' not found

----------------------------------------------------this is my controller <?php

namespace App\Http\Controllers;

use Illuminate\Http\Request; use App\restros; class restro_controller extends Controller { // public function index(){ return view('restaurant.restro_home'); }

   public function str(){
	return view('restaurant.restro_str');
}

  public function list(){
  	return restros::all();
	return view('restaurant.restro_list');
}

}

---------------------------------------------------this is my model

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class restros extends Model { // protected $fillable = 'name','email','address'; }

---------------------i got this error Error Class 'App\restros' not found http://localhost:8000/list

App\Http\Controllers\restro_controller::list app/Http/Controllers/restro_controller.php:19

9

Bhagyaraj Aj replied 3 weeks ago

0

Have you placed your model in app directory. i.e.. restros.php in app folder, and check no subdirectory created like models/restros.php

Please check with that.The Error is clearly inidicated where it is.

Ask Question
Most Visited
Categories