29
Июл
2016

Class App\Http\Controllers\MyController does not exist

controller.php

namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesResources;

class Controller extends BaseController
{
    use AuthorizesRequests, AuthorizesResources, DispatchesJobs,    ValidatesRequests;
}
class MyController extends Controller
{
    function getIndex()
    {
        $hello="Hello world!!";
        return view('mainpage',['hello'=>$hello]);
    }

}

route.php

Route::resource('/', 'MyController');

на выходе получаю следующую ошибку при создании своего контроллера

Class App\Http\Controllers\MyController does not exist

Источник: https://ru.stackoverflow.com/questions/550002/class-app-http-controllers-mycontroller-does-not-exist

Share

Тебе может это понравится...