Johnathan Smith

Full Stack Laravel Developer + Consultant

Tag: Php

Level Up Your Arrays Using Objects

Level Up Your Arrays Using Objects

Objects as Containers for Easier Array Work

This is an optional technique that comes in handy when doing processing of arrays that may contain a lot of keys and is used for information storage or manipulation. We can refactor for better and easier understanding of code.

Limit Code Evaluation and Expressions in Your Blade Templates and Files

Limit Code Evaluation and Expressions in Your Blade Templates and Files

Remove these mistakes from your view files

Beginners often clog up their Laravel blade files with unnecessary "ifs", functions, variable assignments, and a host of other issues. We'll dive into why it's bad and how we can fix it.

The Single Best Tip for Writing Unit Tests

The Single Best Tip for Writing Unit Tests

The Anti-Zoolander Center for Developers Who Can't Test Good

A unit testing tip that will save you tons of time and effort inspired by Zoolander.

Laravel Commands Different Output Methods and Styles

Laravel Commands Different Output Methods and Styles

What Do They Each Look Like?

There are five command output methods. What do they look like in the CLI?

Stop Hardcoding Variables - Tricks to Avoid It

Stop Hardcoding Variables - Tricks to Avoid It

Avoid these beginner mistakes.

A mistake I see in a lot of beginner devs is hardcoding variables inside your code. This is not a good practice, and I see it all too often. Let's fix that and make our code cleaner.

Laravel Exceptions - Forwarding on Errors

Laravel Exceptions - Forwarding on Errors

Automatically Redirect the User When Thrown

Did you know that you can auto-forward on exception? Laravel makes this process incredibly simple and easy. An extremely useful trick!

Decorators and Laravel Pipelines with Multiple Parameters and Constructors

Decorators and Laravel Pipelines with Multiple Parameters and Constructors

An Alternative and Testable Way to Mutate Data with Laravel's Service Container

A Laravel specific trick sequentially manipulate data. Allows for testable pipelines that utilize the service container and multiple parameters and constructors.