. * * @package LibreNMS * @link http://librenms.org * @copyright 2021 Tony Murray * @author Tony Murray */ namespace App\Plugins\Hooks; use App\Models\User; use Illuminate\Support\Str; abstract class PageHook { /** @var string */ public $view = 'resources.views.page'; public function authorize(User $user): bool { return true; } public function data(): array { return [ ]; } final public function handle(string $pluginName): array { return array_merge([ 'settings_view' => Str::start($this->view, "$pluginName::"), ], $this->data()); } }