Laravel
Laravel Seeders on Steroids
Seeders are a great way of creating fixture data, as well as dummy data, for your development environment. Let me show you how we can make them even better.
Delete All Rows for a Laravel Model
Let me show how to quickly delete all rows for a Laravel model.
Unconventional Laravel: Middleware-as-a-Service-Provider
Have you ever used a service provider to set a default value for a third-party library? Have you ever done this based on the current request or URL? Have you ever considered doing this inside of middleware instead?
Unconventional Laravel: Custom Pipeline Classes
Laravel makes use of the internal Pipeline
class and it's more common in userland too, but have you ever considered tidying up these pipeline processes with custom pipeline classes?
Unconventional Laravel: Route groups and `$router`
When registering grouped routes using Route::group()
, it's normal to register those nested routes using the Route
facade, but have you ever used the $router
variable?
Unconventional Laravel: Synchronous jobs for reusability
Code reusability is a big thing to consider when working on larger applications, but have you ever considered using synchronous jobs?
Unconventional Laravel: Auto-validating models
Join me as I go through some strange and unconventional things that you can do in your Laravel applications, starting with auto-validating Laravel models.
Add Classes to Active Link in Laravel
Adding a class to make the current page "active" in your application's navigation is a simple UI improvement. Let me show you how I typically do this in my apps.
Simple Repositories in Laravel
Abstracting common queries in your Laravel applications can be done in many ways. Let's take a look at the simplest way using the "Repository pattern".
Track Your Users Last Activity in Laravel
It's quite common to keep tabs on when an authenticated user last used your web application. The information can be really useful when calculating software adoption, usage frequency and return rate.
Prevent Updating or Saving of Laravel Models
Recently I've needed to disable particular methods and mutations on my Laravel models.