News Articles laravel-livewire

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-flow-col auto-cols-max gap-4 mb-5"> @foreach ($files as $file) <livewire:file :file="$file"/> @endforeach </div> Uploading one or multiple files at once works fine. But while uploading when there […]

livewire – Alpine js get tag input as array

I’ve found a really cool tag input code with alpine js and tailwind css. It works just fine, but when I try to send it with my form, I always get the last tag only. I’d like to push them into an array and send along with the other elements in the form, but I […]

How to get data only if the data is not filled in front-end using livewire and alpinejs?

For using less resources I want to fetch data from the server (using livewire) only for the first time and the other times to use the already fetched data in alpinejs. So if there is a change in my <select>, the fillStates will be triggered: <select wire:model="selectedCountry" name="selectedCountry" id="selectedCountry" wire:change="fillStates"> <option value="">Select Country</option> @foreach($this->countries as […]

In laravel livewire i am trying to access the Gyroscope data of the device thats viewing the page. but i don’t know how?

i have been trying for a while but can’t seem too get it right any ideas? site like https://developer.mozilla.org/en-US/docs/Web/API/Gyroscope dont seem to help get any further in solving this problem Source: JavaSript – Stack Overflow

Livewire invalid arrow-function arguments on action

I’m testing out Livewire with a Laravel shopping cart plugin. To add items to the cart you call a function, passing in id, name, quantity, price, and an optional array of metadata: <button wire:click.prevent="addToCart(‘{{ $id }}’, ‘{{ $product_name}}’, 1, {{ $price }}, [‘size’ => ‘{{ $size }}’])">Add to Cart</button> The rendered HTML looks perfect, but […]

Implement realtime application by livewire and Alpinejs or Laravel and Vuejs?

Please help with choosing the right tool for the project I am about to undertake (I apologize for the length of the text beforehand) I am on the verge of starting a project that I really need to choose the right tools for the front-end. The back-end framework will be Laravel, but since I was […]

Laravel Active checkbox father and child

I’m tying to active child checkbox when I active checkbox father <table class="table table-report mt-2"> <!– checkbox father –> <div class="grid grid-cols-5"> <div wire:loading.class="pointer-events-none" class="text-center tooltip" tooltip="{{ __(‘Pay to All’) }}"> <p> <strong> {{ __(‘Active All’) }} </strong> </p> <input wire:loading.attr="disabled" id="active_all" type="checkbox" class="input input–switch " > </div> </div> <thead> <tr> <th class="text-center">{{ __(‘Pay Wage’) […]

Table made out of divs fixed headers but no scroll on x axis with the table

I am using this package that creates a table in Livewire and uses divs to create the table itself. I am trying to create a header so to speak that is fixed and contains a few buttons and the table’s header. It relatively works with class="fixed", but the x-axis scroll is nowhere to be found. […]

Only a buyer can rate the product in Livewire:Laravel

I’m using Livewire rating system in my Laravel ecommerce application. Right now any user can rate and comment on any product. I want only the buyers can rate and comment. ProductRatings.php class ProductRatings extends Component { public $rating; public $comment; public $currentId; public $product; public $hideForm; protected $rules = [ ‘rating’ => [‘required’, ‘in:1,2,3,4,5’], ‘comment’ […]

I’m using Laravel:Livewire star rating Components. I want to show total ratings in stars

The rating module is working well, number of ratings are also showing but I want to display total ratings in stars but I don’t know how to write in blade view. Livewire/ProductRating.php public $rating; public $comment; public $currentId; public $product; public $hideForm; protected $rules = [ ‘rating’ => [‘required’, ‘in:1,2,3,4,5’], ‘comment’ => ‘required’, ]; public […]

Laravel Jetstream Comparing Two Tables to change the background of the table

I am trying to make a table where a user have an organization and if the user doesnt have an organization yet the background for that cell will change. I am storing the data in a pivot table. I tried putting the user_id of the pivot table in an array and compare it in the […]

Laravel Livewire: Component in Foreach loop. Button Click shows on all items instead of Single item

I need some help with the Livewire Click function and loading a component into a foreach loop. When I click the play button, the component is displayed in all items in the loop. But I would like that it is only displayed in this one item where the button was clicked. Screenshot of issue I […]

Laravel Livewire’s render of Vue component

I really love the Vue multiselect package and therefore I created a Vue component that would allow me to use it in regular forms. Currently I’m creating a form with Livewire, where are 2 options for both from and to. So my blade looks similar to this: @if ($fromInvoiceableType == AppCar::class) <form-multiselect name="car_id" :list="{{ $cars}}" […]

amChart map not displaying after Laravel Livewire method is trigered

I have a Livewire component that contains an amCharts map. What I would like is some data to change when a country is clicked. Here is the component: <?php namespace AppHttpLivewire; use LivewireComponent; class Demo extends Component { protected $listeners = [ ‘setSelected’ ]; public $selected; public function mount() { $this->selected = ‘Global’; } public […]

amChart map not displaying after Laravel Livewire method is trigered

I have a Livewire component that contains an amCharts map. What I would like is some data to change when a country is clicked. Here is the component: <?php namespace AppHttpLivewire; use LivewireComponent; class Demo extends Component { protected $listeners = [ ‘setSelected’ ]; public $selected; public function mount() { $this->selected = ‘Global’; } public […]

amChart map not displaying after Laravel Livewire method is trigered

I have a Livewire component that contains an amCharts map. What I would like is some data to change when a country is clicked. Here is the component: <?php namespace AppHttpLivewire; use LivewireComponent; class Demo extends Component { protected $listeners = [ ‘setSelected’ ]; public $selected; public function mount() { $this->selected = ‘Global’; } public […]

Livewire component listen on Vue evnents?

for several hours I’m looking for a solution. I know a Vue componenent can listen on a Livewire event to be fired. But does it functino the other way arround? I need to use a Vue plugin (croppie). In order so get the croped image to the Livewire component I need to emit an event […]

Why is my js code suspended when executing click event in Livewire in Laravel 8?

I am in a project in Laravel 8 but I have a problem in one of the views. I am also using Livewire for reactivity, for example in the payment view I have created a multi-step or multi-step form that when I click on the continue button it takes me to the next step of […]

Sitemap | Terms | Privacy | Cookies | Advertising

Senior Software Developer

Creator of @LzoMedia I am a backend software developer based in London who likes beautiful code and has an adherence to standards & love's open-source.