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

Magically invoking Laravel controller methods

Playing
Magically invoking Laravel controller methods
2 mins5 years ago

Some controllers have one action. What should you name that action? Turns out you don't even have to.

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

Build an Appointment Booking System With Laravel

Building an availability calendar and booking system is a notoriously difficult problem to solve. That’s exactly what we’re going to cover in this course. Step by step, we’ll build an appointment slot generator that calculates availability based on employee schedules, employee’s booked time off, the length of service chosen, existing appointments, and cancelled appointments. For maximum flexibility, we’ll also allow multi-employee availability checks, so we’ll be able to see every employee who can perform a service (and their available slots). To finish up, we’ll build a simple UI with Alpine.js, with a beautiful booking calendar that shows detailed availability across multiple dates, the ability to choose a time slot — and finally the ability to book an appointment. Phew. We’ve got a lot to learn — let’s build a booking system with Laravel!

37 episodes
4 hrs 49 mins
Laravel

Laravel Actions

Actions are single classes that do *one thing*. Laravel Actions is a package that allows you to run these classes as *anything* you want, whether it's a controller, listener, console command – or just on its own. Keeping your app structure to single classes like this lets you focus on what your app does rather than the design decisions around controllers, listeners and commands. Single actions are also easier to test, and we'll also cover that! This course is for you if: * You'd like to try a fresh approach to structuring your apps * Your app shares logic, and you'd like to combine this logic into one class that runs anywhere * You've heard of (or used) Laravel Actions, and you'd like a run-through

12 episodes
1 hr 2 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

Logging Unique Views in Laravel with Redis

If you need to log unique views in Laravel, you might reach for a database table to track IP addresses or another unique piece of data. Let's take a look at speeding things up both in performance and complexity by using Redis and the HyperLogLog probabilistic data structure. Once we're done, we'll set up a period command to sync views back to the database for easy ordering, and then create a trait to share functionality between other models.

4 episodes
22 mins