In this video, we will be looking at complete detail of Laravel Eloquent Api Resource. I will walk you through the documentation and show you each and every part of it. When building an API, you may need a transformation layer that sits between your Eloquent models and the JSON responses that are actually returned to your application's users. For example, you may wish to display certain attributes for a subset of users and not others, or you may wish to always include certain relationships in the JSON representation of your models. Eloquent's resource classes allow you to expressively and easily transform your models and model collections into JSON. The above description is from Laravel's documentation. === OFFER === GET 30% DISCOUNT ON ALL PLANS OF CLOUDWAYS HOSTING FOR 3 MONTHS https://unified.cloudways.com/signup?id=1029148&coupon=CW30FOR3 ================== Honeybadger ================== Track errors, up-time, deployments, etc in your production app/website with Honeybadger in real-time. For full detail, plz check the link below. https://bit.ly/3dvqLfb === Video Related Links === Laravel Documention link: https://laravel.com/docs/9.x/eloquent-resources Ecommerce Project - Playlist https://www.youtube.com/playlist?list=PL2DahmvUpeus118wGxq8a9o-Guo4JSGg7 00:00 Intro 00:29 Introduction 01:12 How to create a resource 02:43 Using the resource 03:57 Modifying the user resource 05:40 Making resource collection 07:07 Using the resource collection 08:37 Preserving keys 09:55 Customizing underlying resource class 11:29 Showing relationship 15:14 Data wrapping 18:31 Conditional Attributes 19:20 Showing single data conditionally 23:08 Showing multiple data conditionally 26:11 Conditional relationship counts 28:04 Conditional pivot relationship 30:09 Adding meta data 36:06 Response headers 36:38 Finalizing === Other Videos === What's New In Laravel 9 https://youtu.be/qAzrZUG_9Z0 New In Laravel Playlist https://www.youtube.com/playlist?list=PL2DahmvUpeuu4UVWrcxlvVkMiI0SeS2OZ Laravel Package Development Playlist https://www.youtube.com/playlist?list=PL2DahmvUpeuu8HkpbNT-cKernolVdqZq_ Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols: https://youtu.be/f-g3P9imPZs Multiple Apis With ForwardsCalls Trait And Code Refactoring Tip - Laravel Hidden Feature: https://youtu.be/vzgNm86ezWE Laravel Chunking - You Might Be Doing This Wrong - Problem and Solution: https://youtu.be/aQCHmB4Uh0Q Laravel Tip - Properly Get Data Between Two Dates https://youtu.be/bJkEBTg1NGA Get Data From Multiple Databases In One Project | Laravel Tip https://youtu.be/KJAXLf78QPs === Theme and Font Used === Theme: Cobalt2 Theme Official (https://marketplace.visualstudio.com/items?itemName=wesbos.theme-cobalt2) Font: JetBrains Mono (https://www.jetbrains.com/lp/mono/) === Tech stack === Laravel PHP #laravel #php #laraveltip #laratips

Laravel Performance Hack: Process Huge CSVs 3500x Faster!
2.6K views

Refactoring Laravel Blade Components | Eliminate Duplicate Scripts & Styles
591 views

Episode 6 - Laravel Deploys Made Safe - Staging First Workflow
299 views

Weekly Laravel Updates - Episode 4
187 views

Episode 5 - Making Reminder Emails Faster - Queue Processing with Supervisor
279 views

Episode 4 - Automatically Sending Reminder Emails - Cron Jobs
538 views