使用篇-基於Laravel開發部落格應用系列——後臺文章增刪改查功能實現(支援Markdown)

kim@chan發表於2016-12-27

如果出現

call to undefined method IlluminateDatabaseQueryBuilder::lists()

這個錯誤,是因為5.3中Builder中的lists方法換了個名字pluck(),

所以把Jobs/PostFormFields.php中的lists()方法換為pluck()方法就好了。

另外就是post/create.blade.php 和post/edit.blade.php 檢視中的路由器使用的是route(`admin.post.store`)這種形式寫的,實際上web路由中並沒有對應的名字,所以還是換為admin/post這樣的寫法比較好,也不會再報錯了。

在5.3裡執行php artisan make:job

檔案裡會有implements ShouldQueue,這個要刪掉,否則會報錯。實際上教程裡也沒有implements 佇列相關的東西。


參考教程:http://laravelacademy.org/post/2358.html


相關文章