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.composer require barryvdh/laravel-debugbar --dev
php artisan translations:check
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.
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
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
Published 2024-05-05
Laravel
Web development
Implementing a S3 bucket from Linode/Akamai in your Laravel application
Read the post →