Category : laravel-livewire

Just trying out Livewire and I’ve gotten stuck along the way. I got to a stage where I need to pass a dom elements value, but unsure of the best practice in doing this, and if its even possible through livewire? View: <div> <textarea class="form-control mb-3" wire:keydown.enter="addComment(‘Guest’, ‘This textareas value here’)"></textarea> <hr> @foreach ($comments as ..

Read more

I’m trying to learn how to work with events and pusher, I’ve started with something very simple I am working with laravel 8 livewire. From pusher to view it works fine, but when I call the event from the component I get the error : https://flareapp.io/share/dmkzeG65#F77 View: <div> <div class="mt-20 col-span-2 editor mx-auto w-10/12 flex ..

Read more

I created a resourceful laravel livewire component instead of going the controller route and was wondering if this practice is a clean approach? I’ve also eliminated the render method and have 3 methods that display a view. the problem with this i’ve noticed is that the wire:submit.prevent wont work. for example: routes Route::resource(‘products’, ‘ProductComponent’); Component: ..

Read more

I have need to complete the functionality of rating start. In this code two Models use Post model and PostRate models. Post Model have three attributes like id, title, description PostRate have id, post_id, rate. I have make livewire Component Rate and Resource of rate <?php namespace AppHttpLivewire; use AppModelsPost; use AppModelsPostRate; use LivewireComponent; class ..

Read more

I have a fairly complex issue, I have an animal model class Animal extends Model { use HasFactory; protected $fillable = [ "breed_ID", "name", "color_ID", "eyes_color_ID", "birth_date", "animal_types_id", "born_location", "profile_picture_id", "gender_ID", "status", "image", "bio", "lenght", "weight", "passport_url", "chip_number", "breeder_ID", ]; protected function genders(): BelongsTo { return $this->belongsTo(Gender::class); } public function borns(): BelongsTo { return $this->belongsTo(Born::class); ..

Read more

Not sure what I’m missing here, but nothing I do seems to allow @push(‘styles’) or @push (‘scripts’) to work. layout/app.blade.php includes: … @livewireStyles … @livewireScripts … livewire/tagify.blade.php @push(‘styles’) <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@yaireo/[email protected]/dist/tagify.min.css"> @endpush @push(‘scripts’) <script src="https://cdn.jsdelivr.net/npm/@yaireo/[email protected]/dist/tagify.min.js"></script> <script> document.addEventListener("DOMContentLoaded", function(event) { var input = document.getElementById(‘tagify’) var tagify = new Tagify(input, { whitelist : [ @foreach($tags as $tag) ..

Read more

i’m trying to make a transition effect to text in livewire its working with {{ $html }} <p class="text-gray-600" x-data="{show: false}" x-show.transition.duration.1000ms="show" x-init="setTimeout(() => { show = true })" id="{{ $slide[‘current’][‘id’] }}c">{{ ‘<h1>hi</h1>’ }}</p> but it didn’t work with {!! $html !!}} <p class="text-gray-600" x-data="{show: false}" x-show.transition.duration.1000ms="show" x-init="setTimeout(() => { show = true })" id="{{ ..

Read more

so i have custom telplate using bootstrap , then my modal jestream covered / behind the navigation & sidebar.. how to set the modal infront of all layer? look at this screenshot : this is my modal confirm in blade file : <!– Delete User Confirmation Modal –> <x-jet-dialog-modal wire:model="confirmingUserDeletion"> <x-slot name="title"> {{ __(‘Hapus akun’) ..

Read more

I cannot solve this for the life of me. I have a list in my blade file that looks like: @foreach($interactions as $interaction) <div class="border rounded px-2 my-2 op-gray w-100"> <div class="d-flex flex-justify-between"> <div> <b class="fg-steel">{{$interaction->user->name ?? ‘Usuario No Existente’}}</b> <small class="">{{$interaction->created_at}}</small> </div> <span class="fg-steel">{{$interaction->InteractionType->type_name}} <small class="fg-green p-1 rounded">{{$interaction->InteractionType->status_name}}</small></span> </div> <div> {{$interaction->body}} </div> </div> @endforeach ..

Read more

Using livewire to control a form with some fields and image uploading capability <form enctype="multipart/form-data" class="flex justify-center" wire:submit.prevent="upload"> <input accept="image/*" wire:model="image.image" type="file" class="w-full h-full opacity-0 cursor-pointer" name="upload"> </form use AppModelsAnimal; use AppModelsImage; use LivewireComponent; use LivewireWithFileUploads; class AddAnimal extends Component { use WithFileUploads; public Animal $animal; public Image $image; protected array $rules = [ ‘animal.name’ ..

Read more

I have a select field with values from a table that I would like to compare with another table and mark as selected if a value matches. <select name="tour" class="form-control form-control-sm" wire:model="selectTour"> @foreach($touren as $tour) <option {{ $beleg->Tour == $tour->Gruppe ? ‘selected’ : ” }} value="{{ $tour->Gruppe }}">{{ $tour->Gruppe }}</option> @endforeach </select> If I now ..

Read more

After creating new Component in Livewire i have this html code into this comonent layout: <div> <form wire:submit.prevent="submit" method="POST"> @csrf <div class="form-group row"> <label class="col-form-label col-lg-3"> category name: <span class="text-danger">*</span> </label> <div class="col-lg-12"> <input wire:model="name" type="text" name="name" class="form-control"> </div> </div> <div class="text-right"> <div class="btn-group" role="group"> <button type="submit" class="btn btn-primary">create</button> </div> </div> </form> </div> and this ..

Read more

How to validate by showing a red ring around the radio button and make text red. Currently I am just showing a validation popup message. See image for a better idea. Radio component <input type="radio" {!! $attributes->merge([‘class’ => ‘border-gray-300 text-gray-600 shadow-sm focus:border-gray-300 focus:ring focus:ring-gray-200 focus:ring-opacity-50’]) !!}> Livewire view snippet <div class="space-y-5"> @foreach ($ticket_types as $ticket_type) ..

Read more