ルーティング(web.php)
/アプリ名/routes/web.php
取得するパスは【/sample_action】で、SampleControllerのsampleActionというメソッドを利用する
<?php
Route::get('/sample_action', 'SampleController@sampleAction');
ルートパスを指定
<?php
Route::get('/', function () {
return 'シンプルなルーティング!';
});
ルートパス/other/のパスを指定
<?php
Route::get('/other', function () {
return 'ここは/otherです。';
});
/アプリ名/resources/views/samples/blade_example.blade.phpのパスを指定
<?php
Route::get('/blade_example', function(){
return view('samples.blade_example');
});
blade_example/パスを指定する
resources/viewディレクトリの
samplesディレクトリの
blade_example.blade.phpファイル
が呼び出される