学習記録
2020-08-09に更新

調べたこと

数日ぶりにLaravelの勉強を再開した時に調べたこと。

プロジェクトについてLaravelのバージョンを確認

composer.lockの下記の記述を確認する。

"name": "laravel/framework",
"version": "v7.20.0",

参考:How to know Laravel version and where is it defined?

モデルで該当テーブルのレコードを全件削除

> App\Article::truncate();

参考:How to delete all the rows in a table using Eloquent?

Laravel From Scratch

https://laracasts.com/series/laravel-6-from-scratch/episodes/32?autoplay=true

つまずいた点

URLに「?tag=personal」と書いても404が返ってくるので、@forelseで実装しした結果を確認できない。

参考

コメントに
「it gave you 404 because the name that you used is not inside the tag table in the database if you try "personal" which Jeffrey used you will get the same result result because personal is a tag that is in the database but it not linked to any article.」
とあるように、
tagsテーブルに存在する名前をクエリで指定したところ再現できた。


dychw
学習記録
所有者限定モードのためこのボードには投稿できません
コメント
学習記録