Andrew's Larabits
Here, you'll find Andrew Schmelyun's personal collection of Larabits. If you're unfamiliar, Larabits are short, isolated lessons that focus on a single concept or technique. While a typical series may take hours to work your way through, Larabits are instead for when you have five or ten minutes to pick up a small bit of knowledge.
Please keep in mind that each of these lessons is self-contained and may be viewed in any order. Happy learning!
Progress
Series Info
- Episodes
- 18
- Run Time
- 4h 3m
- Difficulty
- Intermediate
- Last Updated
- Feb 9, 2022
- Version
- Latest
Series Episodes
- Episodes (18)
A High-Level Overview of Laravel Octane
Laravel Octane can drastically boost your application's performance and response time by serving it through high-performance PHP servers like Swoole or Roadrunner. In this Larabit, I'll show you how to get started using Octane in your own applications. I'll also benchmark an example app to show the difference that Laravel Octane can make in response times and requests per second.Static Analysis in Laravel
In this Larabit, I show you how to get started using static analysis in Laravel with the Larastan package. A wrapper for the popular PHPStan toolkit, Larastan is an almost zero-config library for using it with a new or existing application. Using a few basic examples I'll show you how easy it is to automate checking your code for things like missing variables, incorrect return types, and more.How to Manipulate Photos in Laravel
Working with images in PHP is notoriously tricky, but Intervention's Image package streamlines the process in an elegant wrapper for GD or Imagick. In this Larabit, I'll show you how to install Intervention Image into an existing Laravel application, and use it to resize, crop, and watermark uploaded photos, before saving their modified versions in our app.Pinia - A New Vue Store Library
A fairly recent addition to the Vue ecosystem is a store library called Pinia, that was originally developed for the composition API released with Vue 3. It has since carved a niche as a Vuex alternative that can be used with Vue 2, and either of Vue 3's API. It's lightweight and modular while providing a strong backbone to state management in your Vue application.Broadcasting Events in Laravel
In this Larabit, I'll provide a high-level overview of how to broadcast events in Laravel and listen for updates on your application's frontend. Using the popular open-source Pusher alternative, laravel-websockets, and Laravel's Echo frontend library, we can give our users the ability to send and receive data in real-time without breaking a sweat.Client-side Validation With Iodine.js
In this Larabit, I go over a handy, light-weight JavaScript validation library called Iodine. Essentially a list of helpful filter methods with zero external dependencies, this drop-in package lets you easily validate any kind of input or data on the frontend, and even create your own custom rules and error messages. Plus, it works great in Vue!Laravel Migrations Tips and Tricks
In this Larabit, I go over the process of creating migrations in Laravel and show off some uncommon methods and techniques that you can leverage in your own applications. A few of these shortcuts have dramatically sped up the time it takes me to get my database structure set up and ready to go.Using MySQL JSON Columns with Laravel
In this Larabit, I'm going to show you how to add, and use, MySQL's JSON column types in a Laravel application. I usually end up reaching for these when I have a series of arbitrary attributes or settings for a model. Instead of having to create multiple table columns in my database, a single JSON column can be a handy alternative.Two-Factor Authentication with Laravel Fortify
In this Larabit, we'll take an existing application built with Laravel Breeze and add two-factor authentication to the login flow with Fortify. We don't have to adjust our current authentication setup, but instead can use Fortify's auth class and user trait to allow our users to toggle 2FA on their account.TailwindCSS on the Command Line?
In this Larabit, we'll take a quick peek at a new library called Termwind. Introduced recently by Nuno Maduro, this package lets you style PHP command-line applications by writing HTML with Tailwind CSS classes. Styling CLI apps is usually pretty tedius and a bit complicated, so I'm eager to see if this could make that process a lot smoother. Let's find out!Vue Transitions Simplified
In this Larabit, we'll review the essentials of Vue transitions, and help break up some of the complexity surrounding them. When I first started using transitions in my apps, it was incredibly confusing how these different class names worked together. Not only will I explain the lifecycle of transitions and their generated CSS classes, but I'll also show you how you can use a library like Tailwind as an alternative to style them.Common Database Query Gotchas (and Solutions)
In this Larabit, we'll review a handful of common pitfalls with database queries that I've seen in practical Laravel applications. For each one, I'll show you how to refactor the code to optimize the offending call, and how a few quick changes can affect the resource usage and response time of our app.Why Docker?
I'd like to answer a question that I've been asked a lot. Why should I use Docker? For me personally, it's revolutionized my local development environment and has made me a much more productive programmer. I'm not worrying about local software installed and maintained on my machine, and I have the ability to experiment with new features at the press of a few keys.3 Excellent New Features in Alpine.js
In this Larabit, I'll show you three new features released recently in the Alpine.js framework. The plugin Portal was merged into the main framework as thex-teleportdirective and lets you move blocks of code outside your Alpine state area. Speaking of state,$datalets you pass the current Alpine state object as a function argument.A-Z Authentication Using Laravel Sanctum and Socialite
In this Larabit, I'll demonstrate from scratch how to authorize an API using a combination of Laravel's Sanctum and Socialite packages. This is a great use case for SPAs or mobile apps whose backends are powered by a Laravel API, and who want to give their users the ability to sign in using social networks or other third-party sites.Eloquent Model Events Explained
In this Larabit, you'll learn three different ways to listen for changes in Laravel Eloquent models, and react to those changes with the data being saved or modified. We'll take a shallow dive by using simple closure functions directly in the model classes, and then go deeper by using specific event and listener classes to utilize Eloquent's lifecycle hooks.My 5 Favorite Laravel Collection Methods
In this Larabit, I'll show you five of my favorite and most-used methods when working with collections in Laravel apps. Collections are an incredibly powerful and super-useful tool to bring on board in your codebase. Large, complex arrays can easily be organized and manipulated, and it all starts with a single collect helper.Transform VS Code into a Formidable PHP Experience
In this Larabit, I'll show you five ways to help transform Visual Studio Code into a formidible PHP development experience. We'll install and set up PHP Intelephense, giving our editor a powerful yet lightweight language server for things like code completion. One extension lets us run Composer commands without having to leave the window, and another automatically finds and includes namespaces in your code. Finally, we'll wrap things up by using xDebug to setup breakpoints and stop program execution to step through our PHP code.
