Laravel 13 - Authentication Using Jetstream.
Laravel 13 - Authentication Using Jetstream.
In this tutorial, we will learn how to set up authentication in Laravel 13 using Jetstream. We will cover installation, scaffolding, login, registration, and dashboard setup to build a secure and modern Laravel application step by step.
Quick Overview
This guide walks you through setting up a fresh Laravel 13 application with Laravel Jetstream authentication. You’ll start by installing Laravel globally and creating a new project while selecting basic setup options such as the testing framework and database type, and skipping default frontend builds to keep full control over configuration. After the project is created, you’ll move into the project directory, install Jetstream, and generate authentication scaffolding using Livewire or Inertia, which provides a complete system including login, registration, email verification, profile management, and session handling. Next, you’ll run migrations to create all required authentication tables, then install frontend dependencies using Vite and start the Laravel development server to run the application locally. Finally, you’ll open the project in your browser to test registration, login, and dashboard access, completing a fully working Laravel 13 Jetstream setup ready for further development and customization.
Step # 1 : Create and Configure a Fresh Laravel 13 Application.
To begin, make sure your system has Composer installed since it handles all dependencies for Laravel. You should also have the Laravel Installer available globally so you can quickly create new projects. If the Installer is not installed yet, run the following command.
composer global require laravel/installer
Once everything is ready, generate a new Laravel 13 project by running.
laravel new laravel13jetstream
During the installation process, Laravel will prompt you with several configuration options. Use the following selections to keep the setup minimal and flexible.
- Which starter kit would you like to install? → Choose none because we will install Jetstream separately to keep full control over the authentication setup.
- Which testing framework do you prefer? → Select Pest, as it provides a clean and modern testing syntax that is easier to write and read.
- Do you want to install Laravel Boost to improve AI-assisted coding? → Select No to keep the project simple and lightweight.
- Which database will your application use? → Choose MySQL, since we will configure the database manually later in the project.
- Would you like to run the default database migrations? → Select No, as migrations will be executed after database setup is completed.
- Would you like to run npm install and npm run build? → Select No, because we will handle frontend installation after setting up Jetstream.
By choosing these options, you ensure that the project remains clean without any pre-installed authentication or frontend setup. This approach gives you full control when integrating Laravel Jetstream in the upcoming steps, avoiding unnecessary conflicts or redundant files.
Step # 2 : Move Into Your Laravel 13 Project Directory.
Now that the project is created, open your terminal (Git Bash, Command Prompt, or any terminal you prefer) and move into your Laravel project folder.
cd c:/xampp/htdocs/laravel13jetstream
This ensures you are now working inside your Laravel project directory, where all further commands will be executed.
Step # 3 : Install Jetstream Package for Authentication.
To set up authentication, the next step is to install Laravel Jetstream using Composer. Run the following command in your terminal.
composer require laravel/jetstream
Jetstream is a ready-made authentication system for Laravel that helps you quickly add user login, registration, and account management to your application without building everything from scratch. It comes with a complete, secure, and well structured setup, including session management, profile settings, and API token support, making it a modern replacement for older authentication systems.
Step # 4 : Generate Jetstream Authentication Scaffolding.
Now that Laravel Jetstream is installed, the next step is to generate the authentication scaffolding. Jetstream gives you two main options depending on your preference.
Livewire (Simple & Blade-based):
php artisan jetstream:install livewire
Inertia (Vue-based frontend):
php artisan jetstream:install inertia
After running either of these commands, Laravel may prompt.
New database migrations were added. Would you like to re-run your migrations?
In this case, select no, since migrations will be handled in the next step to keep the setup clean and in the correct order.
If you’re just getting started, Livewire is usually the easier option since it works directly with Blade and doesn’t require learning a separate frontend framework. On the other hand, Inertia is a good choice if you prefer working with modern JavaScript frameworks like Vue. It gives you a more dynamic, single-page application (SPA) experience, but it also requires some familiarity with frontend development. Once the command runs, Jetstream will automatically set up all the authentication features, including login, registration, email verification, profile management, dashboard, and session handling. Next, install the frontend dependencies.
npm install
After this step, all the authentication files are added to your project, including routes, views, and controllers. The frontend dependencies are also installed, so the UI for login, registration, and dashboard is now part of your application and ready to be used.
Step # 5 : Run the Database Migrations.
After setting up authentication, make sure your database connection details are correctly configured in the .env file. Once everything looks good, run the migration command.
php artisan migrate
If the database does not already exist, Laravel will prompt you to create it.
The database does not exist. Would you like to create it? (yes/no)
Simply type yes and continue. Running this command will create all the necessary tables required for your application, including users, password reset tokens, sessions, and other supporting tables like cache, jobs, and failed jobs. Since you’re using Laravel Jetstream, it will also add extra tables for features such as API tokens and session management.
Step # 6 : Start Development Server and Run the Application.
Now it’s time to run your application and see everything in action. First, start the frontend development server.
npm run dev
Then start the Laravel server.
php artisan serve
Once both servers are running, open your browser and visit: http://127.0.0.1:8000. If everything is set up correctly, your Laravel 13 application should now be running with Laravel Jetstream. You can register a new user by visiting: http://127.0.0.1:8000/register. After completing the registration, you will be redirected to the dashboard.
After that, you can log in anytime at: http://127.0.0.1:8000/login. Once logged in, you will again land on the dashboard where you can confirm that the authentication system is working properly.
At this point, your authentication system is fully set up and ready for further development.
Conclusion
By following this guide, you have successfully set up a fresh Laravel 13 application with Laravel Jetstream authentication and completed a full working authentication system including registration, login, and dashboard access. You also installed and built frontend assets using modern tooling with Vite, making your application ready for development and further customization. Laravel 13 provides a clean and scalable structure, while Jetstream adds a powerful and ready-to-use authentication system out of the box. With this foundation in place, you can now extend your project by adding new features, customizing the UI, or building more advanced functionality based on your requirements.
For more details, refer to the official Laravel documentation: https://laravel.com/docs And Jetstream documentation: https://jetstream.laravel.com.
Share this with friends!
To engage in commentary, kindly proceed by logging in or registering
Subscribe to Our Newsletter
Stay ahead of the curve! Join our newsletter to see what everyone’s talking about.
0 Comments