Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans.pdf
Document Details
Uploaded by Deleted User
Full Transcript
22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans VERS ION 11.x Search Starter Kits # Introduction # Laravel Breeze...
22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans VERS ION 11.x Search Starter Kits # Introduction # Laravel Breeze # Installation # Breeze and Blade # Breeze and Livewire # Breeze and React / Vue # Breeze and Next.js / API # Laravel Jetstream # Introduction To give you a head start building your new Laravel application, we are happy to offer authentication and application starter kits. These kits automatically scaffold your application with the routes, controllers, and views you need to register and authenticate your application's users. While you are welcome to use these starter kits, they are not required. You are free to build your own application from the ground up by simply installing a fresh copy of Laravel. Either way, we know you will build something great! # Laravel Breeze https://laravel.com/docs/11.x/starter-kits#laravel-breeze 1/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans Laravel Breeze is a minimal, simple implementation of all of Laravel's authentication features, including login, registration, password reset, email verification, and password confirmation. In addition, Breeze includes a simple "profile" page where the user may update their name, email address, and password. Laravel Breeze's default view layer is made up of simple Blade templates styled with Tailwind CSS. Additionally, Breeze provides scaffolding options based on Livewire or Inertia, with the choice of using Vue or React for the Inertia-based scaffolding. Laravel Bootcamp If you're new to Laravel, feel free to jump into the Laravel Bootcamp. The Laravel Bootcamp will walk you through building your first Laravel application using Breeze. It's a great way to get a tour of everything that Laravel and Breeze have to offer. # Installation https://laravel.com/docs/11.x/starter-kits#laravel-breeze 2/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans First, you should create a new Laravel application. If you create your application using the Laravel installer, you will be prompted to install Laravel Breeze during the installation process. Otherwise, you will need to follow the manual installation instructions below. If you have already created a new Laravel application without a starter kit, you may manually install Laravel Breeze using Composer: composer require laravel/breeze --dev After Composer has installed the Laravel Breeze package, you should run the breeze:install Artisan command. This command publishes the authentication views, routes, controllers, and other resources to your application. Laravel Breeze publishes all of its code to your application so that you have full control and visibility over its features and implementation. The breeze:install command will prompt you for your preferred frontend stack and testing framework: php artisan breeze:install php artisan migrate npm install npm run dev # Breeze and Blade The default Breeze "stack" is the Blade stack, which utilizes simple Blade templates to render your application's frontend. The Blade stack may be installed by invoking the breeze:install command with no other additional arguments and selecting the Blade frontend stack. After Breeze's scaffolding is installed, you should also compile your application's frontend assets: php artisan breeze:install php artisan migrate https://laravel.com/docs/11.x/starter-kits#laravel-breeze 3/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans npm install npm run dev Next, you may navigate to your application's /login or /register URLs in your web browser. All of Breeze's routes are defined within the routes/auth.php file. To learn more about compiling your application's CSS and JavaScript, check out Laravel's Vite documentation. # Breeze and Livewire Laravel Breeze also offers Livewire scaffolding. Livewire is a powerful way of building dynamic, reactive, front-end UIs using just PHP. Livewire is a great fit for teams that primarily use Blade templates and are looking for a simpler alternative to JavaScript-driven SPA frameworks like Vue and React. To use the Livewire stack, you may select the Livewire frontend stack when executing the breeze:install Artisan command. After Breeze's scaffolding is installed, you should run your database migrations: php artisan breeze:install php artisan migrate # Breeze and React / Vue Laravel Breeze also offers React and Vue scaffolding via an Inertia frontend implementation. Inertia allows you to build modern, single-page React and https://laravel.com/docs/11.x/starter-kits#laravel-breeze 4/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans Vue applications using classic server-side routing and controllers. Inertia lets you enjoy the frontend power of React and Vue combined with the incredible backend productivity of Laravel and lightning-fast Vite compilation. To use an Inertia stack, you may select the Vue or React frontend stacks when executing the breeze:install Artisan command. When selecting the Vue or React frontend stack, the Breeze installer will also prompt you to determine if you would like Inertia SSR or TypeScript support. After Breeze's scaffolding is installed, you should also compile your application's frontend assets: php artisan breeze:install php artisan migrate npm install npm run dev Next, you may navigate to your application's /login or /register URLs in your web browser. All of Breeze's routes are defined within the routes/auth.php file. # Breeze and Next.js / API Laravel Breeze can also scaffold an authentication API that is ready to authenticate modern JavaScript applications such as those powered by Next, Nuxt, and others. To get started, select the API stack as your desired stack when executing the breeze:install Artisan command: php artisan breeze:install php artisan migrate During installation, Breeze will add a FRONTEND_URL environment variable to your application's.env file. This URL should be the URL of your JavaScript application. This will typically be http://localhost:3000 during local https://laravel.com/docs/11.x/starter-kits#laravel-breeze 5/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans development. In addition, you should ensure that your APP_URL is set to http://localhost:8000 , which is the default URL used by the serve Artisan command. # Next.js Reference Implementation Finally, you are ready to pair this backend with the frontend of your choice. A Next reference implementation of the Breeze frontend is available on GitHub. This frontend is maintained by Laravel and contains the same user interface as the traditional Blade and Inertia stacks provided by Breeze. # Laravel Jetstream While Laravel Breeze provides a simple and minimal starting point for building a Laravel application, Jetstream augments that functionality with more robust features and additional frontend technology stacks. For those brand new to Laravel, we recommend learning the ropes with Laravel Breeze before graduating to Laravel Jetstream. Jetstream provides a beautifully designed application scaffolding for Laravel and includes login, registration, email verification, two-factor authentication, session management, API support via Laravel Sanctum, and optional team management. Jetstream is designed using Tailwind CSS and offers your choice of Livewire or Inertia driven frontend scaffolding. Complete documentation for installing Laravel Jetstream can be found within the official Jetstream documentation. Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel attempts to take the pain out of development by easing common tasks used in most web projects. https://laravel.com/docs/11.x/starter-kits#laravel-breeze 6/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans HIGHLIGHTS RESOURCES Release Notes Laravel Bootcamp Getting Started Laracasts Routing Laravel News Blade Templates Laracon Authentication Laracon AU Authorization Laracon EU Artisan Console Laracon India Database Larabelles Eloquent ORM Careers Testing Jobs Forums Trademark PARTNERS ECOSYSTEM Vehikl Breeze WebReinvent Cashier Tighten Dusk Bacancy Echo 64 Robots Envoyer Active Logic Forge Black Airplane Herd Byte 5 Horizon Curotec Inertia Cyber-Duck Jetstream DevSquad Livewire Jump24 Nova Kirschbaum Octane Pennant Pint Prompts Pulse Reverb Sail https://laravel.com/docs/11.x/starter-kits#laravel-breeze 7/8 22/10/2024, 16:08 Starter Kits - Laravel 11.x - The PHP Framework For Web Artisans Sanctum Scout Socialite Spark Telescope Vapor Laravel is a Trademark of Laravel Holdings Inc. Copyright © 2011-2024 Laravel Holdings Inc. Code highlighting provided by Torchlight https://laravel.com/docs/11.x/starter-kits#laravel-breeze 8/8