mardi 28 novembre 2017

Laravel 5.5 not found class with correct namespace

My ./app folder looks like:

+-- app
   +-- Classes
       +-- Events
          +-- EventBase.php
          +-- EventX.php

There's nothing secret with EventX file:

<?

namespace App\Classes\Events;

class EventX {
  // ...
}

EventBase.php represents a Facade that inside it I just try to instantiate an EventX:

public function someMethod() {
  new \App\Classes\Events\EventX;
  // ...
}

After this line, Framework throw an exception telling that class was not found:

Symfony\Component\Debug\Exception\FatalThrowableError (E_ERROR)
Class 'App\Classes\Events\EventX' not found

I already had this issue before when trying to create Facades and solved by moving class file from his current directory and after moving back (yeah, I don't why but it worked).

Something tells me that this is an issue of autoload process, so I tried these command (but still not working):

php artisan cache:clear

php artisan clear-compiled

php artisan config:clear

composer dump-autoload

What can I do in order to investigate the problem?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2ADz2ZT
via IFTTT

Aucun commentaire:

Enregistrer un commentaire