Resource在設(shè)置路由控制器上比較便捷,雖然失去了一些自由度,選擇與否根據(jù)具體情況而定.
路由:
image.png
控制器:
默認(rèn)生成的public方法有:
index(),create(),store(),show(),edit(),update(),destroy()
默認(rèn)
命令:
image.png
php artisan make:controller xxxxx/xxxxx --resource --model=xxxx\/xxxx/\xxxx