<?php namespace App\Components; use Illuminate\Support\Facades\Gate; trait SyncResponse{ protected function gate(string $authorityName) { if(!Gate::allows($authorityName)){ echo view('exception.authority'); exit(); } } }