Laravel 5.8 設定編 CRUD作成など
■ 概要:
Laravel 5.8 インストールや、CRUD作成など
となります
■ 環境
php7.3
Laravel 5.8
mysql
■ 画面
・リスト
・編集
■ 参考サイト様
https://qiita.com/moyashimanjyu/items/17ffe537fd37cccf00c0
■ 参考のコード
■ laravel 追加など
php composer.phar create-project --prefer-dist laravel/laravel lara58a "5.8.*"
helper:
php composer.phar require laravelcollective/html "5.8.*"
serve起動
php artisan serve
http://localhost:8000 で、画面起動できました。
■ CRUD 追加
・mysql /表の作成
tasks , migrations の追加
https://github.com/kuc-arc-f/lara58a/blob/master/database/migrations/2019_12_01_081526_create_tasks_table.php
model
https://github.com/kuc-arc-f/lara58a/blob/master/app/Task.php
blade:
create
https://github.com/kuc-arc-f/lara58a/blob/master/resources/views/tasks/create.blade.php
Controller:
create / store
https://github.com/kuc-arc-f/lara58a/blob/master/app/Http/Controllers/TasksController.php
・ルーティング
https://github.com/kuc-arc-f/lara58a/blob/master/routes/web.php
Route::resource('tasks', 'TasksController');
■ artisanコマンドメモ
・サービス起動
php artisan serve
・migrate実行
php artisan migrate
・migrate ファイル作成
php artisan make:migration create_tasks_table --create=tasks
・ルーティング表示
php artisan route:list
・Controller追加
php artisan make:controller TasksController
・model 追加
php artisan make:model Task
・auth追加
php artisan make:auth
ここから先は
Laravel 5.8 や、Vue.js開発の事例、開発ノウハウに関する記事を集めました。第1回目, ■ 免責事項 / 注記, 内容につ…
この記事が気に入ったらサポートをしてみませんか?