Not so Static Assets with Laravel

Handling Laravel routing in ReactPHP, I missed a particular use case: managing the assets usually sitting in the public/ folder. Publishing a regular application with a regular web server it takes care to directly fetch and serve the files from the filesystem, but wrapping the application into a ReactPHP loop…

Routing ReactPHP with Laravel

As previously mentioned, I'm actually playing with asyncronous PHP and I'm trying to combine ReactPHP (which is the most popular framework for this kind of tasks, in PHP) and Laravel (which is the most popular "classic HTTP syncronous" framework).Today's challenge: run a ReactPHP HTTP Server, but still leveraging the…

Teaching Moodle to Laravel

I had to integrate a Laravel application with a Moodle instance: certain users, under given circumstances, may generate a new course in Moodle, be enroled as teacher, and add other platform's users as students.The first step has been to setup a unified authentication, implementing a OAuth2 server in Laravel…

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…