Mohamed Said's Journal

Web Developer, cyclist, and freediver.
Posted on August, 20 2018

I Broke My Collarbone... Here's The Story

On July 22nd, I took my bike out for a ride, crashed 5 minutes away from home and broke my right collarbone. I wasn't doing anything special; just riding downhill on a paved road and all.It all happened so quickly. I only remember pulling the brakes to slow the bike......

4 mins Read Read Full Post
Posted on April, 15 2018

My money dilemma

My father made terrible money mistakes in the past, my nightmare is that I’ll end up making the same mistakes because I generally think like him.Don’t get me wrong, I think my father is great, in fact my dedication at work is only because it’s one thing he has been......

1 min Read Read Full Post
Posted on September, 21 2017

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......

2 mins Read Read Full Post
Posted on August, 9 2017

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 all that's in the memory, for some applications it's ok to lose these data in case of crash, but for other apps it's important to......

2 mins Read Read Full Post
Posted on May, 16 2017

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 purchase or a welcome email on user signup, and to do this we need to listen to that event like so:class EventServiceProvider extends......

1 min Read Read Full Post
Posted on May, 5 2017

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 that customers who make purchases above 10K should receive a gift coupon, let's see how we can implement such thing in laravel:On every new purchase......

1 min Read Read Full Post
Posted on January, 18 2017

How losing hope is one way of getting better

Last year I realised that losing hope isn’t a bad thing:People think it’s shameful to lose hope, I learned that the sooner you lose hope the better, losing hope means you start considering alternatives & deploying your negative energy toward something useful. The most important thing though is to try......

1 min Read Read Full Post
Posted on July, 9 2016

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......

1 min Read Read Full Post
Posted on April, 25 2016

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....

1 min Read Read Full Post
Posted on April, 9 2016

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 with the user via questions, most of the tutorials and blog posts I found online were just calling the command and passing arguments/options using the......

7 mins Read Read Full Post
Posted on March, 11 2016

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....

2 mins Read Read Full Post
Posted on February, 6 2016

Eliminate the noise & hear the little voices

I always believe in letting my product do the talking, I find myself unable to express what I’ve been doing or am doing, during meetings I’m the one who has nothing to say about productivity/progress/achievements and all these shiny words.My father used to say “Those who do, never speak; and......

1 min Read Read Full Post