Skip to content

Latest commit

 

History

History
76 lines (58 loc) · 2.61 KB

laravel_best_practices.md

File metadata and controls

76 lines (58 loc) · 2.61 KB
title author format
Laravel Best Practices
Vladimir Lelicanin - SAE Institute
revealjs
theme title-slide-attributes transition footer margin auto-animate preview-links link-external-newwindow scrollable embed-resources slide-level chalkboard multiplex slide-number incremental logo
default
data-background-image data-background-position data-background-repeat data-background-size
top left
no-repeat
100px
fade
Vladimir Lelicanin - SAE Institute Belgrade
0.2
true
auto
true
true
false
1
true
true
true
false

Laravel Best Practices

  • Use the latest version of Laravel to take advantage of new features and security updates
  • Follow PSR standards for coding style and structure
  • Use dependency injection and service providers to manage dependencies
  • Utilize Laravel's built-in authentication and authorization systems
  • Use Laravel's ORM, Eloquent, for database access

Documentation on Laravel's ORM


  • Write concise and descriptive controller methods
  • Use Route model binding to simplify controller actions
  • Use middleware to apply logic to incoming requests
  • Use validation to ensure input meets specific criteria
  • Use Laravel collections for complex data manipulation

Documentation on Laravel's middleware system


  • Optimize database queries by using eager loading and query caching
  • Use resourceful routing to generate consistent and predictable URLs
  • Use Blade templates for efficient HTML rendering
  • Use the @extends and @yield directives to create reusable view templates
  • Use the @component directive to create reusable components

Documentation on Laravel's Blade templating engine


  • Use queues to handle time-consuming tasks in the background
  • Store environment-specific configuration values in environment variables
  • Use Laravel's encryption features to securely store sensitive information
  • Use automated testing to catch bugs and ensure code quality
  • Continuously monitor and optimize application performance

Documentation on Laravel's queue system


References