
Learn to build an ambassador app with Laravel, including admin and ambassador flows, JWT token differences, backend filtering and product caching with radios, and Stripe checkout for orders.
Install Laravel, create a project named Laravel Ambassador, navigate to the project folder, start the local server, and verify the setup is completed.
Create a dockerized Laravel backend by using a Dockerfile with php 7.4 on alpine, installing composer, and configuring docker-compose with a mysql 8 service and volumes.
Implement four authentication endpoints under api/admin, including register user, get authenticated user, and log out, as part of building secured Laravel RESTful APIs.
Define admin-prefixed routes and a register function in the Laravel RESTful API's OAuth controller; test with Postman to verify admin, ambassador, and checkout roles.
Register new users by validating input with a custom register request that enforces first name, last name, email, password, and password confirmation, returning json responses.
Implement middleware to return the authenticated user by reading JWT from cookies and setting the authorization header, ensuring the /user endpoint uses sanctum and preserves cookies.
Remove the authentication cookie to log out the authenticated user, returning a cleared cookie via the logout api. A post request to the endpoint leaves the user unauthenticated.
Explore how to enforce role-based access with scopes in Laravel RESTful APIs by creating an admin scope, adding a middleware check, and requiring re-login to verify authorization.
Create the database diagram for products, links, orders, and order items in a Laravel RESTful API, establishing a many-to-many relation via links and CRUD endpoints.
Create the products table with title, description, image, and price; migrate, build a product model, API controller, and RESTful resource, and seed with a factory.
Create a link model and many-to-many relationship with products via link products table, map each link to a user, and expose API endpoint at users/{id}/links to fetch a user's links.
Add order and order items tables with migrations and models, linking orders to items. Ensure Stripe transaction IDs verify purchases and normalize revenue fields for admin and ambassador shares.
Master route consolidation for admin and ambassador paths in a Laravel restful API by creating a common function and shared middleware, reducing duplicated code.
Retrieve a user's revenue by summing their orders, including ambassador revenue. Implement a user resource with a merge when a condition is met to expose revenue via the API.
Explore ambassador endpoints in a Laravel RESTful API, compare front-end and back-end product endpoints, create links, view link stats, and rank ambassadors by earnings.
Add two api methods to fetch all products for the frontend and backend, with 15 records per page. Test the endpoints and plan redis caching to handle many ambassadors.
Learn to set up Redis caching for a Laravel REST API using Docker, configure the cache driver, and store product data with keys and expiration to speed responses.
Implement Laravel pagination for the products collection by using the page input and nine items per page, calculate total and last page, and return the paginated data.
Implement a search feature by using the request input s to filter products with Str::contains on title and description, updating results on page one.
Implement price-based sorting for products in a Laravel RESTful API, enabling ascending and descending order through request input, with a custom comparator.
Sort ambassadors by revenue from completed orders to generate rankings. Fetch ambassadors, compute names, and report each revenue, then use Redis for faster retrieval.
Create and run a Laravel console command to populate a Redis sorted set with ambassadors by revenue, then retrieve and display rankings using reverse range for fast, ordered insights.
Apply Laravel events to update and invalidate the cache, firing a product updated event and handling it with a listener to invalidate cache keys for consistent front-end and back-end data.
Create links with a store function, generating a random six-character code, linking the current user to multiple product IDs via a foreach, and returning the link for API use.
Implement three checkout endpoints to populate front-end data, create and confirm orders, and redirect to Stripe for payment, then back to a confirmation page.
Retrieve a link by code and return its data with the user and products via belongs to many, then load orders with complete=1 for frontend delivery via a link resource.
Create orders in a Laravel RESTful API by implementing a store function, validating the link, saving the order and items, and calculating ambassador revenue (10%) versus admin (90%).
Learn how to use Laravel transactions to atomically save orders and order items, rolling back on errors to prevent partial data, with begin transaction, commit, and rollback.
Post to order/confirm to validate an order by matching source with the transaction id, handle missing orders with 404, set order_complete, save, and email admin and ambassador on completion.
Learn to send emails in Laravel by using mailhog for local testing, configuring smtp settings, and triggering order completed notifications to admin and ambassador with email templates.
Set up the front end for a Laravel restful API project by launching three services—admin on port 3000, ambassador on 4000, and checkout on 5000—and log in to test.
Learn how to create an Ambassador App using Laravel RESTful APIs. This app will have 3 parts, the Admin Endpoints, Ambassador Endpoints and Checkout Endpoints. In this course, you will focus only on Laravel and you won't build the frontend because it will be prebuilt.
In Laravel you will learn:
How to create API's with Laravel
Authenticate using Laravel Sanctum
Laravel JSON Resources
Install and use Docker
Use Redis
Use Stripe
Laravel Events & Listeners
Sending Emails
I'm a FullStack Developer with 10+ years of experience. I'm obsessed with clean code and I try my best that my courses have the cleanest code possible.
My teaching style is very straightforward, I will not waste too much time explaining all the ways you can create something or other unnecessary information to increase the length of my lectures. If you want to learn things rapidly then this course is for you.
I also update my courses regularly over time because I don't want them to get outdated. So you can expect more content over time from just one course with better video and audio quality.
If you have any coding problems I will offer my support within 12 hours when you post the question. I'm very active when trying to help my students.
So what are you waiting for, give this course a try and you won't get disappointed.