Laravel

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?

Published 2 months ago | Updated 2 months ago

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?

Published 2 months ago | Updated 2 months ago

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?

Published 4 months ago | Updated 4 months ago

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.

Published 5 months ago | Updated 5 months ago

Manually Refreshing a Livewire Component

Livewire provides a clean API for automatically polling and refreshing a component, but what if you want to manually refresh a component?

Published 5 months ago | Updated 5 months ago

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".

Published 6 months ago | Updated 1 month ago

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.

Published 7 months ago | Updated 6 months ago