Support the ongoing development of Laravel.io →
posted 10 years ago
Packages
Last updated 2 years ago.
0

You tried composer dumpautoload I assume?

Last updated 2 years ago.
0

orecrush said:

You tried composer dumpautoload I assume?

yes

Last updated 2 years ago.
0

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']);
});
Last updated 2 years ago.
0

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

Last updated 2 years ago.
0

Sign in to participate in this thread!

Eventy

Your banner here too?

edubuc edubuc Joined 17 May 2014

Moderators

We'd like to thank these amazing companies for supporting us

Your logo here?

Laravel.io

The Laravel portal for problem solving, knowledge sharing and community building.

© 2024 Laravel.io - All rights reserved.