Blog
Insights, guides, and best practices from the Laravel Company team.
Manually inject model relation using Eloquent
# Manually Injecting Model Relations Using Eloquent: A Developer's Guide As developers working with Eloquent, we are constantly seeking ways to optimize data...
Model::update() should not be called statically
# Model::update() should not be called statically: Understanding Eloquent Instance vs. Static Methods As developers working with the Laravel Eloquent ORM,...
How can I make laravel casting array on the model?
# Unlocking JSON: How to Make Laravel Cast Database JSON Columns to Native PHP Arrays As developers working with modern relational databases, storing complex,...
How to fix EOF Server Ollama Error when embedding
# How to Fix EOF Server Error When Embedding with Ollama in Laravel RAG Systems Building sophisticated Retrieval-Augmented Generation (RAG) systems using...
How to use DataTables with Laravel Vite?
# How to Use DataTables with Laravel Vite: Solving the `DataTable is not a function` Error As a developer working with modern stacks like Laravel and Vite,...
Remove a package using composer (without updating other packages)
# Safely Removing Composer Packages: How to Use `composer remove` Without Updating Dependencies As senior developers working with PHP ecosystems, we constantly...
How to get data of previous week in Laravel 5.1?
# Mastering Date Ranges: How to Get Data for the Previous Week in Laravel As developers, one of the most common tasks we face is manipulating time-series...
Filament v3 : relation Manager with hasMany and BelongsTo
# Filament v3: Mastering Relations Managers with `hasMany` and `BelongsTo` Welcome to the world of Filament! As you dive into building complex administrative...
Where can I set headers in laravel
Title: Setting Global Headers for All Views in Laravel Introduction: In your quest to set headers globally for all views within your Laravel application,...
Laravel Insert Seed if data doesn't already exist
# Laravel Seeding Masterclass: Inserting Data Only If It Doesn't Exist Is there any way to run a Laravel `seed` to only insert records if they do not already...
allow only requests from domain and block other sources
# Securing Your API: Allowing Requests Only From Your Frontend Domain As a senior developer, I frequently encounter scenarios where we need to protect...
laravel eloquent JOIN ON multiple condition
# Mastering Complex Data Aggregation in Laravel Eloquent: Joining and Summing Multiple Conditions As a senior developer, we constantly face the challenge of...