View.php
1 <?php 2 3 namespace App\Http\Livewire\Entities; 4 5 use App\Models\Entity; 6 use Illuminate\Foundation\Auth\Access\AuthorizesRequests; 7 use Livewire\Component; 8 9 class View extends Component 10 { 11 use AuthorizesRequests; 12 13 public Entity $entity; 14 15 public function mount() 16 { 17 $this->authorize('can_read_external_entities'); 18 } 19 20 protected function getListeners() 21 { 22 return ['refresh' => '$refresh']; 23 } 24 25 public function render() 26 { 27 return view('livewire.entities.view') 28 ->layoutData([ 29 'title' => $this->entity->name, 30 'entity' => $this->entity, 31 'breadcrumb' => 'entities.view', 32 ]); 33 } 34 }