
Set up a Laravel backend and a Vue 3 frontend by installing fresh projects via the Laravel installer or composer, choosing sqlite, and using API-only scaffolding for a dedicated frontend.
organize the back end and front-end in a single folder and repo, serve on the same domain (backend.test), and plan to configure sanctum for front-end and back-end communication.
Install and configure Laravel Sanctum to enable spa authentication between the backend and a js app, publish migrations, set up middleware and env domains, and configure csrf cookies.
Learn to enable real-time broadcasting in a Laravel app by installing broadcasting and Laravel Reverb. Configure env and Reverb settings and review changed files for backend and front-end WebSocket integration.
Configure the front end to listen for backend broadcasts using Laravel Echo, pusher-js, and Axios; set up env credentials, register a front end plugin, and test WebSocket connectivity.
Test real-time functionality by broadcasting a Post Created event from the Laravel back end to a public posts channel and listening in Vue 3 with a Reverb server.
Install and configure Laravel Fortify to provide backend authentication APIs, enable login, two-factor authentication, and password management, while preparing private channels for real-time features.
Implement a quick authentication test by configuring Sanctum and Laravel Fortify, cleaning the frontend, and using a reactive login form with axios for CSRF, login, credentials, and seeding test user.
Install tailwind css for the project, configure postcss and tailwind with Vue.js components, install tailwind forms plugin, run npm run dev, fix postcss config errors, and prepare for navigation design.
Configure a site-wide navigation by embedding a navigation component in app.vue and render it on all pages, while planning the login flow and real-time post timeline features.
Explore how composables encapsulate state and logic in simple JavaScript files, export them, and import them into components to manage login flow with a useAuth composable.
Move authentication logic into a composable to separate business from UI logic, defining an authenticated boolean, a user object, and a login function that calls the backend.
This lecture demonstrates fetching the currently authenticated user after login using an auth composable, updating the user and authentication state, and rendering nav links based on authentication.
Call the attempt method from the use auth composable before app mount to persist the authenticated user on reload, ensuring the login state survives page refresh.
Design and implement a complete login flow in a Laravel 11 and Vue 3 SPA, including a login page with email and password, route setup, Sanctum authentication, and navigation.
Define the post model, migration, seeder, and factory for a real-time post timeline, establish user relations and avatar url logic, and seed 100 posts for testing.
Define an authenticated API to fetch posts, paginate ten records by latest created_at timestamp, and return a post resource with embedded user data including avatar via a user resource.
Define post item and post index components, render each post by looping backend data, and enhance the design with breeze-inspired tailwind styling in the home view.
Create a use post composable to manage CRUD and fetch posts from the backend with Axios, then render them by v-for looping in the post index and passing post props.
Implement infinite scrolling in a Vue.js app using the intersection observer from view use core to fetch additional posts from a Laravel-paginated backend as the user scrolls to the bottom.
Shift the element above its original position with a negative y translate using tailwind to preload the next batch before the bottom for infinite scrolling, and unify the fetch logic.
Define essential UI components for the timeline project, including a primary button and text area inspired by the breeze package and tailwind, and integrate the create post feature.
Define an API to store new posts, validate body and auth, return the post resource, fix future created_at seeds, and introduce Pinia state management for the Vue app.
Configure Pinia in a Vue.js project, migrate state from composables to a store, and implement a timeline with a post store managing page, posts, and loading state.
Fix the fetchNextPosts call by guarding it with an is_loaded boolean that becomes true after the initial data load, ensuring ten records load first before subsequent chunks.
Define a store post action to send form data to the API and prepend the new post to the timeline. Render server driven validation errors from the errors object.
Fix the issue pushing a new post into the timeline by properly accessing response.data.data and adding a pushPost function to avoid duplicates. Prepare for real-time updates with Laravel Echo.
Fix duplicate posts in the real-time timeline by popping the last post from the post array before pushing a new one, on both sender and receiver sides.
Pass the Laravel Echo socket ID when broadcasting from an API to distinguish the sender from others, by sending the x socket ID header during post storage.
Implement authorization to ensure only post owners can delete posts, delete via a store action, and broadcast a real-time post deleted event on the posts channel.
Toggle the edit state for a post with a boolean editing flag, populate the body in edit mode, and use an edit component to update or cancel, including child-to-parent events.
Update posts in real time by editing the post body, syncing changes via the backend to the current user’s dashboard, and broadcasting updates to all viewers on the timeline.
Implement real-time post updates by broadcasting a post updated event on the public post channel and syncing front-end views with Laravel Echo.
Identify why the shared validation errors appeared in both create and update flows, then implement separate create and update error bags to render errors correctly.
Implement real-time liking and broadcasting for posts. Update the backend to increment the likes counter, dispatch a post liked event, and broadcast on a post-specific channel to synchronize across users.
Using the power of Laravel Reverb, let’s build a real-time post-timeline application with Laravel 11, VueJS 3, Sanctum, and Reverb, pulling in Pinia for state management.
Projects Roadmap and Status:
[Uploaded] A Guide to Setup Laravel with Vue 3 and Reverb
[Uploaded] Let's Build a Realtime Post Timeline Project
Project Description:
[Uploaded] A Guide to Setup Laravel with Vue 3 and Reverb
In this section, we'll look into the basics of Laravel and Vue, by setting up both projects.
Some of the topics we'll cover in this section include:
Learn how to set up Laravel Sanctum to serve an SPA.
Look into the basics of broadcasting in Laravel and our frontend Vue 3 app.
We'll also configure private broadcasting in our front-end app.
Learn how to use composable in Vue 3
Learn how to implement authentication features like login flow, and grab the user data on reload.
[Uploaded] Let's Build a Realtime Post Timeline Project
In this section, we'll build a real-time post timeline project, where the users can create posts, view all the posts, and like the posts, all of these interactions will be real-time, and we'll also implement an infinite scrolling feature.
Some of the topics we'll cover in this section include:
Learn how to create posts and broadcast that event to show the created post in real time.
Learn how to display server-driven validation errors.
We'll learn how to implement an infinite scrolling feature in Vue 3 with the API served by Laravel.
We'll learn how to manage the state of our app using Pinia
Learn how to like the posts and broadcast the Liked event to implement real-time functionality
Learn how to Edit the posts and implement real-time editing functionality
And many more topics.
Course Summary:
Building real-time applications with Laravel (with Sanctum, Reverb) and Vue 3 (SPA)
Configuring Laravel Sanctum (along with Fortify) to serve a Frontend SPA
Setting up broadcasting in Laravel and listening for events in our Vue 3 app using Laravel Echo
Configuring and implementing private broadcasting in an API/SPA environment
Using the Intersection Observer API to load the next chunk of posts automatically when the user scrolls to the bottom of the timeline
Learn database seeding techniques in Laravel
Learn how to use API Resources in Laravel
Learn how to listen for Broadcasted events from the backend and react to them accordingly in the frontend
All of this state will be managed on the client side, using Pinia
By the end of this course, you will have built a feature-rich, real-time timeline application that showcases your understanding of front-end and back-end technologies, perfect for any aspiring developer looking to enhance their skills in dynamic web application development.