Home > Net >  Laravel ReflectionException : Class CustomerAccountController does not exist
Laravel ReflectionException : Class CustomerAccountController does not exist

Time:10-25

I have this project on Laravel 5.7 and Voyager on WAMP with 2 issues, the first one is when I run php artisan route:list and the result is:

 ReflectionException  : Class CustomerAccountController does not exist
 at C:\wamp64\www\cell_marketplace\vendor\laravel\framework\src\Illuminate\Container\Container.php:779

And actually the class exists and I'm using its functions on another processes and it's working, I've checked namespace, ran composer dump-autoload with no results.

The second one, I've created a BREAD on Voyager, and I got the model class and controller class, but when I go to the index of that resource again got this:

 ReflectionException: Class DropOffController does not exist in \vendor\laravel\framework\src\Illuminate\Container\Container.php:779

And the controller exists and has a function that it's actually working, so I think that's related with the first one but if anybody can help I'd really appreciate it

The CustomerAccountController class:

<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Voyager\VoyagerBaseController;
use App\Models\CustomerAccount;
use App\Models\CustomerAccountTransaction;
use App\Models\Provider;
use Illuminate\Http\Request;
use Illuminate\Support\Carbon;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Session;
use Stripe\Charge;
use Stripe\Stripe;
use TCG\Voyager\Facades\Voyager;

class CustomerAccountController extends VoyagerBaseController
{
[...]

CodePudding user response:

I found the issue, it needed the absolute path to the controller, not the relative when configuring the BREAD for that resource, the project is in Laravel Voyager.

  • Related