livewire.js and flux.js is not found in Laravel 12 register page.
Livewire.js and Flux.js are not included by default in Laravel 12's register.blade.php
file. To use Livewire and Flux in your Laravel project, you need to install them separately and then include them in your register.blade.php
file.
First, let's install Livewire.js using composer:
composer require livewire/livewire
Next, you need to publish the Livewire styles and scripts:
php artisan livewire:install
Now, you can start using Livewire components in your Laravel project. To use Livewire in your register.blade.php
file, you need to include the Livewire script at the end of the file:
@extends('layouts.app')
@section('content')
<div class="container">
<livewire:register />
</div>
@stack('scripts')
<script src="{{ mix('js/app.js') }}"></script>
@endsection
Here, we are using a Livewire component called register
and including it inside the container div. We are also including the app.js
file that was generated during the Livewire installation.
As for Flux.js, it is a different library used for unidirectional data flow in React applications. Laravel does not use React by default, so Flux.js is not included in Laravel out of the box. If you are building a Laravel application using React and Flux, you need to install Flux separately using npm or yarn.
Once you have installed Flux, you can include it in your register.blade.php
file using a CDN or by publishing the Flux assets:
@extends('layouts.app')
@section('content')
<div class="container">
<livewire:register />
<!-- Include Flux.js -->
<script src="https://unpkg.com/flux/dist/flux.min.js"></script>
<script src="https://unpkg.com/flux-react/umd/FluxReact.min.js"></script>
</div>
@stack('scripts')
<script src="{{ mix('js/app.js') }}"></script>
@endsection
Here, we are including the Flux and Flux-React libraries using a CDN. You can also publish the assets using the npm run build
command and then include the dist
folder in your Laravel project.
I hope this answers your question! Let me know if you have any further questions or if there's anything else I can help you with.