Skip to content

Livewire rework

Intro

In the rework, a lot of things have been removed, or made optional (referred to as legacy.)
This page shows an overview of changes to take into account when updating to a newer version.

Changes

View files moved and deprecated

Previously a lot of blade files were being added to new projects, most of which are not used. The files linger around the project since no-one is sure if they can be cleaned up. The new setup ships as few files as needed, and works on an "add as needed" basis. Coping a few lines of code from well written docs is easier and faster than removing files, and testing the application still functions as expected.

This rigorous approach as the drawback of having removed too much. Having development tools stripped in newer version is a terrible experience for developers, as such we added a way to add these files back into your projects. The following command redeploys the latest version of legacy components to your views folder. These are not used internally by the package except for legacy features that are to be replaced with newer Livewire versions.

bash
php artisan vendor:publish --tag=qore-frontend-views-legacy

Below is a list of views that have been removed. Project already having these stubs deployed, should not be affected.
If during development you are missing any files, look in this list. If legacy features are throwing missing view exceptions look in this list.

  • ./api/api-token-manager.blade.php
  • ./api/index.blade.php
  • ./auth/confirm-password.blade.php
  • ./auth/forgot-password.blade.php
  • ./auth/login.blade.php
  • ./auth/register.blade.php
  • ./auth/reset-password.blade.php
  • ./auth/two-factor-challenge.blade.php
  • ./auth/verified-email.blade.php
  • ./auth/verify-email.blade.php
  • ./auth/welcome.blade.php
  • ./components/action-message.blade.php
  • ./components/action-section.blade.php
  • ./components/authentication-card-logo.blade.php
  • ./components/authentication-card.blade.php
  • ./components/banner.blade.php
  • ./components/button.blade.php
  • ./components/checkbox.blade.php
  • ./components/confirmation-modal.blade.php
  • ./components/confirms-password.blade.php
  • ./components/danger-button.blade.php
  • ./components/dialog-modal.blade.php
  • ./components/footer.blade.php
  • ./components/form-section.blade.php
  • ./components/head.blade.php
  • ./components/input-error.blade.php
  • ./components/input.blade.php
  • ./components/label.blade.php
  • ./components/modal.blade.php
  • ./components/secondary-button.blade.php
  • ./components/section-border.blade.php
  • ./components/section-title.blade.php
  • ./components/switchable-team.blade.php
  • ./pages/policy.blade.php
  • ./pages/search.blade.php
  • ./pages/terms.blade.php
  • ./profile/delete-user-form.blade.php
  • ./profile/logout-other-browser-sessions-form.blade.php
  • ./profile/show.blade.php
  • ./profile/two-factor-authentication-form.blade.php
  • ./profile/update-password-form.blade.php
  • ./profile/update-profile-information-form.blade.php
  • ./welcome.blade.php

Adding legacy routes

The routing file has had an aggressive cleanup, just like the views. In the newer version, all routes are scoped to 'application.portal'. This reduces then need for extra Route::group() calls and nesting in the route file. Additionally it makes it hard to register routes that are not portal routes inside the routes/poral.php file, as they are now scoped properly.

With the new livewire setup, separate GET and POST routes for a single feature have been deprecated, favoring the usage of livewire classes instead. Unfortunately older projects might relly on these routes being available for authentication or other features. The goal is to replace these with new livewire routes, but not all features have been reworked yet. At the bottom of the routes/portal.php is a list of legacy routes that can be enabled as needed. These are registered in the same way, the previous route file did this. The main difference, they have been moved to a seperate file.

QoreFrontendRouting::legacyRoutes($this->application); can be used to register all older routes. If only a subsection is needed, select these features in list of options below.

php
use QoreWorksBusiness\QoreFrontend\Facades\QoreFrontendRouting;

// OLDER ROUTING
/*
    Views are no longer stubbed for there routes.
    Older project can use these to keep existing functionality working until we rework them properly with livewire.
*/
QoreFrontendRouting::legacyRoutes($this->application);
QoreFrontendRouting::legacyAuthenticationRoutes($this->application);
QoreFrontendRouting::legacyPasswordResetRoutes($this->application);
QoreFrontendRouting::legacyRegistrationRoutes($this->application);
QoreFrontendRouting::legacyEmailVerificationRoutes($this->application);
QoreFrontendRouting::legacyProfileRoutes($this->application);
QoreFrontendRouting::legacyPasswordRoutes($this->application);
QoreFrontendRouting::legacyPasswordConfirmationRoutes($this->application);
QoreFrontendRouting::legacyTwoFactorRoutes($this->application);
QoreFrontendRouting::legacyEntryRoutes($this->application);

Middleware changes

Middleware aliases are being used as opposed to using an ever expanding config file. See the middleware setup for more information