SlingAcademy

PHP

PHP is a popular scripting language for web development. It can create dynamic and interactive web pages by running on the server and sending HTML to the browser. It is free, fast, and flexible,

Using ‘RIGHT JOIN’ in Laravel Eloquent

Updated: Jan 18, 2024

Introduction Laravel Eloquent is a powerful ORM for PHP applications, providing an active record implementation. It enables developers to deal with database queries in an object-oriented manner. While Eloquent prefers the use of......

Using ‘LEFT JOIN’ in Laravel Eloquent

Updated: Jan 18, 2024

Introduction Laravel, the widely-celebrated PHP framework for web artisans, includes an elegant ORM (Object-Relational Mapper) named Eloquent. Among its features is the ability to construct efficient database queries using simple PHP......

Using ‘INNER JOIN’ in Laravel Eloquent

Updated: Jan 18, 2024

Overview Laravel’s Eloquent ORM provides an elegant and fluent interface to work with your database. Understanding how to use ‘INNER JOIN’ is essential if you’re dealing with relations between tables. In this......

Laravel Eloquent: ‘EQUAL’ and ‘NOT EQUAL’ operators

Updated: Jan 18, 2024

Introduction When it comes to web development with PHP, Laravel is one of the most popular and clean frameworks available today. Its Eloquent ORM provides an elegant and powerful ActiveRecord implementation to work with your database.......

How to disable/enable timestamps in Laravel Eloquent

Updated: Jan 18, 2024

Introduction Laravel Eloquent is a powerful ORM that simplifies data manipulation in database tables linked to your models. By default, Eloquent expects created_at and updated_at columns to exist on your tables, which it automatically......

How to optimize Laravel Eloquent queries (with examples)

Updated: Jan 18, 2024

Introduction Laravel’s Eloquent ORM is a simple yet powerful tool to interact with the database. However, without proper query optimization, you may run into performance issues as your application scales. In this tutorial, we’ll......

Laravel Eloquent: Storing arrays and nested arrays in database

Updated: Jan 18, 2024

Introduction Laravel Eloquent is an ORM (Object-Relational Mapping) that makes it incredibly easy to interact with a database. When working with Eloquent, developers are primarily dealing with model instances which correspond to rows......

Laravel Eloquent: attach(), detach(), and sync() methods

Updated: Jan 18, 2024

Overview Working with Laravel’s Eloquent ORM (Object-Relational Mapping) makes dealing with database relationships simple and elegant. Among the many powerful methods it provides for interacting with related models, particularly......

Laravel Eloquent: Using ‘LIKE’ and ‘NOT LIKE’ operators

Updated: Jan 18, 2024

Introduction Laravel’s Eloquent ORM is a powerful tool that makes database operations a breeze. When it comes to building queries, there are times when we need to implement search functionality or simply filter results based on......