Mohamed Said's Journal

Web Developer, cyclist, and freediver.

Posts in: Code

Posted on August, 25 2018 - 1 min Read

Testing Artisan Commands in Laravel 5.7+

Laravel 5.7 comes with a pretty neat way for testing console commands. Let's see what our tests might look like.

Better 404 responses using Laravel 5.5+

Laravel 5.5.10 is shipped with two useful router methods that'll help us present better 404 pages for our users...

Posted on Sep 21, 2017 - 2 mins Read

Persisting Redis data on disk

Redis data lives in memory, that makes it is very fast to write to and read from, but in case of server crashes you lose...

Posted on Aug 9, 2017 - 2 mins Read

Using Laravel Mailables and Notifications as Event Listeners

Most of the time we send alerts to our app users when a specific event happens, for example we send an invoice on a new...

Posted on May 16, 2017 - 1 min Read

Conditionally pushing event listeners to queue

Here's the situation, you're building an online store that should handle thousands of orders every day, one of the cool things about this store is...

Posted on May 5, 2017 - 1 min Read

Laravel/MySQL JSON documents faster lookup using generated columns

laravel 5.3 is shipped with built-in support for updating and querying JSON type database fields, the support currently fully covers MySQL 5.7 JSON type fields updates and lookups, this allows us to have the following...

Posted on Jul 9, 2016 - 1 min Read

Conditionally adding instructions to laravel's query builder

How to conditionally push extra instructions to the query builder using the same fluent syntax that you love.

Posted on Apr 25, 2016 - 1 min Read

Building and testing Artisan Commands

While building the Laravel Langman package I was facing some difficulties trying to figure out how to test a console command that interacts...

Posted on Apr 9, 2016 - 7 mins Read

MySQL JSON data type decoded

In this post we are going to explore the new MySQL 5.7 JSON Data Type. While diving into the topic we are going to use Laravel's fluent query builder.

Posted on Mar 11, 2016 - 2 mins Read

Built Using Wink