Laravel Broadcasting Unveiled

The documentation page about broadcasting events in Laravel to a websocket client is a bit obscure: if you use the Pusher third-party service it will eventually work out-of-the-box (I don't know, haven't tried), but if you choose to setup your own websocket server you will find yourself looking for hints…

Message in a Phone

I had to integrate SMS notifications in a project for a client, got a look to the API documentation of Skebby (SMS service popular among Italian developers), and started wondering about a Laravel package to integrate it into the native notifications system of the framework. More recently, another client asked…

Play it Again, SAML

I had to integrate SAML authetication on a Laravel application, so I composer required the laravel-saml2 package (actually, the remove_mcrypt branch. You know: mcrypt has been dropped in PHP 7.2...) and configured it to attach to the SimpleSAML-PHP instance I recently deployed. Of course nothing worked out of…

Social Logout

Again about the Laravel application involving Google login: it is often used on computers shared among many people, and logging on Google involves that all of the services are then enabled and accessible from that computers. Mostly undesiderable, of course. Socialite logout do not implies Google logout, nor any form…

Update my Models

Today I've discovered a particular behaviour of Laravel models' events handling: the updating event is not fired if the object's attribute have not been really modified. More specifically, if isDirty() returns FALSE. So, your Model::updating() callback is not really executed for each save() on an existing model, but only…

Falling in a Dot

After many hours debugging a Laravel application, I've found the issue. The Request object handles input arrays using a so called "dot notation", to permit you to directly access structured informations in the form of $name = $request->input('products.0.name'); That's really cool. Until you don't…

Get Informed by Troubles

Today I opened the logs of a Laravel application of mine, publicly available. And found lots of exceptions. Quickly, I realized those were generated by a new user trying to do stuffs no one ever tried (and no one ever noticed as failing). Once the issues were fixed, I decided…

Multilaravel

I have a Laravel application with a few dependencies, but it is enough to require almost 200MB on disk. I suppose this is the price for convenient dependencies installation and upgrade... This application has to be hosted in multiple instances, but it seems not a viable solution to duplicate everything…

Diving into Laravel Password Reset

Laravel provides out-of-the-box users management, handling authentication, password recovery, authorization and much more. But to work it expects some preconditions, and if you violate those preconditions you have to manually re-wire many things. The precondition I've violated today is that users have not a single associated email address, but many…

Laravel Dynamic Mail Configuration

Use case: from a Laravel application, use a dynamic (database driven) configuration for sending mails. Eventually, different for each user which is actually logged in. Everywhere on the internet you find references to this thread on a forum, raccomanding to load the configuration and create a new Mailer to overwrite…