Laravel 5.8 Tutorial - From The Ground Up
Laravel is the fastest growing PHP framework right now. With so many built in features and available 1st and 3rd party packages, Laravel is a skill that every PHP developer should have in their tool belt. Follow along as we get Laravel installed in our local machine.
Let's take care of having our application respond to some URLs using the web routes file.
Up next, let's talk about how to add view files and how we can load them into our route. We'll finish it up by talking about the Route::view shorthand notation.
Passing Data to Views
Every view will likely need some data passed to it. As we continue in our journey, let's handle a very simple customers list using some dynamic data.
As we progress on our learning, we need to find a place for all of the logic we have been putting inside the web.php file. The correct place for such logic is a dedicated controller.
Blade Templating Basics
Laravel's templating engine is called Blade. Blade is a powerful and easy to use templating engine that helps us deliver our html content to the browser with ease. Let's leverage Blade and a layout file to make our front-end have a navigation.
Let's get the basics of working with a database in Laravel by setting up an SQLite database from scratch. Let's also create a migration and a model for our customers.
Adding Customers To The Database
Now that we have our database in place, let's add a form to add any new customers.
Now that we are adding customers, we need to add some validation to our form. Laravel makes this process very easy, follow along as we make the name field required.
Adding Email For Customers
Let's work together to add an email field and persist it to the database.
Cleaning Up The Views
Let's take some time to clean up our views file and make our project look better by adding some Twitter Bootstrap classes.
Eloquent Where Clause
In this episode, we are adding a column for our customers list to make them active and inactive. Follow along as we add a where clause to our eloquent call to make this functionality work.
Eloquent Scopes & Mass Assignment
Up next, let's clean up our controller by extracting the logic for fetching an active/inactive customer into a scope. Then, let's use validated data to create our new customers using the create() method.
Eloquent BelongsTo & HasMany Relationships
In this episode, we are starting out by reviewing what we have learned so far to create a company model and migration. For new content, we are tackling connecting the company to a customer using the belongsTo and hasMany eloquent relationship.
Eloquent Accessors & RESTful Controller - Part 1
It’s time for us to tackle a refactor of our controllers and views to implement a RESTful controller approach. Follow along as we implement the index, create and store methods in our controller and properly store our views, following the same approach. As a last bit, let’s write an accessor for our active column for better display.
Eloquent Route Model Binding & RESTful Controller - Part 2
In part 2 of the RESTful Controller refactor, we are tackling the show method of our methodology. Along the way, we are going to learn how to add a wildcard to a route and all about Route Model Binding and how it can automatically fetch a record for us.
Eloquent Route Model Binding & RESTful Controller - Part 3
In part 3 of our RESTful Controller, we are continuing with the Edit and Update methods of our controller. Follow along as we get this implemented on our project.
Eloquent Route Model Binding & RESTful Controller - Part 4
In part 4, let's wrap up the update method and implement the delete verb. Stick around as we explore other time saving tips using php artisan command.
Handling a Contact Form Using a Laravel Mailable
Having a contact form where a user can submit their contact request is a very common thing in today's modern websites. Follow along as we add a contact form and use a Mailable to send an email.
Flashing Data to Session & Conditional Alerts in View
Now that our contact form is sending emails, it's time for us to focus on providing some feedback for our users once the form goes through. Follow along as we flash some data to the session and conditionally display an alert on the view. We will also tackle the inverse to hide our form.
Artisan Authentication - Register, Login & Password Reset
It's time for us to talk about registering users, login in users and resetting passwords. Up until now, a very daunting task, but with Laravel, it's as simple as running php artisan make auth and everything just works. Let's working on adding authentication to our Laravel application.
Artisan Authentication Restricting Access with Middleware
Let's touch up on the basics of what a Middleware is and explore ways that we can apply one to require a user to be logged in and authenticated to view our customer list.
Adding a Custom Middleware
Now that we know how to apply one of the default middlewares, let's take the time to create our own custom middleware for our app. Follow along as we talk about all of the ways you can add a middleware, from global, to web groups to individual routes.
In this episode, we explore the 3 URL Helpers offered by Laravel out of the box and refactor our project to use them.
Front End Setup with NPM, Node, Vue & Webpack
Vue Basics 101
Frontend Presets for React, Vue, Bootstrap & Tailwind CSS
Events & Listeners
Let's add some more "things" we need to do in our controller and then refactor into events and listeners. An event, allows us to make announcements in our app and then respond with a list of listeners. Follow along as we hook everything up from scratch.
Queues: Database Driver
Let's learn about deferring processor-heavy tasks for a later time using Queues in Laravel. We will be implementing the Database Driver in local environment and talk about what other things need to be refactored to let our listener send jobs to the queue.
queue:work In The Background
Now that we have our jobs running, let's explore how we can run the queue:work command in the background. As it turns out, it's actually quite simple to do. Follow along as we set it up from scratch.
Deployment: Basic Server Setup Part 1
The time has come for us to start setting up our own deployment server with everything we need to start hosting our project. Follow along as we set everything up from SSH, Nginx, PHP, MySQL and everything in between.
Deployment: Basic Server Setup Part 2
In part 2, we are tackling MySQL and PHP. The time has come for us to start setting up our own deployment server with everything we need to start hosting our project. Follow along as we set everything up from SSH, Nginx, PHP, MySQL and everything in between.
Deployment: Basic Server Setup Part 3
In part 3, we are tackling getting an SSL certificate from Let's Encrypt and some extra credit prompt setup. The time has come for us to start setting up our own deployment server with everything we need to start hosting our project. Follow along as we set everything up from SSH, Nginx, PHP, MySQL and everything in between.
Artisan Commands - Part 1
Let's start talking about how to create our very own artisan command. In part 1, we will make a command to add companies to our project.
Artisan Commands - Part 2
Let's start talking about how to create our very own artisan command. In part 2, let's make our command interactive. Allowing users to be prompted with the required questions.
Artisan Commands - Part 3
Let's start talking about how to create our very own artisan command. In part 3, let's add a command to clean up any used companies in our database. We will do this by adding a closure-based command in the routes file.
Model factories offer a very convenient way to add test data to our database during the development phase. Let's create a factory for our Company's table now.
Database & Table Seeders
A database seeder is comprised of all of the necessary code to generate a world's worth of data for our app. A table seeder is an individual seeder for a particular table. Learn all about both of us, in this lesson.
Image Upload - Part 1
Let's work together as we add the ability for a customer to have a profile image. We will see what we are building first, and then starting from scratch step by step. We will change our form, upload the image and make the necessary changes to our database.
Image Upload: Cropping & Resizing - Part 2
In part 2, let's handle resizing our image to fit inside a 300 by 300 pixel square. Then explore other options for cropping and resizing.
Laravel Telescope provides incredible feedback on what is going on behind the scenes with your application. It is an extremely powerful tool but very simple to install. Follow along as we install and do an overview on Laravel Telescope.
Lazy Loading vs. Eager Loading (Fixing N + 1 Problem)
You may have heard these fancy terms or read them in a blog post but what do they mean? In this lesson, we are diving deep to find out what it means, how to detect it and ultimately how to fix and avoid it.
Pagination is the simple concept of splitting up records into a set number and then displaying them in different pages. Laravel makes this so easy to do, it's almost laughable. Follow along as we paginate our customer's list.
Laravel policy files allow us to limit any of the CRUD actions in our app allowing us to stop unwanted behavior. Follow along as we work out a policy for our Customer's model.
Eloquent Relationships - One To One (hasOne, BelongsTo)
Eloquent offers a simple way to declare database relationships. In this episode, we are setting up a one to one relationship between a user and a phone.
Eloquent Relationships One To Many (hasMany, BelongsTo)
Eloquent offers a simple way to declare database relationships. In this episode, we are setting a one to many relationship between a user and posts.
Eloquent Relationships Many To Many (BelongsToMany)
Eloquent offers a simple way to declare database relationships. In this episode, we are setting a many to many relationship between a user and role model.
Eloquent Relationships Many To Many Part 2 (BelongsToMany)
Eloquent offers a simple way to declare database relationships. In this episode, we are adding additional data to the pivot table and storing the name of the user that performed the sync of those two resources.
Testing 101 Using PHPUnit
Testing is an integral part of modern PHP development. Let's work to get our customer controller under test.
SEO Friendly URLs
Search Engines prefer that your application have nice URLs instead of just an ID of a resource. In this lesson, we are exploring 2 ways to achieve this in Laravel.
Localization, Translations & Language Files
Some applications require a robust way to maintain several different languages. Luckily for us, Laravel has great localization features built in. Let's explore those now.
Multi Image File Upload & Gallery
As one of the most requested tutorials, in this lesson, we are tackling an example of multiple image uploads. We will also resize them to generate thumbnails and build a very basic image gallery where you can preview the full resolution images.