TransformBinary
TransformBinary

Reputation: 268

Can't Find Model after creating Folder for Controller

Symfony \ Component \ Debug \ Exception \ FatalErrorException
Class 'Controllers\Admin\User' not found

<?php namespace Controllers\Admin;
class UserStoreController extends BaseController{

Location of my Controller is app>controllers>admin>UserStoreController.php It would work well outside admin folder, but once it's in admin folder it would fail.

I also tried PSR-0 on composer.phar autoload & use app\models\user;

basically i'm just trying to use laravel's ORM but i cant because the controller is in the folder.

Any idea how i could go around this issue?

Upvotes: 0

Views: 399

Answers (2)

chris342423
chris342423

Reputation: 451

As JeannotLapin said, update the composer autoloader or add the path to Laravels built-in autoloading: /app/start/global.php, method ClassLoader::addDirectories()

Upvotes: 0

lyl0o0o
lyl0o0o

Reputation: 420

You need to update the autoloader

composer dump-autoload

Upvotes: 3

Related Questions