Blog

Page 287 of my articles, tutorials, and thoughts

Latest Articles

Cover Image for Laravel Eloquent update just if changes have been made

Laravel Eloquent update just if changes have been made

Published on September 2, 2023

# Updating Laravel Eloquent Models Only When Changes are Made 😮💾 Do you ever find yourself continuously hitting that save button, even when no changes have been made to your record? 🔄 Don't waste your precious server resources on unnecessary database r

Cover Image for How can I rename a field for all documents in MongoDB?
mongodb

How can I rename a field for all documents in MongoDB?

Published on September 2, 2023

# Renaming a Field for All Documents in MongoDB: A Simple Guide 😎 So, you've got a MongoDB collection with a bunch of documents, and you want to rename a field in all of them. It may seem like a daunting task, especially if you have thousands of records.

Cover Image for Preventing Laravel adding multiple records to a pivot table

Preventing Laravel adding multiple records to a pivot table

Published on September 2, 2023

# 🛡️ Preventing Laravel Adding Multiple Records to a Pivot Table 🛡️ So, you've encountered a common issue when dealing with many-to-many relationships in Laravel. It's frustrating when the user accidentally adds duplicate entries to the pivot table 😫.

Cover Image for Truncate string in Laravel blade templates

Truncate string in Laravel blade templates

Published on September 2, 2023

# Truncate Strings in Laravel Blade Templates: A Handy Guide 🎯 Are you tired of dealing with long strings in your Laravel Blade templates? Do you wish there was a simpler way to truncate them without getting tangled in PHP code? 🤔 Well, you're in luck!

Cover Image for Laravel: Validation unique on update
validation

Laravel: Validation unique on update

Published on September 2, 2023

👋 Hey there, tech enthusiasts! 🖥️ Are you a Laravel developer struggling with the validation unique on update issue? 🤔 Don't worry, you're not alone. Many developers have faced this common problem but found it hard to figure out how to pass the ID when

Cover Image for Get only specific attributes with from Laravel Collection

Get only specific attributes with from Laravel Collection

Published on September 2, 2023

📢 Hey there, Laravel enthusiasts! Are you struggling to retrieve specific attributes from a Laravel Collection? Don't fret, I've got you covered! 🤩💪 So, you want to fetch an array with model data from a collection, but only extract the attributes that

Cover Image for Should i use belongsTo or hasOne in Laravel?

Should i use belongsTo or hasOne in Laravel?

Published on September 2, 2023

# 🚀 The Ultimate Guide: belongsTo vs hasOne in Laravel 🚀 Are you feeling confused about whether to use `belongsTo` or `hasOne` relationships in Laravel? Don't worry, we've got you covered! In this guide, we will provide you with a clear explanation of t

Cover Image for Lumen: get URL parameter in a Blade view

Lumen: get URL parameter in a Blade view

Published on September 2, 2023

# 🌟 How to Get URL Parameters in a Blade View in Lumen 🌟 Are you having trouble retrieving URL parameters within a Blade view in your Lumen application? Don't worry - we've got you covered! In this guide, we'll walk you through common issues, provide ea

Cover Image for laravel 5 : Class "input" not found

laravel 5 : Class "input" not found

Published on September 2, 2023

📝🤔⚡ Laravel 5: Class 'input' not found ⚡🤔📝 So, you're working on a Laravel 5 project and you encountered an error that says "Class 'input' not found" 🤔. Don't worry, I've got your back! In this blog post, I will address this common issue and provide

Blog | Matheus Mello