Controller laravel 5

0

My next project structure:

My ControllerLogin class is as follows:

<?php

 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 ControllerLogin extends BaseController {

public function index() {
    return view('template.login-template');
    }
}

?>

My Routes:

Route::get('login', 'ControllerLogin@index');

I have the following error: Sorry, the page you are looking for could not be found.

My question would be: how should return view of my controller class be, because login-template is inside the template folder, is not finding page.

I was able to solve my problem I forgot to add the following line in my ControllerLogin class:

namespace App\Http\Controllers; 
    
asked by anonymous 04.10.2016 / 14:16

2 answers

0

ControllerLogin.php

public function index(){
    return view('template.login-template');
}

routes.php

Route::get('login', 'ControllerLogin@index');

Access

link

    
04.10.2016 / 14:32
0

Try adding a forward slash at the beginning of the path:

routes.php

Route::get('/login', 'ControllerLogin@index');

I would advise you to enable Debug mode for more information about the error:

.env

APP_DEBUG=true
    
20.11.2016 / 19:08