Laravel replicate(): Duplicate Eloquent Models Safely
"Duplicate this" buttons look easy: copy the row, save it, done. Then the first copy fails with a...
Author
@dasunG · 156 articles
Laravel specialist with 5+ years of experience crafting scalable, high-performance web applications. Passionate about clean code, RESTful API design, and performance optimization. Active contributor to open-source Laravel packages and a strong advocate for PHP best practices. Dedicated to turning ideas into robust digital solutions — let’s build something amazing together!
"Duplicate this" buttons look easy: copy the row, save it, done. Then the first copy fails with a...
The easiest Laravel API is one line: return User::all();. Eloquent turns the models into JSON for you. That...
A critical vulnerability in Laravel's built-in token API guard lets an unauthenticated visitor log in as an existing...
Here is a bug that passes every test until a user without a profile picture shows up. You...
Sooner or later every JavaScript developer copies an object, changes the copy, and finds the original changed too....
On 21 October 2026 the PHP project released security updates for every supported branch, and the front page...
Here is a small surprise in Laravel validation. The integer rule passes the string "10". For a form...
Some Laravel features are famous, and some sit in the docs for years while people write the same...
You create a model, and one of its columns is calculated by the database: a full name built...
Most Laravel apps talk to one database and never think about connections. Then a reporting database shows up,...
Every Laravel model quietly fills in created_at and updated_at, and most of the time that is exactly what...
When a Laravel page or job feels slow, the database is the first suspect, and usually the right...
We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.