### Publish Jetstream Inertia Authentication Pages Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Artisan command to publish the new Vue-based authentication pages for Jetstream 2.0's Inertia stack. ```Bash php artisan vendor:publish --tag=jetstream-inertia-auth-pages ``` -------------------------------- ### Upgrade Laravel Jetstream Dependency to 5.x Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Upgrade the `laravel/jetstream` dependency in your application's `composer.json` file to version `^5.0` and then run `composer update` to install the new version and its dependencies. ```Shell composer update ``` -------------------------------- ### Upgrade Laravel Jetstream Dependency to 3.x Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Upgrade the `laravel/jetstream` dependency in your application's `composer.json` file to version `^3.0` and then run `composer update` to install the new version and its dependencies. ```Shell composer update ``` -------------------------------- ### Include Livewire Styles and Scripts in Guest Layout Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Add `@livewireStyles` and `@livewireScripts` directives to `resources/views/layouts/guest.blade.php` to ensure Alpine.js, which is bundled with Livewire 3, is properly loaded for guest components. ```Blade @vite(['resources/css/app.css', 'resources/js/app.js']) + + + @livewireStyles
{{ $slot }}
+ + @livewireScripts ``` -------------------------------- ### Publish Laravel Jetstream Views Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md This command publishes all of Jetstream's default views to your application's 'resources/views/vendor/jetstream' directory, allowing for customization. It should be run before upgrading if views haven't been published already. ```Shell php artisan vendor:publish --tag=jetstream-views ``` -------------------------------- ### Upgrade Laravel Jetstream Dependency to 4.x Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Upgrade the `laravel/jetstream` dependency in your application's `composer.json` file to version `^4.0` and then run `composer update` to install the new version and its dependencies. ```Shell composer update ``` -------------------------------- ### Uninstall laravel-jetstream NPM Package Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md NPM command to uninstall the `laravel-jetstream` package. This package is no longer required as of Jetstream 2.0, as its functionalities are now integrated into Inertia itself. ```Bash npm uninstall laravel-jetstream ``` -------------------------------- ### Publish Jetstream Views Before Upgrade Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Before upgrading to Jetstream 3.x, publish all of Jetstream's views using the `vendor:publish` Artisan command with the `jetstream-views` tag. This step can be skipped if views are already published. ```Shell php artisan vendor:publish --tag=jetstream-views ``` -------------------------------- ### Generate Database Migration for Team Invitations Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md This Artisan command creates a new database migration file for the 'team_invitations' table. This table is necessary for the new team invitation functionality introduced in Jetstream 2.x. ```Shell php artisan make:migration create_team_invitations_table ``` -------------------------------- ### Clear Laravel View Cache Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md After making changes to Blade views, clear the Laravel view cache to ensure the updated views are used by the application. ```Shell php artisan view:clear ``` -------------------------------- ### Configure Fortify to Render Blade Authentication Views Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md PHP code to be added to the `boot` method of your application's `JetstreamServiceProvider` class. This allows you to continue rendering Blade-based authentication views with Laravel Fortify in Jetstream 2.x, defining custom view paths for various authentication flows. ```PHP use Illuminate\Http\Request; use Illuminate\Support\Facades\Route; use Laravel\Fortify\Fortify; Fortify::loginView(function () { return view('auth/login', [ 'canResetPassword' => Route::has('password.request'), 'status' => session('status'), ]); }); Fortify::requestPasswordResetLinkView(function () { return view('auth/forgot-password', [ 'status' => session('status'), ]); }); Fortify::resetPasswordView(function (Request $request) { return view('auth/reset-password', [ 'email' => $request->input('email'), 'token' => $request->route('token'), ]); }); Fortify::registerView(function () { return view('auth/register'); }); Fortify::verifyEmailView(function () { return view('auth/verify-email', [ 'status' => session('status'), ]); }); Fortify::twoFactorChallengeView(function () { return view('auth/two-factor-challenge'); }); Fortify::confirmPasswordView(function () { return view('auth/confirm-password'); }); ``` -------------------------------- ### Remove InertiaForm Import from app.js Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md JavaScript code snippet that should be removed from your `resources/js/app.js` file. The `laravel-jetstream` NPM package is no longer necessary as of Jetstream 2.0, as its features have been incorporated directly into Inertia. ```JavaScript import {InertiaForm} from 'laravel-jetstream'; Vue.use(InertiaForm); ``` -------------------------------- ### Clear Laravel View Cache (Inertia Stack) Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md After moving mail views for the Inertia stack, clear the Laravel view cache to ensure the application uses the correct view paths. ```Shell php artisan view:clear ``` -------------------------------- ### Register New Jetstream Team Actions in Service Provider Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md This PHP code snippet demonstrates how to register the new 'InviteTeamMember' and 'RemoveTeamMember' actions with Jetstream. These actions should be placed in the 'app/Actions/Jetstream' directory and then registered within the 'boot' method of 'JetstreamServiceProvider'. ```PHP use App\Actions\Jetstream\InviteTeamMember; use App\Actions\Jetstream\RemoveTeamMember; Jetstream::inviteTeamMembersUsing(InviteTeamMember::class); Jetstream::removeTeamMembersUsing(RemoveTeamMember::class); ``` -------------------------------- ### Upgrade Laravel Jetstream Composer Dependency Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md This command updates the 'laravel/jetstream' package to version '^2.0' in your application's 'composer.json' file and resolves its dependencies. It's a crucial step for upgrading Jetstream. ```Shell composer update ``` -------------------------------- ### Define Schema for Team Invitations Database Table Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md This PHP code defines the schema for the 'team_invitations' database table. It includes fields for 'id', 'team_id' (foreign key), 'email', 'role', and timestamps, ensuring proper storage for team invitation data. ```PHP id(); $table->foreignId('team_id')->constrained()->cascadeOnDelete(); $table->string('email')->unique(); $table->string('role')->nullable(); $table->timestamps(); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('team_invitations'); } } ``` -------------------------------- ### Remove `jet-` Prefix from Jetstream Component Views Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md Update Blade views by removing the `jet-` prefix from Jetstream component tags and properties, such as `` becoming `` and `jet-dropdown-link` becoming `dropdown-link`. ```Blade - + - + - @props(['team', 'component' => 'jet-dropdown-link']) + @props(['team', 'component' => 'dropdown-link']) ``` -------------------------------- ### Update User Access in Laravel Jetstream Inertia Views Source: https://github.com/laravel/jetstream/blob/5.x/UPGRADE.md This snippet shows the necessary changes to access the authenticated user object in Laravel Jetstream views, specifically for Inertia. It demonstrates updating '$page.props.user' to '$page.props.auth.user' and 'usePage().props.user' to 'usePage().props.auth.user' (or 'usePage().props.value.user' to 'usePage().props.value.auth.user' for older Inertia versions). ```Diff - + - leaveTeamForm.delete(route('team-members.destroy', [props.team, usePage().props.user])); + leaveTeamForm.delete(route('team-members.destroy', [props.team, usePage().props.auth.user])); - leaveTeamForm.delete(route('team-members.destroy', [props.team, usePage().props.value.user])); + leaveTeamForm.delete(route('team-members.destroy', [props.team, usePage().props.value.auth.user])); ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.