Laravel API+Vue Code Review: 12 Things I’ve Noticed

Today we’re doing a code review on a repository sent by one of my followers. It’s mostly about Laravel API and the things I have found that could be improved. 00:00 Intro and General Project Structure 04:24 Gates, 403s and Message Customization 07:38 Global API Controller for Responses 08:35 API Resource, Accessors, and Scopes 10:33 Avoid unnecessary variables 10:58 API Pagination 11:51 Route Model Binding and Catch 404 13:51 Create/Update Request: Refactoring 15:49 Eloquent: Don’t Load Too Much Data 17:12 Inconsistency in the Code 19:10 auth()-user() Object 20:44 Inconsistency Again? Related links: - Laravel accessors and mutators: - Laravel Vue Pagination: - Danger of Using $request-all(), and How to Protect - - - - - Support the channel by checking out our products: - Try our Laravel QuickAdminPanel: - Enroll in my Laravel courses:
Back to Top