dimanche 23 juillet 2017

Laravel 5.1 Traits not found

My trait is in App/Traits/MyTrait.php and this is how the file looks like:

namespace App\Traits;

trait MyTrait
{
    // ..
}

And this is how my model that includes the trait looks like:

use App\Traits\MyTrait;

class MyClass
{
    use MyTrait; <-- errors out here

    // ..
}

But I still get Trait Not Found error. Any idea why? I am using Laravel 5.1. Do I have make changes in some configuration file?



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire