Sling Academy
Home/PHP/Page 14

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,

Eloquent: Using Multiple Foreign Keys in a Relationship

Updated: Jan 17, 2024
Introduction When working with Eloquent in Laravel, forming relationships between tables is a key feature that facilitates the creation of elegant, highly readable, and efficient database queries. However, the need to define......

Eloquent issue: Adding ‘Unique’ constraint to a column with duplicate values

Updated: Jan 17, 2024
The Problem Adding a ‘Unique’ constraint to a column that already has duplicate data can be a common issue for developers using Laravel’s ORM, Eloquent. The ‘Unique’ constraint is a way to ensure that all......

Using ‘CASE WHEN’ in Laravel Eloquent

Updated: Jan 17, 2024
Overview In the world of web application development within the Laravel ecosystem, Eloquent stands as a robust Object-Relational Mapping (ORM) tool that simplifies the interaction with databases. A common necessity faced by developers......

Laravel Eloquent: How to Select Data with Raw SQL Queries

Updated: Jan 17, 2024
Introduction Laravel’s Eloquent ORM provides a beautiful, simple ActiveRecord implementation for working with your database. While this simplicity is one of Laravel’s strongest features, sometimes you may need to bypass the......

Laravel Eloquent: How to Add Index to a Column

Updated: Jan 17, 2024
Introduction Laravel’s Eloquent ORM is a powerful and fluent tool to interact with your database. Utilizing indexes is an essential part of optimizing database queries. This tutorial will guide you through the process of adding......

Laravel Eloquent: How to create ‘infinity scroll’ pagination

Updated: Jan 17, 2024
Introduction Laravel Eloquent makes handling database interactions seamless and simple. Adding a modern user interface feature like infinite scroll not only enhances the user experience by providing a smooth way to load data but also......

Laravel Eloquent: How to Implement Page Pagination

Updated: Jan 17, 2024
Introduction Laravel, a powerful and flexible PHP framework, is renowned for its elegance and a rich set of features that boost the productivity of developers. Among these features is Eloquent, Laravel’s own ORM......

Laravel Eloquent: How to Implement Case-Insensitive Search

Updated: Jan 17, 2024
Overview Laravel, the elegant PHP framework, is renowned for the elegance it brings to database manipulation through Eloquent ORM. One crucial feature commonly required in search functionalities is case insensitivity to provide a......

Laravel Eloquent: How to Implement Full-Text Search

Updated: Jan 17, 2024
Introduction Full-text search is a sophisticated way for querying database content beyond simple pattern matching. When incorporating this with Laravel’s Eloquent, it leads to a powerful mechanism for searching through large......

Laravel Eloquent: How to Compare Numeric/String Columns

Updated: Jan 17, 2024
Introduction In Laravel, the Eloquent ORM provides a convenient and fluent way to interact with databases. When working with data, you may often need to compare columns which can be either numeric or string types. In this tutorial,......

Laravel Eloquent: How to Alias a Column

Updated: Jan 17, 2024
Introduction Eloquent is the powerful ORM (Object-Relational Mapper) included with Laravel that provides a beautiful, simple ActiveRecord implementation for working with your database. When querying the database, you may sometimes want......

Laravel Eloquent error: A facade root has not been set (5 solutions)

Updated: Jan 17, 2024
The Problem Encountering errors in Laravel can be frustrating, especially when the error message is unclear or seems cryptic. One such common error that Laravel developers might face is the A facade root has not been set error. This......