Category : laravel-livewire

When using a full page livewire component, is it sufficient to put the authorization in the route, or should you also have authorization in the component class itself? For example I have a route such as this: Route::middleware([‘can:business.create’])->get(‘create’,AppHttpLivewireBusinessCreate::class)->name(‘business.create’); In this route we use the "can:" middlewire to check if the user has the "business.create" permission. ..

Folder structure: Livewire – Things – Addthing.php Blade file @livewire(‘things.addthing’) is unable to locate it: Unable to find component: [things.addthing] Without subdirectory, this works fine as: Livewire – Addthing.php . @livewire(‘addthing’) How do I get Livewire components to work in a subdirectory? Sourc..

Description I am using livewire in a laravel package that will plug into a laravel project. I succefully integrated Livewire in my package. The error i am fetching is This page has expired due to inactivty when i click a button that is binded to a component method. I added csrf token in my base ..

on list have function latest() { return Topic::withTrashed()->latest(); } and for display a single class ShowTopic extends Component { public $topic; public function mount(Topic$topic) { $this->topic =$topic; } public function render() { return view(‘livewire.show-topic’, [ ‘topic’ => $this->topic, ]); } but when go to a single topic(deleted) don’t show Sourc.. Read more ArgumentCountError: Too few arguments to function AppProvidersBroadcastServiceProvider::{closure}(), 1 passed in D:laragonwwwlaraveljetstreamvendorlaravelframeworksrcIlluminateBroadcastingBroadcastersBroadcaster.php on line 77 and exactly 2 expected in file D:laragonwwwlaraveljetstreamrouteschannels.php on line 21 I am always getting this error . my channels.php Broadcast::channel(‘post{userId}’, function ($data,$userId) { return response()->json([‘user_id’ =>$userId,’data’ => $post]); }); Component protected$listeners = [‘echo-private:post.{Auth::user()->id}’ => ‘notifyNewPost’]; I was unable to ..

I’m facing a strange behavior with entangled variable. Here’s the simplest example possible. In my Livewire component: public $myBoolValue = false; In my blade view: <div class="m-10" x-data="{toggle: @entangle(‘myBoolValue’)}"> <label> <input type="checkbox" @click="toggle = ! toggle"/> </label> <p>Livewire: {{ var_export($myBoolValue) }}</p> <p x-text="[‘Alpine.js: ‘+toggle]"></p> </div> Here’s what happens: After a page refresh, it seems that ..

i want to trigger hidden input <input id="hidden-input" type="file" wire:model="photos" multiple class="hidden" /> by clicking this button<button id="button" wire:click=".hidden-input" class="mt-2 rounded-sm px-3 py-1 bg-gray-200 hover:bg-gray-300 focus:shadow-outline focus:outline-none"> <i class="fa fa-photo"></i> </button> is there away of doing it in livewire? Sourc..

I have a Livewire sign in component which takes an email address and password. If the email/password is correct, it redirects – otherwise, it shows a flash message. How can I test this? assertSee doesn’t feel write, as I’d have to hard-code the flash message assertSeeLivewire doesn’t seem to see the sign in component (even ..

I have form submit function which is working just fine in normal controller but since I’ve moved my function to livewire component it returns error Error ErrorException Undefined index: attachment Code Error line commented $chat = new BidChat; // other fields if ($this->attachment) { $attachment =$this->attachment; $filename = ‘chat-attachment’ . ‘-‘ . time() . .. Read more I have a table with multiple modals and I am trying to test passing in the row id on the loop to ensure my modal is working properly. But I cannot get the value of the variable to show through my Livewire component. Livewire Component <livewire:dashboard.actions :apt_id="$appointments->id"/> Livewire/dashboard/actions.blade.php <div><button wire:click="showModal">Show modal</button> <x-jet-dialog-modal wire:model="showingModal"> <x-slot name="title"> ..

I have nested Livewire components, where the "child" fires an event to the "parent". The issue is that it does not reach the listener when firing from the child’s (mount) method. Maybe the listener is not yet available when firing the event from child? It does work when firing from the child’s blade, using wire:click="$emit(…)" .. Read more I have a problem with wire:ignore, whenever my function is called with wire:click the result is filtered but the CSS of highlightjs disappears, I cannot understand why the first record is shown correctly, while the following ones are not my view: <div> <livewire:partials.hero /> <section class="section"> <div class="container"> <div class="columns"> <div class="column is-3"> <aside class="is-medium .. Read more I’ve want to add filters on my table. My filters are the level of security of an account. There is my HTML <input type="checkbox" value="O" wire:model="level" id="O"> <label for="O">O</label> <input type="checkbox" value="a" wire:model="level" id="a"> <label for="a">A</label> <input type="checkbox" value="b" wire:model="level" id="b"> <label for="b">B</label> <input type="checkbox" value="c" wire:model="level" id="c"> <label for="c">C</label> And there is my Livewire .. Read more I tried many ways of populating old checked values in edit page of livewire. Method 1 : public$role_id, $name,$new_permissions = []; public function mount($id) { /$old_permissions = AppModelsUserRolePermission::where(‘user_role_id’, $this->role_id)->pluck(‘permission_id’)->toArray(); // here new_permissions is my wire:model name in view for the checkbox input // so I tried to initialize the new_permissions array by .. Read more I use Livewire 2 and Alpine with Laravel 8. I have an HTML table which display some informations of a list of Models, among these informations there are dates. Dates are stored in timestamp without timezone in my database (as UTC) and my Laravel is configured to use UTC by default. I need to display .. Read more I activated SPA mode on Laravel 8 Jetstream Livewire, I found name and email been empty when I click user/profile endpoint from other page, it will show the name and email when I refresh the browser. Sourc.. Read more My name is Cristian, from Argentina, sorry for my english!! I’m trying to work with livewire and i cant get it working. I have a route: Route::middleware([‘auth:sanctum’, ‘verified’]) ->get(‘/nuevoturno’, NuevoTurno::class) ->name(‘nuevoturno’); The NuevoTurno.php contains: namespace AppHttpLivewire; use AppModelsFormatoTurno; use LivewireComponent; class NuevoTurno extends Component { public$qFecha = ‘2020-11-17’; public function render() { return view(‘livewire.nuevo-turno’,[ ..

Solution at the bottom of the post. My name is Cristian, from Argentina, sorry for my english!! I’m trying to work with livewire and i cant get it working. I have a route: Route::middleware([‘auth:sanctum’, ‘verified’]) ->get(‘/nuevoturno’, NuevoTurno::class) ->name(‘nuevoturno’); The NuevoTurno.php contains: namespace AppHttpLivewire; use AppModelsFormatoTurno; use LivewireComponent; class NuevoTurno extends Component { public $qFecha = .. Read more I’m trying to send a property, maxId back with my user data. This property is the id of the last row received from the database (cursor-based pagination). I do this like so: public$maxId = 0; public function loadMore() { //? } public function render() { $data = User::where(‘id’, ‘>’,$maxId)->limit(10)->get(); $data->maxId =$data->last()->id; return ..

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 the table, it opens the modal and allows to edit the corresponding record. This part ..

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 bg-gray-100 border-indigo-500 leading-normal"> <div class="border border-black mt-3 p-3 grid grid-cols-4"> <div class="col-span-1"> <label for="about" class="block text-sm leading-5 font-medium text-gray-700"> Title </label> <div class="rounded-md shadow-sm"> <textarea wire:model="additional_docs.title" name="additional_docs" id="edit_additional_docs" name="" rows="3" class="form-textarea mt-1 block w-full ..

Hey all you smart people, Im having a issue I normally work with API routes not really used Web Routes before and finding this rather complicated for some reason 😀 Ive made this route Route::get(‘/test/{page?}’, AppHttpLivewireTest::class); sand this is my logic in the render() in the controller public function render(Request $request,$page = 1) { ..