Useful Laravel packages

5 May 2024

This post is dedicated to all the useful Laravel packages that are out there. I only knew a few, but the ones I know make my life as a programmer much easier. Besides the list here I can recommend checking out laravel-package-ocean.com for nifty packages.

During development

These are a collection of packages that make your life as a developer much easier when developing a web application.

Laravel debugbar

Laravel debugbar is an absolute must-have for developers when developing Laravel projects. The debugbar is a package that provides an interactive debugging toolbar. It displays information about the application such as request, response data, database queries, routes, views, runtime and more. The debugbar allows developers to quickly identify and fix issues in their applications. I can't imagine making a Laravel project without it. Install it with this command:
composer require barryvdh/laravel-debugbar --dev

Localization

The documentation regarding localization in Laravel is pretty good. However it does have some shortcomings, where the Laravel Localization package from mcamara can shine. The package offers amongst other things the following:

Translations

Easily check if you have missing translation with the Laravel translations checker. When installed simply run the following to see the missing translations:
php artisan translations:check

Sitemap

For a sitemap I much prefer Spatie's Sitemap-package. Install it like this:
composer require spatie/laravel-sitemap
The sitemap can then be generated with the code below. It crawls my website to a depth of 3 page jumps and adds all the found URLs to an XML-file in the correct format and then redirects to the generated file. Easy.
use Spatie\Crawler\Crawler;
use Spatie\Sitemap\SitemapGenerator;

SitemapGenerator::create(route('frontpage'))
    ->configureCrawler(function (Crawler $crawler) {
        $crawler->setMaximumDepth(3);
    })
    ->writeToFile(public_path('sitemap.xml'));
return redirect(asset('sitemap.xml'));
It may be a good idea to cache the operation.

Validation

Captcha

You can't really have a form online without eventually getting spammed through it. Therefore captcha quickly becomes a requirement. I have had great experience with the Captcha-package from Mewebstudio.

You might also enjoy

The Seven Restful Controller Actions in Laravel

The Seven Restful Controller Actions in Laravel

Published 2024-05-05 — Updated 2024-05-16

Laravel

PHP

Web development

The seven RESTful actions and how you could implement them in Laravel

Read the post →
Getting title tag and meta tags from a website using PHP

Getting title tag and meta tags from a website using PHP

Published 2024-05-14

PHP

Web development

Learn how to easily webscrape title and meta tags from a website using simple PHP commands.

Read the post →
Using Linode/Akamai for your S3 storage in Laravel

Using Linode/Akamai for your S3 storage in Laravel

Published 2024-05-05

Laravel

Web development

Implementing a S3 bucket from Linode/Akamai in your Laravel application

Read the post →