laravel - After update from local to server : Class 'category' not found -
edit: changed lowercase 'c' uppercase 'c' in belongsto.... carelessness...
on local machine ok, error after upload server.
i have basic 1 one relationship:
symbol.php - model:
class symbol extends eloquent { protected $table = 'symbols'; protected $softdelete = true; public function category() { return $this->belongsto('category', 'id_category'); } }
category.php - model
class category extends eloquent { protected $table = 'categories'; }
i call relationship this:
$symbol = symbol::find($id);
but if want access data:
$symbol->category->name;
on local machine ok after upload server error:
symfony \ component \ debug \ exception \ fatalerrorexception class 'category' not found $instance = new $related; (line 527)
any ideas?
but why works on local? different server settings?
if worked on local machine , not on server think, have windows
operating system installed on local machine , on server, there linux
driven system. so, on windows
category
, category
doesn't matter on linux
, does,so if have class category
, refer category
doesn't exist @ because linux
case sensitive.
check this , @ case sensitivity
.
Comments
Post a Comment