• Introduction
    • Security and Updates
    • Introduction
    • Final Thoughts
    • Introduction
    • Single Responsibility Principle
    • Open Closed Principle (OCP)
    • Liskov Substitution Principle
    • Interface Segregation Principle
    • Dependency Inversion Principle
    • Final Thoughts
    • Introduction
    • Variables
    • Comparison
    • Functions
    • Objects and Data Structures
    • Classes
    • Tests
    • SOLID
    • DRY principle
    • Imports
    • Final Thoughts
    • Strategy
    • Facades
    • Eloquent Models
    • Elequent Factories
    • Artisan Commands
    • Controllers
    • Requests & Responses
    • Routing
    • Authorization
    • Middleware
    • Validation
    • Views
    • Translations
    • Exceptions
    • Jobs
    • Events
    • Configs
    • Migrations
    • Security
    • Files & Disks
    • Tests
    • Services
    • Final Thoughts
    • Naming
    • TL;DR
    • Final by default
    • Strict types
    • Typed Properties
    • Void return types
    • Doc Blocks
    • Generic types and templates
    • Strings
    • Comments
    • Classes
    • Type-casting
    • Named constructors
    • Domain-specific operations
    • assert() vs throw
    • Regex
    • Final Thought
    • Introduction
    • Routing
    • Controllers
    • Authentication
    • Versioning
    • Introduction
    • Indices
    • Introduction
    • Gitflow
    • Final Thoughts
    • Resources

Facades

Facades vs Facade aliases vs. helper functions

Facades SHOULD be used in PHP code, helpers SHOULD be used in Blade views. Don’t use Facade root aliases (it’s extra magic that’s easy to avoid).

Edit this page on GitHub
LaravelStrategy
LaravelEloquent Models

Powered by Docus