Tag: code
-
Doubly Linked Lists – Data Structures in PHP
Reading Time: 10 minutes Read the previous article on Singly Linked Lists in PHP here! Read the starting post of the series here! All code in this series can be found on Github Doubly Linked List Principles Available Methods I took a decent amount of time to read through various array and list methods available to other languages like […]
-
Singly Linked Lists – Data Structures in PHP
Reading Time: 5 minutes All code in this series can be found on GitHub Linked Lists are where we start our journey in PHP Data Structures. Simply put, a linked list is data that is sequentially organized in which the start of the list (head) contains a reference to the next item (node) in the list. A one-way link […]
-
5 Tips to Simplify Laravel Code
Reading Time: 3 minutes 1. Simplify if/else statements When writing methods or functions that use if/else statements to check for a condition, we can clean up the function or method by using the shorthand version of a simple if/else like so: 2. Use Laravel’s exists() instead of count() to verify a model instance exists. When querying the database and […]
-
Single Responsibility Principle and Laravel
Reading Time: 9 minutes Developers across the industry are familiar with the Single Responsibility Principle, the idea that our classes, or our functions should have one and only one job to do. This idea helps us better document, understand, write, and update our own code as well as the code of a team member or open source project. The […]