1. Go to this page and download the library: Download kabbouchi/nova-logs-tool 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/ */
kabbouchi / nova-logs-tool example snippets
// in app/Providers/NovaServiceProvder.php
// ...
public function tools()
{
return [
// ...
new \KABBOUCHI\LogsTool\LogsTool(),
];
}
// in app/Providers/NovaServiceProvder.php
// ...
public function tools()
{
return [
// ...
// don't return plain `true` value or anyone can see/download/delete the logs, make sure to check if user has permission.
(new \KABBOUCHI\LogsTool\LogsTool())
->canSee(function ($request) {
return auth()->user()->canSee();
})
->canDownload(function ($request) {
return auth()->user()->canDownload();
})
->canDelete(function ($request) {
return false;
}),
];
}