Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

baajanssen's avatar

@Cronix

this is the error i receive

ReflectionException thrown with message "Class Front\Controllers\FrontPagesController does not exist"

Stacktrace:
#21 ReflectionException in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Container/Container.php:767
#20 ReflectionClass:__construct in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Container/Container.php:767
#19 Illuminate\Container\Container:build in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Container/Container.php:646
#18 Illuminate\Container\Container:resolve in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Container/Container.php:601
#17 Illuminate\Container\Container:make in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Foundation/Application.php:734
#16 Illuminate\Foundation\Application:make in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Route.php:226
#15 Illuminate\Routing\Route:getController in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Route.php:796
#14 Illuminate\Routing\Route:controllerMiddleware in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Route.php:757
#13 Illuminate\Routing\Route:gatherMiddleware in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Router.php:678
#12 Illuminate\Routing\Router:gatherRouteMiddleware in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Router.php:658
#11 Illuminate\Routing\Router:runRouteWithinStack in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Router.php:642
#10 Illuminate\Routing\Router:runRoute in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Router.php:608
#9 Illuminate\Routing\Router:dispatchToRoute in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Router.php:597
#8 Illuminate\Routing\Router:dispatch in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:176
#7 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:30
#6 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/CheckForMaintenanceMode.php:62
#5 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:151
#4 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Routing/Pipeline.php:53
#3 Illuminate\Routing\Pipeline:Illuminate\Routing\{closure} in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php:104
#2 Illuminate\Pipeline\Pipeline:then in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:151
#1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in /home/vagrant/Code/bee/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php:116
#0 Illuminate\Foundation\Http\Kernel:handle in /home/vagrant/Code/bee/public/index.php:53
Cronix's avatar

Yes, it's a namespace issue. I haven't tried to put things outside of app before (why would you - that's the point of app...its for YOUR APP) so not sure what you'd need to do besides create another root namespace in composer.json, like they did for App, and then reference it everywhere you'd use the class. You'll want to research composer and namespaces to see how it all works. This isn't really a laravel problem at this point, per se.

This is not something I'd try doing if you are "new to laravel". I'd just use the app directory like how its supposed to be used.

-Front
    --Controllers
    --Resources
        --assets
        --views
    --Resources

I'd put all of those in app.

baajanssen's avatar

@Cronix thnx for the reply!

What I'm trying to achieve is the separation of my CMS and the Front files of a specific client. There will be more clients using my CMS, and I want the CMS easily updateable. That's why I'm looking for a directory hierarchy where I can push the "CMS repository" (the current version of the CMS) to the CMS folder of a client, in order to update their CMS. I also have to note I'm fairly new to development in general (git, php), so I'm not sure if what I'm trying to do is even the right way to go, but I have to start somewhere ^^

Thnx for the help until now!

Previous

Please or to participate in this conversation.