#### Category : laravel-livewire

My users can create multiple usercar‘s when selecting from a database of car‘s. I need to grab the selected car values, but when I dd the values, I get a Property [id] does not exist on the Eloquent builder instance. error. wire:model="car_id" is the select input value used in the code below. AddUserCar.php … class ..

I have a multi-step form where a user can add cars to their profile. The first step is where the car is created and the relationship is established between the user and usercar. The first step works as it should, but it doesn’t establish and or retain a connection to the usercar in subsequent steps. ..

I’ve problem on refreshing model collection after detach on Laravel livewire. I want to remove detached item from view without refresh full page, but it seem not work. it need to refresh full page to re render the view. I have tried to $model->refresh() after detach(), and its work but$model->refresh() duplicate already loaded relationship ..

I am trying to implement Logout functionality on my Laravel app with TALL stack, I am firing logout event from my blade via Livewire wire:click but it doesn’t seem to fire any method from its own component. Loading my component in app.blade.php layout: <li class="flex"> @livewire(‘logout’) </li> logout.blade.php <a wire:click="logout" class="some-classes" > <svg class="w-4 h-4 ..

I have some troubles to drag items. I only can drag and drop it, if the item is bellow of the item root. I want to drag items frelly, for example, i want to drag let say the last item of 4 and put it in the first place, on top. Example of what i ..

I’d like to be able to get the errorBag from a livewire component within JS after receiving the message.processed hook. Unfortunately, the errorBag is protected so I’m a bit stuck. Does anyone know how it can be done? This is as far as I’ve got Livewire.hook("message.processed", (message, component) => { let comp = Livewire.find(component.el.getAttribute("wire:id")) console.log(comp.get(‘errorBag’)) ..

I am trying to trigger a livewire function from a wire:click in a datatables array. This system works fine but only for the first datatable page. Nothing is triggered in the 2nd page or higher. Here is my code : event.php : public function showEvent($eventId) { return redirect()->route(‘events.show’, [$eventId]); } event.blade.php : <table class="table align-items-center ..

That’s not a breaking-mind thing but it’s really annoying: public function render(){ return view(‘home’)->extends(‘layout.app’)->section(‘content’); } The error is Undefined method ‘extends’. That’s not even the only "fake error" i get but it’s the only one in this project. Does anyone know how to fix that? Sourc..

I have a Calendar component where I need to change the date on the frontend. The Calendar is generated on the server and the HTML is sent to Blade. I initialize the Calendar in the mount() function and I expect it to stay initialized. However, when I update the "date" field, I get the error: ..

In Laravel, I’m using livewire to dynamically render parts of an HTML form. The main form is a regular Laravel blade file and is not a Livewire component. However, the values of the fields in the livewire sub-form are missing in the $request variable when the form is submitted. snippet of the edit.blade.ph containing the .. Read more Hye, i need help with foreign keys during form submission. it seems like the fk is not working, the id is not copy and paste in the table that has fk this is my adds.php <?php namespace AppHttpLivewire; use LivewireComponent; use AppCustomer; use AppOrder; use AppTransaction; use AppWireTransfer; class Adds extends Component { public$transactDate; ..

I’m trying to paginate items in a livewire component, I have this query public $franchiseList; public function getFranchises($coords) { if ($coords) {$latitude = json_decode($coords)[0];$longitude = json_decode($coords)[1];$radiusInMeters = 800; $this->franchiseList = Franchise::select(DB::raw(‘*, ( 6371000 * acos( cos( radians(‘ .$latitude . ‘) ) * cos( radians( latitude ) ) * cos( radians( longitude ..

I have a method scoup scopeCalculateMaxPositionSelectedCategory in my Model Category class Category extends Model { use HasFactory; protected $fillable = [ ‘parent_id’, ‘name’, ‘slug’, ‘description’, ‘position’, ‘quantity_available_offers’, ]; public function scopeCalculateMaxPositionSelectedCategory($query, $cat_id = null) { return$query->where(‘parent_id’, $cat_id)->max(‘position’); } } When i call like that it’s work fine: Category::CalculateMaxPositionSelectedCategory(); But i want do this that .. Read more i have a problem where the value isn’t calculated. I have function where the user able to update Weight/size and quantity(if the input isn’t in readonly). When the user enter a new weight/size it will be auto-calculated in the Order Total. Apparently, there is a value already in the Order Total (since it is an .. Read more i am still new with laravel and livewire. I wanna make sure the user select in the dropdown and the value will in the textbox appear based on the user selection here is the code that i did some… Adds.php use AppCustomer; use AppOrder; class Adds extends Component { public$transactDate; public $orderT; public$amount; ..

i’m trying to build a polls system using livewire but i got some errors here is my blade @foreach ($questions as$index => $question) <div class="row"> <div class="box-header with-border"> <i class="fa fa-question-circle text-black fs-20 me-10"></i> <h4 class="box-title">{{$question->title }}</h4> </div> <div class="box-body"> <div class="demo-radio-button"> @foreach ($answers as$key => $answer) <input wire:model="question{{$question->id }}" type="radio" ..

I have two forms one is uploading the images and saving them to the database, After saving its return Images ids. The second form is my main form and I want to use that image’s id in the parent form as an input file. Here is the main page HTML (Parent Form):- <div class="container mt-5"> ..

If i got to this point I honestly skimmed and tried every example possible. My other option is to use intervention but if this is an option in file pond it should work. I honestly needs a new set of eye as maybe I am missing something. The Problem The issues is that files are ..

My search box is able to search by using id of the product and display related row of data, I wish to do same for searching by product name. But for searching by product name, a list is needed to appear of the related names to select product. Clicking on a particular Item from the ..

I’ve made a modal using bootstrap and livewire that displays a message after the user clicks the submit button. The modal form then displays a message to the user showing a message as shown . Now I want the message to disappear after a 3 seconds but I can’t manage to make that happen. I’ve ..

i am using livewire , laravel 7. Below is the code. How to make sure the input is readonly when the value is empty? <div class="col-md-3 mb-3"> <label class="form-control-label" >Quantity*opt</label> @if ( $quantity === null) <input type="text" name="" value="" wire:model="serviceOrder.{{$loop->index }}.quantity" class="form-control" readonly > @else <input type="text" name="" value="" wire:model="serviceOrder.{{ $loop->index }}.quantity" class="form-control" > .. Read more First, let me show you my problem before explaining it. I use wire:model.lazy="date" to define the date, but whenever livewire detects the execute. The page switches back to it’s default layout. Which means the d-none class is removed from the class I clicked on. Is their a way to prevent this? Sourc.. Read more I am changing rule property in mount method. but when i again using rules in other method its not maintaining state. createAccount method is called from button using wire:click. class CreateUsers extends Component { use PasswordValidationRules; public User$user; protected \$rules = [ ‘user.name’ => [‘required’, ‘string’, ‘max:255’], ‘user.username’ => [‘required’, ‘string’, ‘max:255’], ‘user.confirm_password’ => ..