前回に引き続きLaravel5.1の中級者向けタスクリストをLaravel5.6でやっていく。
こちらは量が多いので関数の変更等目立つ差分だけ抽出して書く。
データベースの準備
Eloquentリレーション
User
モデルのextends以降が随分違うが、extends Authenticatable
のままでいいっぽい。
app/User.php
class User extends Authenticatable{
// ほにゃらら
}
ルーティング
認証
認証周りはサクッと生成してしまう。
php artisan make:auth
gitで生成後の差分はわかるので、それを写経すると勉強になりそう。
タスク削除
ルートモデル結合
app/Providers/RouteServiceProvider.php
parent::boot();
Route::model('user', App\User::class);
https://readouble.com/laravel/5.6/ja/routing.html
の明示的な結合
項を参考に。
参考
https://readouble.com/laravel/5.1/ja/quickstart-intermediate.html
https://readouble.com/laravel/5.6/ja/authentication.html
https://readouble.com/laravel/5.1/ja/authentication.html
https://readouble.com/laravel/5.6/ja/container.html
https://readouble.com/laravel/5.6/ja/routing.html