PHP code example of rahmanramsi / livewire-spa

1. Go to this page and download the library: Download rahmanramsi/livewire-spa library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

rahmanramsi / livewire-spa example snippets


<html>
<head>
    ...
    @livewireStyles
    @livewireSpaStyles
</head>
<body>

    {{ $slot }}

    @livewireScripts
    @livewireSpaScripts
</body>
</html>

return [

  'path' => 'spa',

  'layout' => 'layouts.app',

  'single_page' => \Rahmanramsi\LivewireSpa\Http\Livewire\SinglePage::class,

  'pages' => [
    'default' => null,
    'error' => \Rahmanramsi\LivewireSpa\Http\Livewire\Pages\ErrorPage::class,
    'namespace' => 'App\\Http\\LivewireSpa',
    'path' => app_path('Http/LivewireSpa'),
    'register' => [],
  ],

  'middleware' => ['web'],

  'livewire' => [
    'namespace' => 'App\\Http\\LivewireSpa',
    'path' => app_path('Http/LivewireSpa'),
  ],
];
bash
php artisan vendor:publish --tag="livewire-spa-config"
bash
php artisan make:livewire-spa PageName
bash
php artisan make:livewire-spa SubFolder/PageName