Introducing: Larastrap

At least one year ago I realized that my main open source project (GASdotto: a management application for Purchasing Groups built with Laravel) was stuck on Bootstrap 3, while Bootstrap 4 was been around for a while and Bootstrap 5 was already been announced.So I wanted to upgrade the…

Boostrap Custom Display

Trying to format a Bootstrap table for decent display on mobile screens, I wanted to hide the thead element below a certain breakpoint. I used the d-none d-md-block combo, then I realized that normally a thead should be in display: table-header-group. And there is no d-table-header-group rule in Bootstrap...I…

The Ultimate Data Source

"Ehi! Two years ago many municipalities in Italy have been suppressed, created and merged! I need to update the database for a customer of mine, who didn't found one of them! Let's look for an updated CSV!"And, of course, I found nothing. At least nothing usable in my own…

Cutting Eloquent Models with Blade

If you already tried to do something with Blade Components in Laravel, probably you already stumbled upon the many limitations of the subsystems.Among the many, the latest - and most disappointing - I've found is that seems not possible to pass an Eloquent instance as attribute to a component:…

Lazy Async Jobs

UPDATE: I've just published a package on Packagist to manage Asyncronous Jobs over HTTP requests.I have a Laravel application sendings a lot of mail notifications when certain operations are done, so I wanted to delegate mail sending to a Queue to avoid to the users long waits for the…

Dynamic Global Scope

I have an application which usually handles, on the same instance, different groups of informations isolated by context: each user is assigned to one of the contexts, many users act inside the same context, when a user logs in all the managed data are relative to his own context. This…

PeerTube Direct Links

A note for future self: as the web interface of PeerTube do not exposes any direct link to access the raw video files it hosts (but only a link to the embeddable own player, which may be unconvenient in many situations), a bit of hack is required.Given that a…

Pushing into the Rocket

A Rocket Chat instance, the same 60 users already pushed into a PeerTube instance, and poor will to understand the too much complex native feature to import by CSV.Let's write another script (very similar to the PeerTube's one...):<?php require_once('vendor/autoload.php'); use GuzzleHttp\Client; $endpoint…

Pushing into the Tube

A PeerTube instance, 60 users to create, and an import feature not yet implemented. But a suggestion: "You can easily develop a script that create these users via API call".Here, my script:<?php require_once('vendor/autoload.php'); use GuzzleHttp\Client; $endpoint = 'https://my.peertube.server/api/v1/…

Laravel Infinite Scroll

I needed to quickly implement a very simple infinite scroll behaviour on a very simple page. Due laziness I got a look for any dirty hack suggested by random people on the internet to do that in Laravel, ready to be copied and pasted; I found a method using jScroll…