Back

Hey Laravel Developers

Laravel provides the Model class, which all your application models inherit from by default.

However, a general pattern I like to follow is inheriting the Model class into App\Models\Model and then having my application models extend this new model.

One major benefit of this approach is that I can define global scopes in App\Models\Model, such as active(), published(), and others, which will be available across all models for usage.

image

29

  • No matching results...
  • Searching...

/ 1000