orecrush said:
You tried composer dumpautoload I assume?
yes
You have no namespaces setup in your Role.php
Per your PSR-0 structure, and as you said you have a "models" dir:
// Role.php
<?php namespace Alakees\Cms\Models;
class Role extends Eloquent {
protected $fillable = ['name'];
}
Then you can call this Role using the namespace:
<?php
Route::get('toto', function()
{
$member = \Alakees\Cms\Models\Role::create(['name' => 'member']);
});
Thanks for your answer, in fact my error, on top of the missing namespace, was that my "models" directory was in alakees/cms/src. I moved it instead to alakees/cms/src/Alakees/Cms and now it's fine
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community