2,696 questions
33
votes
14
answers
125k
views
Laravel "Unable to locate a class or view for component" in production environment [duplicate]
I develop on a Mac locally. Latest version of Big Sur.
Today I went to deploy my app to production via an Ubuntu server through Forge, and got greeted with an error I've never seen before, and can't ...
17
votes
1
answer
41k
views
Laravel Livewire component not refreshing/reloading automatically after refreshing it
So, I'm currently using Laravel Livewire in one of my projects. But when I try emit an event from one component to another component by magic mathod $refresh , its refreshing (got the dom in xhr ...
16
votes
22
answers
39k
views
Livewire encountered corrupt data when trying to hydrate the … component
I am getting the following error and am a bit lost on it:
Livewire encountered corrupt data when trying to hydrate the …
component. Ensure that the [name, id, data] of the Livewire component
wasn’t ...
16
votes
4
answers
17k
views
Attribute [livewire] does not exist
I am having trouble to run my code on Laravel 8 routing with laravel-livewire.
The class is within Livewire\LandingPage.
The error I'm getting is
Attribute [livewire] does not exist
Here are my ...
16
votes
5
answers
37k
views
How disabled dark mode in tailwind css
I'm using the package laravel livewire table ([laravel livewire table][1]
[1]: https://github.com/rappasoft/laravel-livewire-tables) on my laravel app (v8).
I also use tailwind CSS on v3.
By default ...
16
votes
2
answers
57k
views
laravel livewire, how to pass the id or data to another component by click
I have two components Posts and Post, Posts show the posts and by clicking the image I want to show the data of clicked post in another component.
Posts class and component down below:
Component ...
15
votes
2
answers
20k
views
Laravel Livewire - How to force child component refresh
I'd like to refresh the child component when the parent is updated and only the child component of this component should update, because I'd like to reuse the child component somewhere else in the ...
14
votes
1
answer
12k
views
Unable to vite build for production in Laravel
I have a Laravel + Livewire app, that I'm trying to build for production.
I can successfully run ./vendor/bin/sail npm run build:
./vendor/bin/sail npm run build
> build
> vite build
vite v3.2....
14
votes
14
answers
40k
views
Livewire 404: GET http://localhost/livewire/livewire.js net::ERR_ABORTED 404 (Not Found)
I'm learning how to use livewire and laravel, I was trying to bind some data through an input
I wrote this code:
home.blade.php:
<html>
<head>
<title>Home</title>
@...
14
votes
2
answers
47k
views
How to refresh the component after the queue job is finished?
I have a table products and job_statuses using this package: laravel-job-status
There is a column in job_statuses called status the package made this column finished once the queue job is finished!
So ...
14
votes
4
answers
24k
views
Laravel Livewire error "must not be accessed before initialization"
I try to using Livewire Binding Directly To Model Properties, and i get this error, Anyone help please ? Thank in advance.
Typed property App\Http\Livewire\V2\Settings\Locations::$country must not be ...
13
votes
6
answers
24k
views
Laravel Livewire errors are not cleared
I am experimenting with Laravel Livewire and I came across a situation where the previous errors are displayed even though the form is successfully submitted.
Before hit Save
After hitting Save
Html ...
13
votes
3
answers
58k
views
Livewire how to $emit event on select change (wire:model)
Livewire how to $emit event on <select> change (wire:model)
I need to fire event (fetch some data from DB in another component) on simple <select> change.
<select id="hall" ...
12
votes
5
answers
48k
views
Force a full page reload in Livewire
I use Livewire and Alpine with Laravel 8.
I have a page with a Datatable (jQuery) and a Bootstrap modal.
The table is filled with some data from a list of model instances.
When I click on a button in ...
10
votes
6
answers
47k
views
laravel Livewire wire:click not firing the function
I want to do a SPA with laravel livewire, i want to use wire:click to fire a funtion in the component but it not working , excuse me if the code mess its my first time posting here and i am not sure ...
10
votes
3
answers
9k
views
Laravel Livewire error when I add a constructor to call a service class
I've got a piece of code I want to reuse. I've read this Laravel cleaner code article and this other Laravel Services Pattern article, where I have realized I can reuse code in several places of the ...
9
votes
1
answer
12k
views
Laravel Livewire, communication between two livewire components
I have 2 livewire components, 1st only displays the session variable of the cart and the 2nd one is just to add items in cart (a very raw form with sku, title, price and qty).
<livewire:...
9
votes
3
answers
9k
views
How to apply loading state only to particular component in livewire
I'm using Laravel Livewire in my project, I use wire:loading for loading the state while clicking. I iterated all the tasks in foreach loop but the loading state applies for all components. Here is ...
8
votes
2
answers
11k
views
How to re-init the AlpineJS component after Livewire re-renders?
I have an alert component that I hide using AlpineJS but I want it to be visible again after Livewire re-renders.
Showing the alert using Livewire component
@if(Session::has('success'))
<x-...
8
votes
1
answer
10k
views
How to make flatpickr datepicker reactive in livewire / alpinejs app?
In my laravel 7 /livewire 1.3 / alpinejs 2 project
I added flatpickr datepicker from https://flatpickr.js.org
datepicker works ok, but reactive does not work. In the code below
$current_operation_date ...
8
votes
11
answers
26k
views
Why Laravel-livewire 'wire:model' not working?
I am using Laravel 8.
My Livewire Controller
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class SearchDropdown extends Component
{
public $search = 'hello there';
public ...
8
votes
2
answers
9k
views
What does it mean to hydrate and dehydrate a Laravel Livewire component?
Could someone point me to a definition of "hydrate" and "dehydrate" as it applies to Livewire components? The only hit in the documentation search refers to
Livewire will take ...
8
votes
2
answers
19k
views
Livewire wire:model on Select Option not working properly
I have a dropdown using wire:model
<div class="form-group">
<label>Menu</label>
<select wire:model="chapter_id" class="form-control @error('...
8
votes
1
answer
4k
views
How to undo Inertia.js from my Laravel application
I have a problem with undoing Inertia.js in my application. When I started my application, I accidentally typed both commands.
php artisan jetstream:install inertia --teams
After a while when I saw ...
8
votes
1
answer
9k
views
scroll to top of page - livewire component - alpine js
I have an app created with laravel livewire where I'm loading a livewire component with multiple nested components that display one at a time depending upon a status variable. When each nested ...
7
votes
1
answer
10k
views
dompdf not downloading PDF from Laravel 8 and a Livewire View
I am using dompdf in my Laravel v8.26.1 app. I am also using Laravel Livewire v1.3.5.
I can get a view to download a pdf outside of Livewire, but can't seem to get it to work inside a Livewire view. ...
7
votes
4
answers
12k
views
Laravel-livewire: Why does firing an event execute the render() method?
This is the Livewire framework for Laravel
HTML:
<button wire:click="$emit('postAdded')">
PHP:
protected $listeners = ['postAdded' => 'showPostAddedMessage'];
public function ...
7
votes
2
answers
7k
views
Laravel 8 Jetstream || Undefined variable: _instance (View: C:\xampp\htdocs\veye-website\resources\views\vendor\jetstream\components\modal.blade.php
I am trying to use Laravel 8 Livewire Modal Popup for data entry with going on another page. But I get undefine the variable _instance and not able to understand it.
@entangle($attributes->wire('...
7
votes
6
answers
31k
views
Livewire: Unable to call component method. Public method [childMethodName] not found on component: [parent]
Using Laravel Livewire, I have a parent and a (repeating) child. The child blade has a call to childMethod() through wire:click="childMethod()".
The problem is that parent->childMethod() ...
6
votes
5
answers
8k
views
Is there a proper way to wire up Trix editor with Livewire?
When wiring together Trix editor content with Livewire, I am stumbling into problems. I believe that the issue is that when Livewire receives content from Trix, the content is swapped out and Trix ...
6
votes
4
answers
12k
views
Laravel livewire model is not working when updating input field from javascript?
I have a text input field which works great if I update it myself when typing inside it, however, what I need is to have this input field be populated with data from javascript, rather than the user.
...
6
votes
5
answers
5k
views
laravel livewire exception: Queueing collections with multiple model connections is not supported
I´m beggining my Livewire journey and have created a list component which contains a form component for each of the list elements, and as I am trying to make it all work I keep getting the following ...
6
votes
1
answer
7k
views
Livewire turns collection into array
In mount() function of livewire component I have a collection, whick looks like this:
$this->products = $purchase->getProductsList();
getProductsList() is a function of Purchase model:
public ...
6
votes
1
answer
6k
views
How to call livewire method in template?
In the component of Laravel 8 / livewire 2 app I selected state(code_id) and I need to preview state and I try to make it with
calling method of the component :
{{ getStateLabel($form['state_id']) }}
...
6
votes
2
answers
5k
views
How to include a livewire component in another livewire component
I have a livewire overview component that contains a couple of cards. In those cards there is a livewire form, however when I include the form into the overview component my entire livewire stops ...
6
votes
3
answers
19k
views
Livewire - Multiple root elements detected
I'm creating a table, whose rows are wrapped inside a livewire component
<div class="card">
<div class="card-body">
<table class="table table-hover ...
6
votes
1
answer
2k
views
Livewire and Flatpickr - fails after rerender
This may be a basic question, but I'm struggling. Essentially I have a livewire component that updates an array of flight information that a user enters. Whenever the components get rerendered, the ...
6
votes
3
answers
5k
views
How to use select2 multiselect with livewire
What I am trying to achieve is, there are two models A and B with a relationship of One to many, where A has many B. So if the records for A and B have already been created, A can be assigned to many ...
6
votes
1
answer
1k
views
Error Bag disappears from a Laravel Livewire Blade template
The following piece of PHP code works to capture input from a Livewire form. The form updates a user's password, and for the keen-eyed amongst you, you may find that large sections of it are taken ...
6
votes
2
answers
3k
views
Getting 404 for livewire/message/{component}
I had this issue which was fixed by running php artisan vendor:publish --force -tag=livewire:assets but then when Livewire is trying to Hydrate, and post to livewire/message/MY_COMPONENT, it still ...
6
votes
4
answers
3k
views
getting 404 modal when I do click event on Laravel livewire
I have started using livewire but I can't make it work im using a wire:click to load a form either on create mode or edit mode, but when I did click all I got was some sort of modal with 404 error
...
5
votes
5
answers
15k
views
laravel - livewire Full-Page Components
I use laravel 8.
I define protected namespace in RouteServiceProvider:
protected $namespace = 'App\Http\Controllers';
then use livewire with the below route:
Route::get('/xxx' , App\Http\Livewire\...
5
votes
3
answers
13k
views
Uncaught (in promise) TypeError: Cannot read properties of null (reading 'fingerprint') Laravel Livewire
I've made a multiple file-upload component using Laravel Livewire. After the upload is complete I want to display the uploaded files without reloading the page, like so:
<div class="grid grid-...
5
votes
6
answers
9k
views
Bootstrap select not working after Laravel livewire render
I have a Bootstrap selectpicker element that works fine on the first render. It's initialized with:
$(document).ready(function () {
$('select').selectpicker();
});
But after livewire's render ...
5
votes
3
answers
12k
views
Laravel Livewire: load livewire component with button click
There are 3 livewire components UserIsExpired, UserIsActive and UserIsPending and 3 buttons respective to each component. When a button is clicked, it should replace previous component with its ...
5
votes
4
answers
5k
views
How to upload images using Laravel Livewire and Spatie media library?
I am using Laravel Livewire and Spatie media library and I couldn't find anything helpful on both of their documentation on how to do this.
am trying this but it gave me error
$this->menu->...
5
votes
1
answer
5k
views
Laravel live wire accordion collapsing on input change
I am using accordion something like this
https://www.tailwindtoolbox.com/components/accordion and I have a input field inside my accordion
<div class="tab-content overflow-y-scroll border-l-2 ...
5
votes
4
answers
39k
views
A Livewire component was not found after creating a component in a custom path
As stated in the docs, you can create a component in a custom path, which is different from the default views/livewire/ and Http/Livewire. Just for the sake of better organization, I created ...
5
votes
1
answer
9k
views
Laravel Livewire: Components or Controllers? [closed]
I'm learning to use Livewire, and I see that I can use Components like Controllers, so far I have been able to manage views, data, and make some CRUD operations with Route Model Binding inside ...
5
votes
1
answer
8k
views
How to modify Laravel Jetstream login
I am using Larave Jetstream livewire and I want to modify the login.
login from having a hidden input field "is_admin" with an initial value of 1
when a user submits login form backend check ...