Laravel API Resources: 3 More Complex Examples

テクノロジー



Eloquent API Resources are typically used to transform API results into the format that you need, but did you know about more complex conditions and relationship structures that you can use in the API Resource class? I will show you 3 open-source examples.

Examples mentioned in the video:
– Official Laravel docs: https://laravel.com/docs/8.x/eloquent-resources
– Colin DeCarlo talk screenshot: https://mobile.twitter.com/lloricode/status/1433213974091231232/photo/1
– Novapackages: https://github.com/tighten/novapackages/blob/main/app/Http/Resources/Package.php
– Monica: https://github.com/monicahq/monica/blob/master/app/Http/Resources/Activity/Activity.php

More open-source projects examples: https://laravelexamples.com/projects

– – – – –
Support the channel by checking out our products:
– Enroll in my Laravel courses: https://laraveldaily.teachable.com
– Try our Laravel QuickAdminPanel: https://bit.ly/quickadminpanel
– Purchase my Livewire Kit: https://livewirekit.com
– View Laravel Code Examples: https://laravelexamples.com
– Subscribe to my weekly newsletter: http://bit.ly/laravel-newsletter

Comments

Copied title and URL