Рет қаралды 17,391
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 ===
Laravel Hosting: platform.cloudways.com/signup...
Get up to Free Hosting by using code "LARATIPS" and you get $15 as credit which can last almost a month.
Cloudways offers peace of mind and flexibility so you can focus on growing your business and reaching new milestones instead of dealing with server management. With Cloudways, you get an optimized stack, managed servers, backups, staging environment, integrated Git, pre-configured, Composer, 24/7 support, and the choice of five cloud providers: AWS, DigitalOcean, Linode, Google Cloud, and Vultr
================== 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.
bit.ly/3dvqLfb
=== Support ===
If you want me to continue making this kind of video for free on KZbin, then you can help me financially by sending a few bucks to my Wise (bit.ly/3dnBRmX) account in Nepalese 🇳🇵 currency.
My Wise email: ashish.dhamala2015@gmail.com
If you decide to support me, please send me your Twitter handle in the mail so that I can shout out about you.
=== Social Media Links ===
Let's be friends
/ aashish_dhamala
=== Video Related Links ===
Laravel Documention link:
laravel.com/docs/9.x/eloquent...
Ecommerce Project - Playlist
• E-Commerce
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
• Laravel 9 Is Released ...
New In Laravel Playlist
• New In Laravel
Laravel Package Development Playlist
• Laravel Package Develo...
Password Validation In Laravel with at least one Letters, Numbers, Upper and Lowercase or Symbols:
• Password Validation In...
Multiple Apis With ForwardsCalls Trait And Code Refactoring Tip - Laravel Hidden Feature:
• Multiple Apis With For...
Laravel Chunking - You Might Be Doing This Wrong - Problem and Solution:
• Laravel Chunking - You...
Laravel Tip - Properly Get Data Between Two Dates
• Laravel Tip - Properly...
Get Data From Multiple Databases In One Project | Laravel Tip
• Get Data From Multiple...
=== Theme and Font Used ===
Theme:
Cobalt2 Theme Official (marketplace.visualstudio.com/...)
Font:
JetBrains Mono (www.jetbrains.com/lp/mono/)
=== Tech stack ===
Laravel
PHP
#laravel #php #laraveltip #laratips