12 Laravel/PHP Tips in 8 Minutes: August 2024

  • Run a select statement before any delete or update statement in SQL to avoid updating or deleting wrong records.
  • Use the DNS validation rule in Laravel to filter out fake email addresses.
  • Use the explode PHP function to specify the first variable or a list of variables you're expecting from the explode.
  • Debug slow queries and double check your loops to improve Laravel performance.
  • Use DD row SQL for debugging purposes in Laravel 10.
  • Add model should be strict in the app service provider to prevent lazy loading and other issues.
  • Use the PHP function class uses to check if a specific trait is enabled on a specific model.
  • Use the filter VAR method in PHP to validate URLs and add https prefix if it doesn't exist.
  • Be careful with tutorials that are not from trusted sources or generated by AI.
  • Read the recap of everything that was said by Taylor Otwell at Laracon US 2024.

via 12 Laravel/PHP Tips in 8 Minutes: August 2024