D
D
D44k2015-07-02 16:26:17
Laravel
D44k, 2015-07-02 16:26:17

Class "view" does not exist - Laravel why?

Help me understand what the problem is
. In the local copy, everything works. I posted it on the hosting, there was a problem.
There are 2 controllers with the same structure:
GoodsController

<?php namespace Backend;
class GoodsController extends \BaseController {

MenuController
<?php namespace Backend;
class MenuController extends \BaseController {

route:
Route::group(array('prefix' => 'backend', "namespace" => '\Backend'), function () {

  Route::get('/', function() {
    if(Auth::check() && Auth::user()->role == 10) return Redirect::to('backend/goods');
    else return Redirect::to('backend/login');
  });
  Route::get('login', array('as' => 'backend.login', 'uses' => '[email protected]'));
  Route::post('login', array('as' => 'backend.login.post', 'uses' => '[email protected]'));

  Route::group(array('before' => 'auth|admin'), function () {

    Route::get('logout', '[email protected]');

    Route::resource("goods", 'GoodsController');
    Route::resource("menu", "MenuController");

  });
});

When I try to enter /backend/goods everything works
If I open /backend/menu I get an error:
ReflectionException (-1)
Class \Backend\MenuController does not exist
...
$reflector = new ReflectionClass($concrete);

Both work on local env, on hosting only 1, maybe because of php version 5.6 and 5.5 (hosting)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
D', 2015-07-02
@D44k

composer dumpautoload -o
Did? Should help.
99% of problems with reflection in Laravel are solved by the team above.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question