Category : laravel-livewire

i’m having a Clinic(id,name,&services from service class on it ) and when i need to store my services on database it saved normally but with an empty array without my services data here is my view <form class="form-horizontal" wire:submit.prevent="storeClinic"> <div class="form-group"> <label class="col-md-4 control-label">اسم العيادة</label> <div class="col-md-4"> <input type="text" placeholder="اسم العيادة" id="name" name="name" class="form-control input-md" ..

Read more

i am trying to show a modal when i click the edit button so i added the wire:click : <td class="py-3 px-6 text-left"> <div class="flex items-center"> <span class="font-medium">{{ $project->project }}</span> </div> </td> <td class="py-3 px-6 text-left"> <div class="flex items-center"> <span>{{ $project->username }}</span> </div> </td> <td class="py-3 px-6 text-center"> <span class="bg-{{ $project->status_color }}-200 text-{{ $project->status_color }}-600 ..

Read more

I’m trying to show a modal when I click the edit button, so I added wire:click : <td class="py-3 px-6 text-left"> <div class="flex items-center"> <span class="font-medium">{{ $project->project }}</span> </div> </td> <td class="py-3 px-6 text-left"> <div class="flex items-center"> <span>{{ $project->username }}</span> </div> </td> <td class="py-3 px-6 text-center"> <span class="bg-{{ $project->status_color }}-200 text-{{ $project->status_color }}-600 py-1 px-3 ..

Read more

I would like to ask your opinion on the best way to handle this situation, as I am quite new to these issues. I have a functionality that mixes try catchs and db::transactions like this: try { DB::transaction(function() { DB::insert(…); DB::insert(…); DB::insert(…); }); } catch (Throwable $th) { report($th->getMessage()); abort(500); } The problem is that ..

Read more

everyone. I encountered a problem during the development of laravel livewire alpinejs Tom-select / select2. There is no problem displaying one row by default. enter image description here When I dynamically add the number of rows, select cannot display and render normally. What should I do? enter image description here Here is my code: apphttplivewireEditor ..

Read more

I am trying to use DateRangePicker () in a livewire component (for your info, it is for a new contact’s birthdate). Here is my input: <input wire:model="birthdate" type="text" class="form-control daterange-single"> And here is the javascript: $(‘.daterange-single’).daterangepicker({ singleDatePicker: true, locale: { format: ‘YYYY-MM-DD’ } }); When using this input to create a new contact, it works ..

Read more

Based on https://laravel-news.com/livewire-v2-6-0, Livewire has supported deep model data binding. And I write the following codes to test the feature: $details = new Collection([ new Detail([‘quantity’ => 10, ‘amount’ => 5]), ]); $this->receive = new Receive; $this->receive->setRelation(‘details’, $details); <div> @foreach($receive->details as $index => $detail) <input type="text" wire:model="receive.details.{{ $index }}.quantity" wire:key="receive.details.{{ $index }}.quantity"> @endforeach </div> When ..

Read more

Making adminarea in Laravel 8 / livewire 2.5 / tailwindcss: 2.2 app I renamed file resources/views/layouts/app.blade.php into resources/views/layouts/admin.blade.php and fixed in View/Components/AppLayout.php : public function render() { return view(‘layouts.admin’); } and run commands : php artisan config:cache php artisan route:cache php artisan cache:clear php artisan view:clear php artisan clear-compiled composer dump-autoload but I still got ..

Read more

Making adminarea in Laravel 8 / livewire 2.5 / tailwindcss: 2.2 app I renamed file. resources/views/layouts/app.blade.php into resources/views/layouts/admin.blade.php and fixed in View/Components/AppLayout.php : public function render() { return view(‘layouts.admin’); } and run commands : php artisan config:cache php artisan route:cache php artisan cache:clear php artisan view:clear php artisan clear-compiled composer dump-autoload but I still got ..

Read more

Since laravel can use custom validation rules when using Request validation public function store(ModelStoreRequest $request) { // } is there a way to reuse a custom validation rules without using request ? I am using a livewire and it doesn’t need to use request. public function store() { $this->validate([ ‘foo’ => ‘required’ ]); } Source: ..

Read more

I am using select2 with livewire . livewire component is a bootstrap modal. I want to search customers from database using select2. I use remote data search method to do it. This is my blade file <div class=”modal fade” id=”customerReviewModalId” tabindex=”-1″ role=”dialog” aria-labelledby=”modelTitleId” aria-hidden=”true”> <div class=”modal-dialog” role=”document”> <div class=”modal-content”> <div class=”modal-header”> <h5 class=”modal-title”>Add Your Review</h5> ..

Read more

I am trying to import data from excel file. when i upload .csv file using livewire it convert to .txt file. here is my modal code for importing file: <x-jet-modal maxWidth="sm" wire:model="showImportDialog"> <form wire:submit.prevent="import" method="POST" enctype="multipart/form-data"> <div> <div class="text-lg">Import Users</div> </div> <div> <input type="file" wire:model="users" name="users" id="users" /> </div> <x-jet-button type="submit">Import</x-jet-button> </form> </x-jet-modal> and this ..

Read more

I tried to listen event emited from broadcast in laravel livewire but nothing happen; on my bootstrap.js i have: import Echo from ‘laravel-echo’; window.Pusher = require(‘pusher-js’); window.Echo = new Echo({ broadcaster: ‘pusher’, key: ‘myKey’, wsHost: window.location.hostname, wsPort: 6001, disableStat: true, forceTLS: false, }); my event laravel class TaskFinished implements ShouldBroadcast { use Dispatchable, InteractsWithSockets, SerializesModels; ..

Read more

I have a simple livewire component, I have a textarea field named description that when updated, will fill another input with a part of it. I can update the description field with that part, but the name field not. namespace AppHttpLivewire; use LivewireComponent; use AppTraitsProcessTrait; class RecordName extends Component { use ProcessTrait; public $name; public ..

Read more