rabol / filament-logviewer Goto Github PK
View Code? Open in Web Editor NEWLogviewer for Filament admin
License: MIT License
Logviewer for Filament admin
License: MIT License
If there are not logs file the plugin return:
Undefined variable $rows
filament-logviewer/src/Models/LogFile.php
Line 34 in 07fd22c
I downloaded the log viewer library in Laravel and followed the installation instructions. However, I'm encountering an error when trying to use my custom policy. The error message states: "Rabol\FilamentLogviewer\Policies\LogFilePolicy::delete(): Argument #1 ($user) must be of type App\Models\User, App\Models\Admin given, called in C:\github\backend-rakeb\vendor\laravel\framework\src\Illuminate\Auth\Access\Gate.php on ...".
Steps to Reproduce:
config/filament-logviewer.php
.policy_class
key is set to the correct namespace and class name of your custom policy, which is App\Policies\LogFilePolicy::class
.Expected Behavior:
I expected the log viewer library to use my custom policy, App\Policies\LogFilePolicy
, for authorization checks.
Actual Behavior:
Instead of using my custom policy, the log viewer library is trying to use Rabol\FilamentLogviewer\Policies\LogFilePolicy
and encountering a type error when calling the delete
method.
Custom Policy Contents:
<?php
namespace App\Policies;
use App\Models\Admin;
use Illuminate\Auth\Access\HandlesAuthorization;
class LogFilePolicy
{
use HandlesAuthorization;
public function view(Admin $Admin)
{
return true;
}
public function viewAny(Admin $Admin)
{
return true;
}
public function create(Admin $Admin)
{
return true;
}
public function update(Admin $Admin)
{
return true;
}
public function delete(Admin $Admin)
{
return true;
}
public function deleteAny(Admin $Admin)
{
return true;
}
}
Contents of config/filament-logviewer.php:
<?php
// config for Rabol/FilamentLogviewer
use App\Policies\LogFilePolicy;
return [
'navigation_group' => 'System',
'model_class' => \Rabol\FilamentLogviewer\Models\LogFile::class,
'policy_class' => LogFilePolicy::class,
];
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.