<?php
// 編集前
/*
|--------------------------------------------------------------------------
| Web Routes
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
*/
Route::get('/', function () {
return view('welcome');
});
# 編集後
Route::get('/', 'AttendancesController@index')->name('home');
$ php artisan make:controller AttendancesController
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AttendancesController extends Controller
{
//
}
// 編集後
public function index()
1. ホーム画面のrouting設定
<?php
// 編集前
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/
Route::get('/', function () {
return view('welcome');
});
<?php
# 編集後
Route::get('/', 'AttendancesController@index')->name('home');
$ php artisan make:controller AttendancesController
<?php
// 編集前
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AttendancesController extends Controller
{
//
}
<?php
// 編集後
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class AttendancesController extends Controller
{
public function index()