Lifetime access is $100 off. Available for a limited time.Join here →
Snippets

Custom Laravel Collections

Playing
Custom Laravel Collections
15 mins4 years ago

Custom Laravel collections add another level of fluency to your code. Let's take a look at a couple of examples to get you started.

Alex Garrett-Smith
Hey, I'm the founder of Codecourse!

Comments

No comments, yet. Be the first to leave a comment.

Suggested courses

Laravel

Liking Things in Laravel with Redis

Let’s skip the database and build the ability to like any model in Laravel, using Redis. Traditionally you’d reach for the database for this kind of thing, but as you load more models and start performing checks within relationships — things begin to slow down. With a key-value store like Redis, tracking users who have liked comments (or anything) keeps everything ridiculously fast.

6 episodes
21 mins
Laravel

Authentication with Laravel Sanctum and Vue

Learn how to authenticate with a Laravel API from Vue using the Composition API. We'll start by setting up a fresh Laravel project with Sanctum and Fortify, configure everything step-by-step, and then implement the ability to authenticate from Vue with a simple auth module — thanks to the flexibility of the Composition API. In the second half of the course, we’ll create our own beautiful starter kit with more features, including registration and middleware to protect routes.

0 episodes
0 mins
Laravel

Livewire Multi Step Forms

Everything you need to build multi step forms in Livewire. We'll cover the basics of creating a multi step form, adding steps, navigating steps and accessing state using the laravel-livewire-wizard package. Finally, we'll build a fully working practical example with more advanced step navigation, file uploads, and custom state.

15 episodes
1 hr 38 mins
Laravel

Custom User Subdomains in Laravel

Allow users to choose their own subdomain, and give them their own area of your application where only their details are shown. You'll be able to register multiple routes for user areas. Everything in this short course can be easily applied to your own applications where you need this functionality. We'll cover every step of the way, and some things to watch out for. Finally, we'll learn how to deploy this and configure nginx and DNS records so you're ready to go.

9 episodes
31 mins
Laravel

Custom Laravel Query Builders

Using Eloquent query scopes in your project? Consider swapping them out for custom query builders. Custom query builders are model-specific, class-based builders that provide better organisation, IDE autocompletion, and more. We'll start this course by defining some standard scopes, refactor them, and discuss the benefits of custom builders. This course is for you if: - You're using query scopes, but they're bloating your models - You're working in a team and need more organisation in your project - You haven't used query scopes and want a primer, plus an alternative

4 episodes
23 mins