I am a newbie of Laravel. I trying o learn it.
I got stuck in this.
I want to return in the routes.php a controller that returns a view. I have WelcomeController.php and welcome.blade.php and contact.blade.php.
That's my files
routes.php:
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
*/
Route::get('/', function () {
return 'WelcomeController@index';
});
Route::get('/contact', function () {
return "WelcomeController@contact";
});
WelcomeController.php :
<?php
namespace App\Http\Controllers;
use App\User;
use App\Http\Controllers\Controller;
class WelcomeController extends Controller
{
/**
* Instantiate a new controller instance.
*
* @return void
*/
public function index() {
return view('welcome');
}
public function contact() {
return view('contact');
}
}
?>
Where i am getting wrong ?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2ua796G
via IFTTT
Aucun commentaire:
Enregistrer un commentaire