Livewire 4 - Beta try it →

Upgrading to Livewire 4

Important

There are no changes in maryUI components.

This is about Livewire/Volt and has nothing to do with maryUI.

Do I need this?

If you use class-based components with Volt, yes.

# views/pages/users/show.blade.php
 
use Livewire\Volt\Component; // It extends from Volt
...
 
new class extends Component {
//...
}
# routes/web.php
 
Volt::route('/users/show', 'users.show');

What happened?

Now Livewire offers native support for class-based components. So, you need to remove Volt to avoid conflicts.

Upgrade

Install Livewire 4 Beta.

composer require livewire/livewire:^4.0@beta

Make all components to extend from Livewire\Component.

# views/pages/users/show.blade.php
 
-use Livewire\Volt\Component;
+use Livewire\Component;
...
 
new class extends Component {
// ...
}

Change the routes at routes/web.php

// Imports
-use Livewire\Volt\Volt;
...
 
// Routes
-Volt::route('/users/show', 'users.show');
+Route::livewire('/users/show', 'pages::users.show');
...

Move all the layout files.

`resources/views/components/layouts/*.blade.php` ➡️ `resources/views/layouts/*.blade.php

Change the path of the custom layouts, if you have it.

new
-#[Layout('components.layouts.custom')]
+#[Layout('layouts.custom')]
class extends Component {
// ...
};

Remove this entry at bootstrap/providers.php.

return [
App\Providers\AppServiceProvider::class,
- App\Providers\VoltServiceProvider::class,
...
];

Remove Volt.

rm app/providers/VoltServiceProvider.php
composer remove livewire/volt

Clear the cache.

php artisan config:clear
php artisan view:clear

Made with by Robson Tenório and contributors.