diff --git a/authentication.md b/authentication.md index dd82403a01..a06f281b20 100644 --- a/authentication.md +++ b/authentication.md @@ -48,7 +48,7 @@ Your application's authentication configuration file is located at `config/auth. Want to get started fast? Install a [Laravel application starter kit](/docs/{{version}}/starter-kits) in a fresh Laravel application. After migrating your database, navigate your browser to `/register` or any other URL that is assigned to your application. The starter kits will take care of scaffolding your entire authentication system! -**Even if you choose not to use a starter kit in your final Laravel application, installing the [Laravel Breeze](/docs/{{version}}/starter-kits#laravel-breeze) starter kit can be a wonderful opportunity to learn how to implement all of Laravel's authentication functionality in an actual Laravel project.** Since Laravel Breeze creates authentication controllers, routes, and views for you, you can examine the code within these files to learn how Laravel's authentication features may be implemented. +**Even if you choose not to use a starter kit in your final Laravel application, installing a [starter kit](/docs/{{version}}/starter-kits) can be a wonderful opportunity to learn how to implement all of Laravel's authentication functionality in an actual Laravel project.** Since the Laravel starter kits contain authentication controllers, routes, and views for you, you can examine the code within these files to learn how Laravel's authentication features may be implemented. ### Database Considerations @@ -77,13 +77,7 @@ Laravel includes built-in authentication and session services which are typicall **Application Starter Kits** -As discussed in this documentation, you can interact with these authentication services manually to build your application's own authentication layer. However, to help you get started more quickly, we have released [free packages](/docs/{{version}}/starter-kits) that provide robust, modern scaffolding of the entire authentication layer. These packages are [Laravel Breeze](/docs/{{version}}/starter-kits#laravel-breeze), [Laravel Jetstream](/docs/{{version}}/starter-kits#laravel-jetstream), and [Laravel Fortify](/docs/{{version}}/fortify). - -_Laravel Breeze_ is a simple, minimal implementation of all of Laravel's authentication features, including login, registration, password reset, email verification, and password confirmation. Laravel Breeze's view layer is comprised of simple [Blade templates](/docs/{{version}}/blade) styled with [Tailwind CSS](https://tailwindcss.com). To get started, check out the documentation on Laravel's [application starter kits](/docs/{{version}}/starter-kits). - -_Laravel Fortify_ is a headless authentication backend for Laravel that implements many of the features found in this documentation, including cookie-based authentication as well as other features such as two-factor authentication and email verification. Fortify provides the authentication backend for Laravel Jetstream or may be used independently in combination with [Laravel Sanctum](/docs/{{version}}/sanctum) to provide authentication for an SPA that needs to authenticate with Laravel. - -_[Laravel Jetstream](https://jetstream.laravel.com)_ is a robust application starter kit that consumes and exposes Laravel Fortify's authentication services with a beautiful, modern UI powered by [Tailwind CSS](https://tailwindcss.com), [Livewire](https://livewire.laravel.com), and / or [Inertia](https://inertiajs.com). Laravel Jetstream includes optional support for two-factor authentication, team support, browser session management, profile management, and built-in integration with [Laravel Sanctum](/docs/{{version}}/sanctum) to offer API token authentication. Laravel's API authentication offerings are discussed below. +As discussed in this documentation, you can interact with these authentication services manually to build your application's own authentication layer. However, to help you get started more quickly, we have released [free starter kits](/docs/{{version}}/starter-kits) that provide robust, modern scaffolding of the entire authentication layer. #### Laravel's API Authentication Services @@ -100,8 +94,6 @@ In response to the complexity of OAuth2 and developer confusion, we set out to b Laravel Sanctum is a hybrid web / API authentication package that can manage your application's entire authentication process. This is possible because when Sanctum based applications receive a request, Sanctum will first determine if the request includes a session cookie that references an authenticated session. Sanctum accomplishes this by calling Laravel's built-in authentication services which we discussed earlier. If the request is not being authenticated via a session cookie, Sanctum will inspect the request for an API token. If an API token is present, Sanctum will authenticate the request using that token. To learn more about this process, please consult Sanctum's ["how it works"](/docs/{{version}}/sanctum#how-it-works) documentation. -Laravel Sanctum is the API package we have chosen to include with the [Laravel Jetstream](https://jetstream.laravel.com) application starter kit because we believe it is the best fit for the majority of web application's authentication needs. - #### Summary and Choosing Your Stack @@ -113,7 +105,7 @@ If you are building a single-page application (SPA) that will be powered by a La Passport may be chosen when your application absolutely needs all of the features provided by the OAuth2 specification. -And, if you would like to get started quickly, we are pleased to recommend [Laravel Breeze](/docs/{{version}}/starter-kits#laravel-breeze) as a quick way to start a new Laravel application that already uses our preferred authentication stack of Laravel's built-in authentication services and Laravel Sanctum. +And, if you would like to get started quickly, we are pleased to recommend [our application starter kits](/docs/{{version}}/starter-kits) as a quick way to start a new Laravel application that already uses our preferred authentication stack of Laravel's built-in authentication services. ## Authentication Quickstart @@ -124,16 +116,12 @@ And, if you would like to get started quickly, we are pleased to recommend [Lara ### Install a Starter Kit -First, you should [install a Laravel application starter kit](/docs/{{version}}/starter-kits). Our current starter kits, Laravel Breeze and Laravel Jetstream, offer beautifully designed starting points for incorporating authentication into your fresh Laravel application. - -Laravel Breeze is a minimal, simple implementation of all of Laravel's authentication features, including login, registration, password reset, email verification, and password confirmation. Laravel Breeze's view layer is made up of simple [Blade templates](/docs/{{version}}/blade) styled with [Tailwind CSS](https://tailwindcss.com). Additionally, Breeze provides scaffolding options based on [Livewire](https://livewire.laravel.com) or [Inertia](https://inertiajs.com), with the choice of using Vue or React for the Inertia-based scaffolding. - -[Laravel Jetstream](https://jetstream.laravel.com) is a more robust application starter kit that includes support for scaffolding your application with [Livewire](https://livewire.laravel.com) or [Inertia and Vue](https://inertiajs.com). In addition, Jetstream features optional support for two-factor authentication, teams, profile management, browser session management, API support via [Laravel Sanctum](/docs/{{version}}/sanctum), account deletion, and more. +First, you should [install a Laravel application starter kit](/docs/{{version}}/starter-kits). Our starter kits offer beautifully designed starting points for incorporating authentication into your fresh Laravel application. ### Retrieving the Authenticated User -After installing an authentication starter kit and allowing users to register and authenticate with your application, you will often need to interact with the currently authenticated user. While handling an incoming request, you may access the authenticated user via the `Auth` facade's `user` method: +After creating an application from a starter kit and allowing users to register and authenticate with your application, you will often need to interact with the currently authenticated user. While handling an incoming request, you may access the authenticated user via the `Auth` facade's `user` method: ```php use Illuminate\Support\Facades\Auth; @@ -228,7 +216,7 @@ Route::get('/flights', function () { ### Login Throttling -If you are using the Laravel Breeze or Laravel Jetstream [starter kits](/docs/{{version}}/starter-kits), rate limiting will automatically be applied to login attempts. By default, the user will not be able to login for one minute if they fail to provide the correct credentials after several attempts. The throttling is unique to the user's username / email address and their IP address. +If you are using one of our [application starter kits](/docs/{{version}}/starter-kits), rate limiting will automatically be applied to login attempts. By default, the user will not be able to login for one minute if they fail to provide the correct credentials after several attempts. The throttling is unique to the user's username / email address and their IP address. > [!NOTE] > If you would like to rate limit other routes in your application, check out the [rate limiting documentation](/docs/{{version}}/routing#rate-limiting). diff --git a/cache.md b/cache.md index 0693ffc80e..4bc9aad60b 100644 --- a/cache.md +++ b/cache.md @@ -83,7 +83,7 @@ If needed, you may set the `host` option to a UNIX socket path. If you do this, #### Redis -Before using a Redis cache with Laravel, you will need to either install the PhpRedis PHP extension via PECL or install the `predis/predis` package (~2.0) via Composer. [Laravel Sail](/docs/{{version}}/sail) already includes this extension. In addition, official Laravel deployment platforms such as [Laravel Forge](https://forge.laravel.com) and [Laravel Vapor](https://vapor.laravel.com) have the PhpRedis extension installed by default. +Before using a Redis cache with Laravel, you will need to either install the PhpRedis PHP extension via PECL or install the `predis/predis` package (~2.0) via Composer. [Laravel Sail](/docs/{{version}}/sail) already includes this extension. In addition, official Laravel application platforms such as [Laravel Cloud](https://cloud.laravel.com) and [Laravel Forge](https://forge.laravel.com) have the PhpRedis extension installed by default. For more information on configuring Redis, consult its [Laravel documentation page](/docs/{{version}}/redis#configuration). @@ -362,7 +362,7 @@ cache()->remember('users', $seconds, function () { ### Managing Locks -Atomic locks allow for the manipulation of distributed locks without worrying about race conditions. For example, [Laravel Forge](https://forge.laravel.com) uses atomic locks to ensure that only one remote task is being executed on a server at a time. You may create and manage locks using the `Cache::lock` method: +Atomic locks allow for the manipulation of distributed locks without worrying about race conditions. For example, [Laravel Cloud](https://cloud.laravel.com) uses atomic locks to ensure that only one remote task is being executed on a server at a time. You may create and manage locks using the `Cache::lock` method: ```php use Illuminate\Support\Facades\Cache; diff --git a/configuration.md b/configuration.md index 17a20e712b..7d1ac6877d 100644 --- a/configuration.md +++ b/configuration.md @@ -371,4 +371,4 @@ While your application is in maintenance mode, no [queued jobs](/docs/{{version} #### Alternatives to Maintenance Mode -Since maintenance mode requires your application to have several seconds of downtime, consider alternatives like [Laravel Vapor](https://vapor.laravel.com) and [Envoyer](https://envoyer.io) to accomplish zero-downtime deployment with Laravel. +Since maintenance mode requires your application to have several seconds of downtime, consider running your applications on a fully-managed platform like [Laravel Cloud](https://cloud.laravel.com) to accomplish zero-downtime deployment with Laravel. diff --git a/container.md b/container.md index a7d0c0356b..0bf6947334 100644 --- a/container.md +++ b/container.md @@ -144,7 +144,15 @@ $this->app->bindIf(Transistor::class, function (Application $app) { }); ``` -> [!NOTE] +For convenience, you may omit providing the class or interface name that you wish to register as a separate argument and instead allow Laravel to infer the type from the return type of the closure you provide to the `bind` method: + +```php +App::bind(function (Application $app): Transistor { + return new Transistor($app->make(PodcastParser::class)); +}); +``` + +> [!NOTE] > There is no need to bind classes into the container if they do not depend on any interfaces. The container does not need to be instructed on how to build these objects, since it can automatically resolve these objects using reflection. diff --git a/contributions.md b/contributions.md index 485749eb39..54f24b97c5 100644 --- a/contributions.md +++ b/contributions.md @@ -28,7 +28,6 @@ The Laravel source code is managed on GitHub, and there are repositories for eac - [Laravel Application](https://github.com/laravel/laravel) - [Laravel Art](https://github.com/laravel/art) -- [Laravel Breeze](https://github.com/laravel/breeze) - [Laravel Documentation](https://github.com/laravel/docs) - [Laravel Dusk](https://github.com/laravel/dusk) - [Laravel Cashier Stripe](https://github.com/laravel/cashier) @@ -39,17 +38,19 @@ The Laravel source code is managed on GitHub, and there are repositories for eac - [Laravel Framework](https://github.com/laravel/framework) - [Laravel Homestead](https://github.com/laravel/homestead) ([Build Scripts](https://github.com/laravel/settler)) - [Laravel Horizon](https://github.com/laravel/horizon) -- [Laravel Jetstream](https://github.com/laravel/jetstream) +- [Laravel Livewire Starter Kit](https://github.com/laravel/livewire-starter-kit) - [Laravel Passport](https://github.com/laravel/passport) - [Laravel Pennant](https://github.com/laravel/pennant) - [Laravel Pint](https://github.com/laravel/pint) - [Laravel Prompts](https://github.com/laravel/prompts) +- [Laravel React Starter Kit](https://github.com/laravel/react-starter-kit) - [Laravel Reverb](https://github.com/laravel/reverb) - [Laravel Sail](https://github.com/laravel/sail) - [Laravel Sanctum](https://github.com/laravel/sanctum) - [Laravel Scout](https://github.com/laravel/scout) - [Laravel Socialite](https://github.com/laravel/socialite) - [Laravel Telescope](https://github.com/laravel/telescope) +- [Laravel Vue Starter Kit](https://github.com/laravel/vue-starter-kit) - [Laravel Website](https://github.com/laravel/laravel.com) diff --git a/deployment.md b/deployment.md index 6649069714..158ce5a2fc 100644 --- a/deployment.md +++ b/deployment.md @@ -13,7 +13,7 @@ - [Caching Views](#optimizing-view-loading) - [Debug Mode](#debug-mode) - [The Health Route](#the-health-route) -- [Easy Deployment With Forge / Vapor](#deploying-with-forge-or-vapor) +- [Deploying With Laravel Cloud or Forge](#deploying-with-cloud-or-forge) ## Introduction @@ -50,7 +50,7 @@ The Laravel framework has a few system requirements. You should ensure that your ### Nginx -If you are deploying your application to a server that is running Nginx, you may use the following configuration file as a starting point for configuring your web server. Most likely, this file will need to be customized depending on your server's configuration. **If you would like assistance in managing your server, consider using a first-party Laravel server management and deployment service such as [Laravel Forge](https://forge.laravel.com).** +If you are deploying your application to a server that is running Nginx, you may use the following configuration file as a starting point for configuring your web server. Most likely, this file will need to be customized depending on your server's configuration. **If you would like assistance in managing your server, consider using a fully-managed Laravel platform like [Laravel Cloud](https://cloud.laravel.com).** Please ensure, like the configuration below, your web server directs all requests to your application's `public/index.php` file. You should never attempt to move the `index.php` file to your project's root, as serving the application from the project root will expose many sensitive configuration files to the public Internet: @@ -194,20 +194,19 @@ By default, the health check route is served at `/up` and will return a 200 HTTP When HTTP requests are made to this route, Laravel will also dispatch a `Illuminate\Foundation\Events\DiagnosingHealth` event, allowing you to perform additional health checks relevant to your application. Within a [listener](/docs/{{version}}/events) for this event, you may check your application's database or cache status. If you detect a problem with your application, you may simply throw an exception from the listener. - -## Easy Deployment With Forge / Vapor + +## Deploying With Laravel Cloud or Forge - -#### Laravel Forge + +#### Laravel Cloud -If you aren't quite ready to manage your own server configuration or aren't comfortable configuring all of the various services needed to run a robust Laravel application, [Laravel Forge](https://forge.laravel.com) is a wonderful alternative. +If you would like a fully-managed, auto-scaling deployment platform tuned for Laravel, check out [Laravel Cloud](https://cloud.laravel.com). Laravel Cloud is a robust deployment platform for Laravel, offering managed compute, databases, caches, and object storage. -Laravel Forge can create servers on various infrastructure providers such as DigitalOcean, Linode, AWS, and more. In addition, Forge installs and manages all of the tools needed to build robust Laravel applications, such as Nginx, MySQL, Redis, Memcached, Beanstalk, and more. +Launch your Laravel application on Cloud and fall in love with the scalable simplicity. Laravel Cloud is fine-tuned by Laravel's creators to work seamlessly with the framework so you can keep writing your Laravel applications exactly like you're used to. -> [!NOTE] -> Want a full guide to deploying with Laravel Forge? Check out the [Laravel Bootcamp](https://bootcamp.laravel.com/deploying) and the Forge [video series available on Laracasts](https://laracasts.com/series/learn-laravel-forge-2022-edition). + +#### Laravel Forge - -#### Laravel Vapor +If you prefer to manage your own servers but aren't comfortable configuring all of the various services needed to run a robust Laravel application, [Laravel Forge](https://forge.laravel.com) is a VPS server management platform for Laravel applications. -If you would like a totally serverless, auto-scaling deployment platform tuned for Laravel, check out [Laravel Vapor](https://vapor.laravel.com). Laravel Vapor is a serverless deployment platform for Laravel, powered by AWS. Launch your Laravel infrastructure on Vapor and fall in love with the scalable simplicity of serverless. Laravel Vapor is fine-tuned by Laravel's creators to work seamlessly with the framework so you can keep writing your Laravel applications exactly like you're used to. +Laravel Forge can create servers on various infrastructure providers such as DigitalOcean, Linode, AWS, and more. In addition, Forge installs and manages all of the tools needed to build robust Laravel applications, such as Nginx, MySQL, Redis, Memcached, Beanstalk, and more. diff --git a/documentation.md b/documentation.md index c0eecca09e..a76e612a10 100644 --- a/documentation.md +++ b/documentation.md @@ -81,7 +81,6 @@ - [Database](/docs/{{version}}/database-testing) - [Mocking](/docs/{{version}}/mocking) - ## Packages - - [Breeze](/docs/{{version}}/starter-kits#laravel-breeze) - [Cashier (Stripe)](/docs/{{version}}/billing) - [Cashier (Paddle)](/docs/{{version}}/cashier-paddle) - [Dusk](/docs/{{version}}/dusk) @@ -90,7 +89,6 @@ - [Folio](/docs/{{version}}/folio) - [Homestead](/docs/{{version}}/homestead) - [Horizon](/docs/{{version}}/horizon) - - [Jetstream](https://jetstream.laravel.com) - [Mix](/docs/{{version}}/mix) - [Octane](/docs/{{version}}/octane) - [Passport](/docs/{{version}}/passport) diff --git a/eloquent-relationships.md b/eloquent-relationships.md index d2020525d2..f42fb93d84 100644 --- a/eloquent-relationships.md +++ b/eloquent-relationships.md @@ -585,16 +585,16 @@ return $this->throughCars()->hasOwner(); ### Has Many Through -The "has-many-through" relationship provides a convenient way to access distant relations via an intermediate relation. For example, let's assume we are building a deployment platform like [Laravel Vapor](https://vapor.laravel.com). A `Project` model might access many `Deployment` models through an intermediate `Environment` model. Using this example, you could easily gather all deployments for a given project. Let's look at the tables required to define this relationship: +The "has-many-through" relationship provides a convenient way to access distant relations via an intermediate relation. For example, let's assume we are building a deployment platform like [Laravel Cloud](https://cloud.laravel.com). An `Application` model might access many `Deployment` models through an intermediate `Environment` model. Using this example, you could easily gather all deployments for a given application. Let's look at the tables required to define this relationship: ```text -projects +applications id - integer name - string environments id - integer - project_id - integer + application_id - integer name - string deployments @@ -603,7 +603,7 @@ deployments commit_hash - string ``` -Now that we have examined the table structure for the relationship, let's define the relationship on the `Project` model: +Now that we have examined the table structure for the relationship, let's define the relationship on the `Application` model: ```php through('environments')->has('deployments'); return $this->throughEnvironments()->hasDeployments(); ``` -Though the `Deployment` model's table does not contain a `project_id` column, the `hasManyThrough` relation provides access to a project's deployments via `$project->deployments`. To retrieve these models, Eloquent inspects the `project_id` column on the intermediate `Environment` model's table. After finding the relevant environment IDs, they are used to query the `Deployment` model's table. +Though the `Deployment` model's table does not contain a `application_id` column, the `hasManyThrough` relation provides access to a application's deployments via `$application->deployments`. To retrieve these models, Eloquent inspects the `application_id` column on the intermediate `Environment` model's table. After finding the relevant environment IDs, they are used to query the `Deployment` model's table. #### Key Conventions @@ -645,16 +645,16 @@ Though the `Deployment` model's table does not contain a `project_id` column, th Typical Eloquent foreign key conventions will be used when performing the relationship's queries. If you would like to customize the keys of the relationship, you may pass them as the third and fourth arguments to the `hasManyThrough` method. The third argument is the name of the foreign key on the intermediate model. The fourth argument is the name of the foreign key on the final model. The fifth argument is the local key, while the sixth argument is the local key of the intermediate model: ```php -class Project extends Model +class Application extends Model { public function deployments(): HasManyThrough { return $this->hasManyThrough( Deployment::class, Environment::class, - 'project_id', // Foreign key on the environments table... + 'application_id', // Foreign key on the environments table... 'environment_id', // Foreign key on the deployments table... - 'id', // Local key on the projects table... + 'id', // Local key on the applications table... 'id' // Local key on the environments table... ); } diff --git a/eloquent.md b/eloquent.md index ab6c8ff076..643b2d421d 100644 --- a/eloquent.md +++ b/eloquent.md @@ -47,10 +47,6 @@ Laravel includes Eloquent, an object-relational mapper (ORM) that makes it enjoy > [!NOTE] > Before getting started, be sure to configure a database connection in your application's `config/database.php` configuration file. For more information on configuring your database, check out [the database configuration documentation](/docs/{{version}}/database#configuration). -#### Laravel Bootcamp - -If you're new to Laravel, feel free to jump into the [Laravel Bootcamp](https://bootcamp.laravel.com). The Laravel Bootcamp will walk you through building your first Laravel application using Eloquent. It's a great way to get a tour of everything that Laravel and Eloquent have to offer. - ## Generating Model Classes diff --git a/fortify.md b/fortify.md index 19e5d7a37e..4df2abef52 100644 --- a/fortify.md +++ b/fortify.md @@ -41,9 +41,9 @@ As mentioned previously, Laravel Fortify is a frontend agnostic authentication b **You are not required to use Fortify in order to use Laravel's authentication features.** You are always free to manually interact with Laravel's authentication services by following the documentation available in the [authentication](/docs/{{version}}/authentication), [password reset](/docs/{{version}}/passwords), and [email verification](/docs/{{version}}/verification) documentation. -If you are new to Laravel, you may wish to explore the [Laravel Breeze](/docs/{{version}}/starter-kits) application starter kit before attempting to use Laravel Fortify. Laravel Breeze provides an authentication scaffolding for your application that includes a user interface built with [Tailwind CSS](https://tailwindcss.com). Unlike Fortify, Breeze publishes its routes and controllers directly into your application. This allows you to study and get comfortable with Laravel's authentication features before allowing Laravel Fortify to implement these features for you. +If you are new to Laravel, you may wish to explore [our application starter kits](/docs/{{version}}/starter-kits) before attempting to use Laravel Fortify. Our starter kits provide an authentication scaffolding for your application that includes a user interface built with [Tailwind CSS](https://tailwindcss.com). This allows you to study and get comfortable with Laravel's authentication features before allowing Laravel Fortify to implement these features for you. -Laravel Fortify essentially takes the routes and controllers of Laravel Breeze and offers them as a package that does not include a user interface. This allows you to still quickly scaffold the backend implementation of your application's authentication layer without being tied to any particular frontend opinions. +Laravel Fortify essentially takes the routes and controllers of our application starter kits and offers them as a package that does not include a user interface. This allows you to still quickly scaffold the backend implementation of your application's authentication layer without being tied to any particular frontend opinions. ### When Should I Use Fortify? @@ -91,7 +91,7 @@ php artisan migrate ### Fortify Features -The `fortify` configuration file contains a `features` configuration array. This array defines which backend routes / features Fortify will expose by default. If you are not using Fortify in combination with [Laravel Jetstream](https://jetstream.laravel.com), we recommend that you only enable the following features, which are the basic authentication features provided by most Laravel applications: +The `fortify` configuration file contains a `features` configuration array. This array defines which backend routes / features Fortify will expose by default. We recommend that you only enable the following features, which are the basic authentication features provided by most Laravel applications: ```php 'features' => [ diff --git a/frontend.md b/frontend.md index 638a5b468b..839caf9dcc 100644 --- a/frontend.md +++ b/frontend.md @@ -102,7 +102,7 @@ If you're new to Laravel, we recommend getting familiar with the basic usage of ### Starter Kits -If you would like to build your frontend using PHP and Livewire, you can leverage our Breeze or Jetstream [starter kits](/docs/{{version}}/starter-kits) to jump-start your application's development. Both of these starter kits scaffold your application's backend and frontend authentication flow using [Blade](/docs/{{version}}/blade) and [Tailwind](https://tailwindcss.com) so that you can simply start building your next big idea. +If you would like to build your frontend using PHP and Livewire, you can leverage our [Livewire starter kit](/docs/{{version}}/starter-kits) to jump-start your application's development. ## Using Vue / React @@ -175,12 +175,12 @@ As you can see, Inertia allows you to leverage the full power of Vue or React wh #### Server-Side Rendering -If you're concerned about diving into Inertia because your application requires server-side rendering, don't worry. Inertia offers [server-side rendering support](https://inertiajs.com/server-side-rendering). And, when deploying your application via [Laravel Forge](https://forge.laravel.com), it's a breeze to ensure that Inertia's server-side rendering process is always running. +If you're concerned about diving into Inertia because your application requires server-side rendering, don't worry. Inertia offers [server-side rendering support](https://inertiajs.com/server-side-rendering). And, when deploying your application via [Laravel Cloud](https://cloud.laravel.com) or [Laravel Forge](https://forge.laravel.com), it's a breeze to ensure that Inertia's server-side rendering process is always running. ### Starter Kits -If you would like to build your frontend using Inertia and Vue / React, you can leverage our Breeze or Jetstream [starter kits](/docs/{{version}}/starter-kits#breeze-and-inertia) to jump-start your application's development. Both of these starter kits scaffold your application's backend and frontend authentication flow using Inertia, Vue / React, [Tailwind](https://tailwindcss.com), and [Vite](https://vitejs.dev) so that you can start building your next big idea. +If you would like to build your frontend using Inertia and Vue / React, you can leverage our [React or Vue application starter kits](/docs/{{version}}/starter-kits) to jump-start your application's development. Both of these starter kits scaffold your application's backend and frontend authentication flow using Inertia, Vue / React, [Tailwind](https://tailwindcss.com), and [Vite](https://vitejs.dev) so that you can start building your next big idea. ## Bundling Assets @@ -189,7 +189,7 @@ Regardless of whether you choose to develop your frontend using Blade and Livewi By default, Laravel utilizes [Vite](https://vitejs.dev) to bundle your assets. Vite provides lightning-fast build times and near instantaneous Hot Module Replacement (HMR) during local development. In all new Laravel applications, including those using our [starter kits](/docs/{{version}}/starter-kits), you will find a `vite.config.js` file that loads our light-weight Laravel Vite plugin that makes Vite a joy to use with Laravel applications. -The fastest way to get started with Laravel and Vite is by beginning your application's development using [Laravel Breeze](/docs/{{version}}/starter-kits#laravel-breeze), our simplest starter kit that jump-starts your application by providing frontend and backend authentication scaffolding. +The fastest way to get started with Laravel and Vite is by beginning your application's development using [our application starter kits](/docs/{{version}}/starter-kits), which jump-starts your application by providing frontend and backend authentication scaffolding. > [!NOTE] > For more detailed documentation on utilizing Vite with Laravel, please see our [dedicated documentation on bundling and compiling your assets](/docs/{{version}}/vite). diff --git a/horizon.md b/horizon.md index 6bec738bc6..3fa78e39a5 100644 --- a/horizon.md +++ b/horizon.md @@ -277,7 +277,7 @@ sudo apt-get install supervisor ``` > [!NOTE] -> If configuring Supervisor yourself sounds overwhelming, consider using [Laravel Forge](https://forge.laravel.com), which will automatically install and configure Supervisor for your Laravel projects. +> If configuring Supervisor yourself sounds overwhelming, consider using [Laravel Cloud](https://cloud.laravel.com), which can manage background processes for your Laravel applications. #### Supervisor Configuration diff --git a/installation.md b/installation.md index b6c1591328..7acf69704d 100644 --- a/installation.md +++ b/installation.md @@ -31,9 +31,6 @@ Laravel strives to provide an amazing developer experience while providing power Whether you are new to PHP web frameworks or have years of experience, Laravel is a framework that can grow with you. We'll help you take your first steps as a web developer or give you a boost as you take your expertise to the next level. We can't wait to see what you build. -> [!NOTE] -> New to Laravel? Check out the [Laravel Bootcamp](https://bootcamp.laravel.com) for a hands-on tour of the framework while we walk you through building your first Laravel application. - ### Why Laravel? @@ -49,7 +46,7 @@ If you're a senior developer, Laravel gives you robust tools for [dependency inj Laravel is incredibly scalable. Thanks to the scaling-friendly nature of PHP and Laravel's built-in support for fast, distributed cache systems like Redis, horizontal scaling with Laravel is a breeze. In fact, Laravel applications have been easily scaled to handle hundreds of millions of requests per month. -Need extreme scaling? Platforms like [Laravel Vapor](https://vapor.laravel.com) allow you to run your Laravel application at nearly limitless scale on AWS's latest serverless technology. +Need extreme scaling? Platforms like [Laravel Cloud](https://cloud.laravel.com) allow you to run your Laravel application at nearly limitless scale. #### A Community Framework @@ -379,9 +376,6 @@ Now that you have created your Laravel application, you may be wondering what to How you want to use Laravel will also dictate the next steps on your journey. There are a variety of ways to use Laravel, and we'll explore two primary use cases for the framework below. -> [!NOTE] -> New to Laravel? Check out the [Laravel Bootcamp](https://bootcamp.laravel.com) for a hands-on tour of the framework while we walk you through building your first Laravel application. - ### Laravel the Full Stack Framework @@ -400,6 +394,3 @@ If you are using Laravel as a full stack framework, we also strongly encourage y Laravel may also serve as an API backend to a JavaScript single-page application or mobile application. For example, you might use Laravel as an API backend for your [Next.js](https://nextjs.org) application. In this context, you may use Laravel to provide [authentication](/docs/{{version}}/sanctum) and data storage / retrieval for your application, while also taking advantage of Laravel's powerful services such as queues, emails, notifications, and more. If this is how you plan to use Laravel, you may want to check out our documentation on [routing](/docs/{{version}}/routing), [Laravel Sanctum](/docs/{{version}}/sanctum), and the [Eloquent ORM](/docs/{{version}}/eloquent). - -> [!NOTE] -> Need a head start scaffolding your Laravel backend and Next.js frontend? Laravel Breeze offers an [API stack](/docs/{{version}}/starter-kits#breeze-and-next) as well as a [Next.js frontend implementation](https://github.com/laravel/breeze-next) so you can get started in minutes. diff --git a/octane.md b/octane.md index 343eb97d93..3149aa86c9 100644 --- a/octane.md +++ b/octane.md @@ -262,7 +262,7 @@ By default, applications running via Octane generate links prefixed with `http:/ ### Serving Your Application via Nginx > [!NOTE] -> If you aren't quite ready to manage your own server configuration or aren't comfortable configuring all of the various services needed to run a robust Laravel Octane application, check out [Laravel Forge](https://forge.laravel.com). +> If you aren't quite ready to manage your own server configuration or aren't comfortable configuring all of the various services needed to run a robust Laravel Octane application, check out [Laravel Cloud](https://cloud.laravel.com), which offers fully-managed Laravel Octane support. In production environments, you should serve your Octane application behind a traditional web server such as Nginx or Apache. Doing so will allow the web server to serve your static assets such as images and stylesheets, as well as manage your SSL certificate termination. diff --git a/queues.md b/queues.md index aae4cba466..49897fb118 100644 --- a/queues.md +++ b/queues.md @@ -2004,7 +2004,7 @@ sudo apt-get install supervisor ``` > [!NOTE] -> If configuring and managing Supervisor yourself sounds overwhelming, consider using [Laravel Forge](https://forge.laravel.com), which will automatically install and configure Supervisor for your production Laravel projects. +> If configuring and managing Supervisor yourself sounds overwhelming, consider using [Laravel Cloud](https://cloud.laravel.com), which provides a fully-managed platform for running Laravel queue workers. #### Configuring Supervisor diff --git a/releases.md b/releases.md index 42a95163b1..d0c418ea02 100644 --- a/releases.md +++ b/releases.md @@ -48,5 +48,23 @@ For all Laravel releases, bug fixes are provided for 18 months and security fixe ## Laravel 12 -This version of Laravel is in active development. +Laravel 12 continues the improvements made in Laravel 11.x by updating upstream dependencies and introducing new starter kits for React, Vue, and Livewire, including the option of using [WorkOS AuthKit](https://authkit.com) for user authentication. The WorkOS variant of our starter kits offers social authentication, passkeys, and SSO support. + + +### Mimimal Breaking Changes + +Much of our focus during this release cycle has been minimizing breaking changes. Instead, we have dedicated ourselves to shipping continual quality of life improvements throughout the year that do not break existing applications. + +Therefore, the Laravel 12 release is a relatively minor "maintenance release" in order to upgrade existing dependencies. In light of this, most Laravel applications may upgrade to Laravel 12 without changing any application code. + + +### New Application Starter Kits + +Laravel 12 introduces new [application starter kits](/docs/{{version}}/starter-kits) for React, Vue, and Livewire. The React and Vue starter kits utilize Inertia 2, TypeScript, [shadcn/ui](https://ui.shadcn.com), and Tailwind, while the Livewire starter kits utilizes the Tailwind based [Flux UI](https://fluxui.dev) component library and Laravel Volt. + +The React, Vue, and Livewire starter kits all utilize Laravel's built-in authentication system to offer login, registration, password reset, email verification, and more. In addition, we are introducing a [WorkOS AuthKit](https://authkit.com) powered variant of each starter kit, offering social authentication, passkeys, and SSO support. WorkOS offers free authentication for applications up to 1 million monthly active users. + +With the introduction of our new application starter kits, Laravel Breeze and Laravel Jetstream will no longer receive additional updates. + +To get started with our new starter kits, check out the [starter kit documentation](/docs/{{version}}/starter-kits). diff --git a/scheduling.md b/scheduling.md index 3b63243b16..9e038dbd25 100644 --- a/scheduling.md +++ b/scheduling.md @@ -437,7 +437,7 @@ Schedule::daily() Now that we have learned how to define scheduled tasks, let's discuss how to actually run them on our server. The `schedule:run` Artisan command will evaluate all of your scheduled tasks and determine if they need to run based on the server's current time. -So, when using Laravel's scheduler, we only need to add a single cron configuration entry to our server that runs the `schedule:run` command every minute. If you do not know how to add cron entries to your server, consider using a service such as [Laravel Forge](https://forge.laravel.com) which can manage the cron entries for you: +So, when using Laravel's scheduler, we only need to add a single cron configuration entry to our server that runs the `schedule:run` command every minute. If you do not know how to add cron entries to your server, consider using a managed platform such as [Laravel Cloud](https://cloud.laravel.com) which can manage the scheduled task execution for you: ```shell * * * * * cd /path-to-your-project && php artisan schedule:run >> /dev/null 2>&1 diff --git a/starter-kits.md b/starter-kits.md index acff95f6f4..9d5314872e 100644 --- a/starter-kits.md +++ b/starter-kits.md @@ -1,132 +1,352 @@ # Starter Kits - [Introduction](#introduction) -- [Laravel Breeze](#laravel-breeze) - - [Installation](#laravel-breeze-installation) - - [Breeze and Blade](#breeze-and-blade) - - [Breeze and Livewire](#breeze-and-livewire) - - [Breeze and React / Vue](#breeze-and-inertia) - - [Breeze and Next.js / API](#breeze-and-next) -- [Laravel Jetstream](#laravel-jetstream) +- [Creating an Application Using a Starter Kit](#creating-an-application) +- [Available Starter Kits](#available-starter-kits) + - [React](#react) + - [Vue](#vue) + - [Livewire](#livewire) +- [Starter Kit Customization](#starter-kit-customization) + - [React](#react-customization) + - [Vue](#vue-customization) + - [Livewire](#livewire-customization) +- [WorkOS AuthKit Authentication](#workos) +- [Frequently Asked Questions](#faqs) ## 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. +To give you a head start building your new Laravel application, we are happy to offer [application starter kits](https://laravel.com/starter-kits). These starter kits give you a head start on building your next Laravel application, and include 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 + +## Creating an Application Using a Starter Kit -[Laravel Breeze](https://github.com/laravel/breeze) is a minimal, simple implementation of all of Laravel's [authentication features](/docs/{{version}}/authentication), 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. +To create a new Laravel application using one of our starter kits, you should first [install PHP and the Laravel CLI tool](/docs/{{version}}/installation#installing-php). If you already have PHP and Composer installed, you may install the Laravel installer CLI tool via Composer: -Laravel Breeze's default view layer is made up of simple [Blade templates](/docs/{{version}}/blade) styled with [Tailwind CSS](https://tailwindcss.com). Additionally, Breeze provides scaffolding options based on [Livewire](https://livewire.laravel.com) or [Inertia](https://inertiajs.com), with the choice of using Vue or React for the Inertia-based scaffolding. +```shell +composer global require laravel/installer +``` + +Then, create a new Laravel application using the Laravel installer CLI. The Laravel installer will prompt you to select your preferred starter kit: + +```shell +laravel new my-app +``` + +After creating your Laravel application, you only need to install its frontend dependencies via NPM and start the Laravel development server: + +```shell +cd my-app +npm install && npm run build +composer run dev +``` + +Once you have started the Laravel development server, your application will be accessible in your web browser at [http://localhost:8000](http://localhost:8000). + + +## Available Starter Kits + + +### React + +Our React starter kit provides a robust, modern starting point for building Laravel applications with a React frontend using [Inertia](https://inertiajs.com). + +Inertia allows you to build modern, single-page React applications using classic server-side routing and controllers. This lets you enjoy the frontend power of React combined with the incredible backend productivity of Laravel and lightning-fast Vite compilation. + +The React starter kit utilizes React 19, TypeScript, Tailwind, and the [shadcn/ui](https://ui.shadcn.com) component library. + + +### Vue + +Our Vue starter kit provides a great starting point for building Laravel applications with a Vue frontend using [Inertia](https://inertiajs.com). + +Inertia allows you to build modern, single-page Vue applications using classic server-side routing and controllers. This lets you enjoy the frontend power of Vue combined with the incredible backend productivity of Laravel and lightning-fast Vite compilation. + +The Vue starter kit utilizes the Vue Composition API, TypeScript, Tailwind, and the [shadcn-vue](https://www.shadcn-vue.com/) component library. + + +### Livewire - +Our Livewire starter kit provides the perfect starting point for building Laravel applications with a [Laravel Livewire](https://livewire.laravel.com) frontend. -#### Laravel Bootcamp +Livewire is a powerful way of building dynamic, reactive, frontend UIs using just PHP. It's a great fit for teams that primarily use Blade templates and are looking for a simpler alternative to JavaScript-driven SPA frameworks like React and Vue. -If you're new to Laravel, feel free to jump into the [Laravel Bootcamp](https://bootcamp.laravel.com). 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. +The Livewire starter kit utilizes Laravel Volt, Tailwind, and the [Flux UI](https://fluxui.dev) component library. - -### Installation + +## Starter Kit Customization -First, you should [create a new Laravel application](/docs/{{version}}/installation). If you create your application using the [Laravel installer](/docs/{{version}}/installation#creating-a-laravel-project), you will be prompted to install Laravel Breeze during the installation process. Otherwise, you will need to follow the manual installation instructions below. + +### React -If you have already created a new Laravel application without a starter kit, you may manually install Laravel Breeze using Composer: +Our React starter kit is built with Inertia 2, React 19, Tailwind 4, and [shadcn/ui](https://ui.shadcn.com). As with all of our starter kits, all of the backend and frontend code exists within your application to allow for full customization. + +The majority of the frontend code is located in the `resources/js` directory. You are free to modify any of the code to customize the appearance and behavior of your application: + +```text +resources/js/ +├── components/ # Reusable React components +├── hooks/ # React hooks +├── layouts/ # Application layouts +├── lib/ # Utility functions and configuration +├── pages/ # Page components +└── types/ # TypeScript definitions +``` + +To publish additional shadcn components, first [find the component you want to publish](https://ui.shadcn.com). Then, publish the component using `npx`: ```shell -composer require laravel/breeze --dev +npx shadcn@latest add switch ``` -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. +In this example, the command will publish the Switch component to `resources/js/components/ui/switch.tsx`. Once the component has been published, you can use it in any of your pages: -The `breeze:install` command will prompt you for your preferred frontend stack and testing framework: +```jsx +import { Switch } from "@/components/ui/switch" -```shell -php artisan breeze:install +const MyPage = () => { + return ( +
+ +
+ ); +}; -php artisan migrate -npm install -npm run dev +export default MyPage; ``` - -### Breeze and Blade + +#### Available Layouts -The default Breeze "stack" is the Blade stack, which utilizes simple [Blade templates](/docs/{{version}}/blade) 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: +The React starter kit includes two different primary layouts for you choose from: a "sidebar" layout and a "header" layout. The sidebar layout is the default, but you can switch to the header layout by modifying the layout that is imported at the top of your application's `resources/js/layouts/app-layout.tsx` file: -```shell -php artisan breeze:install +```js +import AppLayoutTemplate from '@/layouts/app/app-sidebar-layout'; // [tl! remove] +import AppLayoutTemplate from '@/layouts/app/app-header-layout'; // [tl! add] +``` + + +#### Sidebar Variants + +The sidebar layout includes three different variants: the default sidebar variant, the "inset" variant, and the "floating" variant. You may choose the variant you like best by modifying the `resources/js/components/app-sidebar.tsx` component: -php artisan migrate -npm install -npm run dev +```text + [tl! remove] + [tl! add] ``` -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. + +#### Authentication Page Layout Variants -> [!NOTE] -> To learn more about compiling your application's CSS and JavaScript, check out Laravel's [Vite documentation](/docs/{{version}}/vite#running-vite). +The authentication pages included with the React starter kit, such as the login page and registration page, also offer three different layout variants: "simple", "card", and "split". - -### Breeze and Livewire +To change your authentication layout, modify the layout that is imported at the top of your application's `resources/js/layouts/auth-layout.tsx` file: + +```js +import AuthLayoutTemplate from '@/layouts/auth/auth-simple-layout'; // [tl! remove] +import AuthLayoutTemplate from '@/layouts/auth/auth-split-layout'; // [tl! add] +``` -Laravel Breeze also offers [Livewire](https://livewire.laravel.com) scaffolding. Livewire is a powerful way of building dynamic, reactive, front-end UIs using just PHP. + +### Vue -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. +Our Vue starter kit is built with Inertia 2, Vue 3 Composition API, Tailwind, and [shadcn-vue](https://www.shadcn-vue.com/). As with all of our starter kits, all of the backend and frontend code exists within your application to allow for full customization. -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: +The majority of the frontend code is located in the `resources/js` directory. You are free to modify any of the code to customize the appearance and behavior of your application: + +```text +resources/js/ +├── components/ # Reusable Vue components +├── composables/ # Vue composables / hooks +├── layouts/ # Application layouts +├── lib/ # Utility functions and configuration +├── pages/ # Page components +└── types/ # TypeScript definitions +``` + +To publish additional shadcn-vue components, first [find the component you want to publish](https://www.shadcn-vue.com). Then, publish the component using `npx`: ```shell -php artisan breeze:install +npx shadcn-vue@latest add switch +``` + +In this example, the command will publish the Switch component to `resources/js/components/ui/Switch.vue`. Once the component has been published, you can use it in any of your pages: -php artisan migrate +```vue + + + ``` - -### Breeze and React / Vue + +#### Available Layouts -Laravel Breeze also offers React and Vue scaffolding via an [Inertia](https://inertiajs.com) frontend implementation. Inertia allows you to build modern, single-page React and Vue applications using classic server-side routing and controllers. +The Vue starter kit includes two different primary layouts for you choose from: a "sidebar" layout and a "header" layout. The sidebar layout is the default, but you can switch to the header layout by modifying the layout that is imported at the top of your application's `resources/js/layouts/AppLayout.vue` file: -Inertia lets you enjoy the frontend power of React and Vue combined with the incredible backend productivity of Laravel and lightning-fast [Vite](https://vitejs.dev) compilation. To use an Inertia stack, you may select the Vue or React frontend stacks when executing the `breeze:install` Artisan command. +```js +import AppLayout from '@/layouts/app/AppSidebarLayout.vue'; // [tl! remove] +import AppLayout from '@/layouts/app/AppHeaderLayout.vue'; // [tl! add] +``` -When selecting the Vue or React frontend stack, the Breeze installer will also prompt you to determine if you would like [Inertia SSR](https://inertiajs.com/server-side-rendering) or TypeScript support. After Breeze's scaffolding is installed, you should also compile your application's frontend assets: + +#### Sidebar Variants -```shell -php artisan breeze:install +The sidebar layout includes three different variants: the default sidebar variant, the "inset" variant, and the "floating" variant. You may choose the variant you like best by modifying the `resources/js/components/AppSidebar.vue` component: -php artisan migrate -npm install -npm run dev +```text + [tl! remove] + [tl! add] ``` -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. + +#### Authentication Page Layout Variants - -### Breeze and Next.js / API +The authentication pages included with the Vue starter kit, such as the login page and registration page, also offer three different layout variants: "simple", "card", and "split". -Laravel Breeze can also scaffold an authentication API that is ready to authenticate modern JavaScript applications such as those powered by [Next](https://nextjs.org), [Nuxt](https://nuxt.com), and others. To get started, select the API stack as your desired stack when executing the `breeze:install` Artisan command: +To change your authentication layout, modify the layout that is imported at the top of your application's `resources/js/layouts/AuthLayout.vue` file: -```shell -php artisan breeze:install +```js +import AuthLayout from '@/layouts/auth/AuthSimpleLayout.vue'; // [tl! remove] +import AuthLayout from '@/layouts/auth/AuthSplitLayout.vue'; // [tl! add] +``` -php artisan migrate + +### Livewire + +Our Livewire starter kit is built with Livewire 3, Laravel Volt, Tailwind, and [Flux UI](https://fluxui.dev/). As with all of our starter kits, all of the backend and frontend code exists within your application to allow for full customization. + +The majority of the frontend code is located in the `resources/views` directory. You are free to modify any of the code to customize the appearance and behavior of your application: + +```text +resources/views +├── components # Reusable Livewire components +├── flux # Customized Flux components +├── livewire # Livewire pages +├── partials # Reusable Blade partials +├── dashboard.blade.php # Authenticated user dashboard +├── welcome.blade.php # Guest user welcome page ``` -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 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. + +#### Available Layouts + +The Livewire starter kit includes two different primary layouts for you choose from: a "sidebar" layout and a "header" layout. The sidebar layout is the default, but you can switch to the header layout by modifying the layout that is used by your application's `resources/views/components/layouts/app.blade.php` file. In addition, you should add the `container` attribute to the main Flux component: + +```blade + + + {{ $slot }} + + +``` + + +#### Authentication Page Layout Variants + +The authentication pages included with the Livewire starter kit, such as the login page and registration page, also offer three different layout variants: "simple", "card", and "split". + +To change your authentication layout, modify the layout that is used by your application's `resources/views/components/layouts/auth.blade.php` file: + +```blade + + {{ $slot }} + +``` - -#### Next.js Reference Implementation + +## WorkOS AuthKit Authentication + +By default, the React, Vue, and Livewire starter kits all utilize Laravel's built-in authentication system to offer login, registration, password reset, email verification, and more. In addition, we also offer a [WorkOS AuthKit](https://authkit.com) powered variant of each starter kit that offers: + +
+ +- Social authentication (Google, Microsoft, GitHub, and Apple) +- Passkey authentication +- Email based "Magic Auth" +- SSO + +
+ +Using WorkOS as your authentication provider [requires a WorkOS account](https://workos.com). WorkOS offers free authentication for applications up to 1 million monthly active users. + +To use WorkOS AuthKit as your application's authentication provider, select the WorkOS option when creating your new starter kit powered application via `laravel new`. + +### Configuring Your WorkOS Starter Kit + +After creating a new application using a WorkOS powered starter kit, you should set the `WORKOS_CLIENT_ID`, `WORKOS_API_KEY`, and `WORKOS_REDIRECT_URL` environment variables in your application's `.env` file. These variables should match the values provided to you in the WorkOS dashboard for your application: + +```ini +WORKOS_CLIENT_ID=your-client-id +WORKOS_API_KEY=your-api-key +WORKOS_REDIRECT_URL="${APP_URL}/authenticate" +``` -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](https://github.com/laravel/breeze-next). This frontend is maintained by Laravel and contains the same user interface as the traditional Blade and Inertia stacks provided by Breeze. + +#### Configuring AuthKit Authentication Methods - -## Laravel Jetstream +When using a WorkOS powered starter kit, we recommend that you disable "Email + Password" authentication within your application's WorkOS AuthKit configuration settings, allowing users to only authenticate via social authentication providers, passkeys, "Magic Auth", and SSO. This allows your application to totally avoid handling user passwords. -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.** + +#### Configuring AuthKit Session Timeouts + +In addition, we recommend that you configure your WorkOS AuthKit session inactivity timeout to match your Laravel application's configured session timeout threshold, which is typically two hours. + + +### Frequently Asked Questions + + +#### How do I upgrade? + +Every starter kit gives you a solid starting point for your next application. With full ownership of the code, you can tweak, customize, and build your application exactly as you envision. However, there is no need to update the starter kit itself. + + +#### How do I enable email verification? + +Email verification can be added by by uncommenting the `MustVerifyEmail` import in your `App/Models/User.php` model and ensuring the model implements the `MustVerifyEmail` interface: + +```php +group(function () { + Route::get('dashboard', function () { + return Inertia::render('dashboard'); + })->name('dashboard'); +}); +``` + +> [!NOTE] +> Email verification is not required when using the [WorkOS](#workos) variant of the starter kits. + + +#### How do I modify the default email template? + +You may want to customize the default email template to better align with your application's branding. To modify this template, you should publish the email views to your application with the following command: + +``` +php artisan vendor:publish --tag=laravel-mail +``` -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](https://tailwindcss.com) and offers your choice of [Livewire](https://livewire.laravel.com) or [Inertia](https://inertiajs.com) driven frontend scaffolding. +This will generate several files in `resources/views/vendor/mail`. You can modify any of these files as well as the `resources/views/vendor/mail/themes/default.css` file to change the look and appearance of the default email template. -Complete documentation for installing Laravel Jetstream can be found within the [official Jetstream documentation](https://jetstream.laravel.com). diff --git a/structure.md b/structure.md index 669241f1fd..e1b62d043f 100644 --- a/structure.md +++ b/structure.md @@ -32,9 +32,6 @@ The default Laravel application structure is intended to provide a great starting point for both large and small applications. But you are free to organize your application however you like. Laravel imposes almost no restrictions on where any given class is located - as long as Composer can autoload the class. -> [!NOTE] -> New to Laravel? Check out the [Laravel Bootcamp](https://bootcamp.laravel.com) for a hands-on tour of the framework while we walk you through building your first Laravel application. - ## The Root Directory diff --git a/upgrade.md b/upgrade.md index 9c5d64fa7c..90192fa701 100644 --- a/upgrade.md +++ b/upgrade.md @@ -7,16 +7,7 @@
-- TBD - -
- - -## Medium Impact Changes - -
- -- TBD +- [Updating Dependencies](#updating-dependencies)
@@ -25,15 +16,17 @@
-- TBD +- [Carbon 3](#carbon-3) +- [Concurrency Result Index Mapping](#concurrency-result-index-mapping) +- [Image Validation Now Excludes SVGs](#image-validation) +- [Nested Array Request Merging](#nested-array-request-merging)
## Upgrading To 12.0 From 11.x - -#### Estimated Upgrade Time: ?? Minutes +#### Estimated Upgrade Time: 5 Minutes > [!NOTE] > We attempt to document every possible breaking change. Since some of these breaking changes are in obscure parts of the framework only a portion of these changes may actually affect your application. Want to save time? You can use [Laravel Shift](https://laravelshift.com/) to help automate your application upgrades. @@ -51,7 +44,66 @@ You should update the following dependencies in your application's `composer.jso + +#### Carbon 3 + +**Likelihood Of Impact: Low** + +Support for [Carbon 2.x](https://carbon.nesbot.com/docs/) has been removed. All Laravel 12 applications now require Carbon 3.x. + + +### Concurrency + + +#### Concurrency Result Index Mapping + +**Likelihood Of Impact: Low** + +When invoking the `Concurrency::run` method with an associative array, the results of the concurrent operations are now returned with their associated keys: + +```php +$result = Concurrency::run([ + 'task-1' => fn () => 1 + 1, + 'task-2' => fn () => 2 + 2, +]); + +// ['task-1' => 2, 'task-2' => 4] +``` + + +### Requests + + +#### Nested Array Request Merging + +**Likelihood Of Impact: Low** + +The `$request->mergeIfMissing()` method now allows merging nested array data using "dot" notation. If you were previously relying on this method to create a top-level array key containing the "dot" notation version of the key, you may need to adjust your application to account for this new behavior: + +```php +$request->mergeIfMissing([ + 'user.last_name' => 'Otwell', +]); +``` + + +### Validation + + +#### Image Validation Now Excludes SVGs + +The `image` validation rule no longer allows SVG images by default. If you would like to allow SVGs when using the `image` rule, you must explicitly allow them: + +```php +use Illuminate\Validation\Rules\File; + +'photo' => 'required|image:allow_svg' + +// Or... +'photo' => ['required', File::image(allowSvg: true)], +``` + ### Miscellaneous -We also encourage you to view the changes in the `laravel/laravel` [GitHub repository](https://github.com/laravel/laravel). While many of these changes are not required, you may wish to keep these files in sync with your application. Some of these changes will be covered in this upgrade guide, but others, such as changes to configuration files or comments, will not be. You can easily view the changes with the [GitHub comparison tool](https://github.com/laravel/laravel/compare/11.x...master) and choose which updates are important to you. +We also encourage you to view the changes in the `laravel/laravel` [GitHub repository](https://github.com/laravel/laravel). While many of these changes are not required, you may wish to keep these files in sync with your application. Some of these changes will be covered in this upgrade guide, but others, such as changes to configuration files or comments, will not be. You can easily view the changes with the [GitHub comparison tool](https://github.com/laravel/laravel/compare/11.x...12.x) and choose which updates are important to you. diff --git a/views.md b/views.md index cc55a97243..6c03fa37bb 100644 --- a/views.md +++ b/views.md @@ -45,7 +45,7 @@ Route::get('/', function () { Instead of writing their frontend templates in PHP via Blade, many developers have begun to prefer to write their templates using React or Vue. Laravel makes this painless thanks to [Inertia](https://inertiajs.com/), a library that makes it a cinch to tie your React / Vue frontend to your Laravel backend without the typical complexities of building an SPA. -Our Breeze and Jetstream [starter kits](/docs/{{version}}/starter-kits) give you a great starting point for your next Laravel application powered by Inertia. In addition, the [Laravel Bootcamp](https://bootcamp.laravel.com) provides a full demonstration of building a Laravel application powered by Inertia, including examples in Vue and React. +Our [React and Vue application starter kits](/docs/{{version}}/starter-kits) give you a great starting point for your next Laravel application powered by Inertia. ## Creating and Rendering Views diff --git a/vite.md b/vite.md index 7bdd9b9e10..7ab83151fd 100644 --- a/vite.md +++ b/vite.md @@ -347,7 +347,7 @@ export default defineConfig({ ``` > [!NOTE] -> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Vue, and Vite configuration. Check out [Laravel Breeze](/docs/{{version}}/starter-kits#breeze-and-inertia) for the fastest way to get started with Laravel, Vue, and Vite. +> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Vue, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, Vue, and Vite. ### React @@ -385,7 +385,7 @@ You will also need to include the additional `@viteReactRefresh` Blade directive The `@viteReactRefresh` directive must be called before the `@vite` directive. > [!NOTE] -> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, React, and Vite configuration. Check out [Laravel Breeze](/docs/{{version}}/starter-kits#breeze-and-inertia) for the fastest way to get started with Laravel, React, and Vite. +> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, React, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, React, and Vite. ### Inertia @@ -410,7 +410,7 @@ createInertiaApp({ If you are using Vite's code splitting feature with Inertia, we recommend configuring [asset prefetching](#asset-prefetching). > [!NOTE] -> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia, and Vite configuration. Check out [Laravel Breeze](/docs/{{version}}/starter-kits#breeze-and-inertia) for the fastest way to get started with Laravel, Inertia, and Vite. +> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, Inertia, and Vite. ### URL Processing @@ -761,7 +761,7 @@ php artisan inertia:start-ssr ``` > [!NOTE] -> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia SSR, and Vite configuration. Check out [Laravel Breeze](/docs/{{version}}/starter-kits#breeze-and-inertia) for the fastest way to get started with Laravel, Inertia SSR, and Vite. +> Laravel's [starter kits](/docs/{{version}}/starter-kits) already include the proper Laravel, Inertia SSR, and Vite configuration.These starter kits offer the fastest way to get started with Laravel, Inertia SSR, and Vite. ## Script and Style Tag Attributes