PHP code example of ml-solutions / nova-logs-view
1. Go to this page and download the library: Download ml-solutions/nova-logs-view library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ml-solutions / nova-logs-view example snippets
use Illuminate\Support\Facades\Gate;
Gate::define('viewNovaLogs', fn ($user) => $user->can('view application logs'));
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Gate;
use MlSolutions\NovaLogsView\NovaLogsView;
public function tools(): array
{
return [
(new NovaLogsView)->canSee(fn (Request $request) =>
$request->user() !== null
&& Gate::forUser($request->user())->allows('viewNovaLogs')
),
];
}
bash
php artisan vendor:publish --tag=nova-logs-view-config