laravel 5 model class not found -
i’m new laravel 5. tried create customer
model in models folder. created both customercontroller
, customer
via php artisan make:...
, error:
fatalerrorexception in customercontroller.php line 30: class 'app\http\controllers\cusomter' not found.
my customer
model:
<?php namespace app\models; use illuminate\database\eloquent\model; class customer extends model { // protected $table = 'customer'; protected $primarykey = 'cid'; // protected $fillable = [ // 'name', // 'gender', // 'address', // 'discountpercent', // 'email', // 'phone' // ];
}
my customercontroller
:
<?php namespace app\http\controllers; use app\http\requests; use app\http\controllers\controller; use illuminate\http\request; use app\models\customer; class customercontroller extends controller { /** * create new controller instance. * * @return void */ public function __construct() { $this->middleware('guest'); } /** * display listing of resource. * * @return response */ public function index() { // $customers = customer::all(); return view::make('customer.home',compact('customers')); // return view('customer.home'); } /** * show form creating new resource. * * @return response */ public function create() { // } /** * store newly created resource in storage. * * @return response */ public function store() { // } /** * display specified resource. * * @param int $id * @return response */ public function show($id) { // } /** * show form editing specified resource. * * @param int $id * @return response */ public function edit($id) { // } /** * update specified resource in storage. * * @param int $id * @return response */ public function update($id) { // } /** * remove specified resource storage. * * @param int $id * @return response */ public function destroy($id) { // } }
i dont know doing wrong. there help. did search on internet , know namespace. there ebook or documents me understand how namespace works, how use , need declare before using it
you’ve spelt “customer” wrong in index
action.
Comments
Post a Comment