Feb 1, 2021
0
Level 2
-1 0 1 ErrorException Undefined property: Livewire\CompilerEngineForIgnition::$files
C:\xampp\htdocs\mic\vendor\livewire\livewire\src\CompilerEngineForIgnition.php:17 When using Pagination this error occurs my Component
`<?php
namespace App\Http\Livewire;
use Livewire\Component;
use Livewire\WithPagination;
use Modules\LedGen\Entities\Ps4tekAttendence;
class Attend extends Component
{
use WithPagination;
public $attend;
public $readyToLoad = false;
public $name;
public $phone;
public $agentname;
public $shipping;
public $delivery;
public $created_atstart;
public $created_atend;
public $rFilter;
protected $paginationTheme = 'bootstrap';
public function mount(){
}
public function loadPosts()
{
$this->readyToLoad = true;
}
protected $rules = [
'attend.*.shipping' => 'string',
'attend.*.delivery' => 'string',
'attend.*.comment' => 'string',
];
public function save()
{
$this->validate();
foreach ($this->attend as $post) {
$post->save();
}
session()->flash('message', 'successfully updated.');
}
public function delete($id)
{
Ps4tekAttendence::with('user')->find($id)->delete();
$this->attend = $this->attend->except($id);
session()->flash('message', 'successfully updated.');
}
public function render()
{
$this->rFilter['attenname'] = $this->name;
$this->rFilter['attenphone'] = $this->phone;
$this->rFilter['agentname'] = $this->agentname;
$this->rFilter['shipping'] = $this->shipping;
$this->rFilter['delivery'] = $this->delivery;
$this->rFilter['created_at']['start'] = $this->created_atstart;
$this->rFilter['created_at']['end'] = $this->created_atend;
$this->attend = Ps4tekAttendence::ignoreRequest(['perpage','page'])->filter($this->rFilter)->with('user')-
>paginate(2);
return view('livewire.attenda');
}
}
`
my view :
<div wire:init="loadPosts">
<form wire:submit.prevent="save">
<button class="btn btn-primary mb-2 btn-lg" type="submit">Save</button>
<div>
@if (session()->has('message'))
<div class="alert alert-success">
{{ session('message') }}
</div>
@endif
</div>
<table class="table">
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">attendable</th>
<th scope="col">Agent</th>
<th scope="col">shipping</th>
<th scope="col">delivery</th>
<th scope="col">created_at</th>
<th scope="col">Action</th>
</tr>
</thead>
<thead class="thead-dark">
<tr>
<th scope="col">#</th>
<th scope="col">
<input class="form-control" name="name" type="text" wire:model="name" placeholder="search with name">
<input class="form-control" name="phone" type="text" wire:model="phone" placeholder="search with phone">
</th>
<th scope="col"><input class="form-control" name="name" type="text" wire:model="agentname" placeholder="search with agent name"></th>
<th scope="col">
<select wire:model="shipping">
<option value=""></option>
<option value="1">true</option>
<option value="0">false</option>
</select>
</th>
<th scope="col">
<select wire:model="delivery">
<option value=""></option>
<option value="done">done</option>
<option value="not">not</option>
<option value="without book">without book</option>
</select>
</th>
<th scope="col">
<input type="date" wire:model="created_atstart" placeholder="from">
<input type="date" wire:model="created_atend" placeholder="to">
</th>
<th scope="col"></th>
</tr>
</thead>
<tbody>
@foreach ($attend as $key => $item)
<tr>
<th scope="row">{{$item->id}}</th>
<td>{{$item->attendable->name??''}} <br>
{{$item->attendable->phone??''}}
</td>
<td>{{$item->user->name}}</td>
<td>
<input name="shipping" type="checkbox" wire:model="attend.{{$key}}.shipping">
</td>
<td>
<select name="delivery" wire:model="attend.{{$key}}.delivery">
<option value="done">done</option>
<option value="not">not</option>
<option value="without book">without book</option>
</select>
</td>
<td>{{$item->created_at->format('Y-m-d')}}</td>
<td>
<a class="btn btn-xs btn-info" target="_blank" href="{{route('callrecord.attendshow',$item->id)}}" title="عرض">
<i class="fas fa-eye"></i> show
</a>
<a wire:click.prevent="delete({{$item->id}})" class="btn btn-danger delete_confirm" href="" title="delete">
<i class="la la-trash"></i> delete
</a>
</td>
</tr>
@endforeach
</tbody>
</table>
{{ $attend->links()}}
<button class="btn btn-primary mb-2 btn-lg" type="submit">Save</button>
</form>
</div>
Is there any help with that without the paginate? It works fine
Please or to participate in this conversation.