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

Laravel Automatic Password Hashing

Playing
Laravel Automatic Password Hashing
6 mins4 years ago

Using mutators to set properties in your models can really clean up your code. In this snippet, we'll look at an example of automatic password hashing and see how much tidier our controllers end up.

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 a URL Shortener with Volt and Folio

Volt is a functional API for Livewire that allows you to build Livewire components in a single file, alongside Blade templates. Pairing this with automatic route creation using Laravel Folio gives us a serious productivity boost. So, let’s build a URL shortener while learning how Volt and Folio work!

10 episodes
53 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

Passwordless Authentication with Laravel

Say goodbye to the traditional email/password flow and implement passwordless authentication with Laravel! In this course, we'll cover sending a secure link via email to allow users to sign in seamlessly. Oh, and we'll cover the entire registration process too. Use it on its own, or combine it with the standard email/password flow to give your users even more flexibility.

10 episodes
58 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