install splade inertia magic blade in laravel 9

In this section we will install laravel Splade. Splade provides a super easy way to build Single Page Applications (SPA) using standard Laravel Blade templates, enhanced with renderless Vue 3 components. In essence, you can write your app using the simplicity of Blade, and besides that magic SPA-feeling, you can sparkle it to make it interactive. All without ever leaving Blade.

Create Laravel project

composer create-project laravel/laravel laravel-splade 

install laravel splade via composer:

composer require protonemedia/laravel-splade

Install splade file.

php artisan splade:install

Install npm dependency. 

npm install && npm run dev 

You can see root file splade


<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1">

    <body class="font-sans antialiased">


    <x-slot name="header">
        {{ __('Home') }}

    <x-panel class="flex flex-col items-center pt-16 pb-16">
        <x-application-logo class="block h-12 w-auto" />

        <div class="mt-8 text-2xl">
            Welcome to your Splade application!
laravel splade inertia magic blade in laravel 9

Run laravel and vite server

php artisan serve
npm run dev

For more details read laravel splade