PHP code example of sirajunnasihin / filament-exceptions
1. Go to this page and download the library: Download sirajunnasihin/filament-exceptions 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/ */
sirajunnasihin / filament-exceptions example snippets
public function panel(Panel $panel): Panel
{
return $panel
->plugins([
\BezhanSalleh\FilamentExceptions\FilamentExceptionsPlugin::make()
]);
}
namespace App\Exceptions;
use BezhanSalleh\FilamentExceptions\FilamentExceptions;
class Handler extends ExceptionHandler
{
...
public function register()
{
$this->reportable(function (Throwable $e) {
if ($this->shouldReport($e)) {
FilamentExceptions::report($e);
}
});
...
}
'period' => now()->subWeek(), // 1 week
'period' => now()->subDay(), // 1 day
'period' => now()->subDays(3), // 3 days
'exception_model' => Exception::class,
namespace App\Models;
use BezhanSalleh\FilamentExceptions\Models\Exception as BaseException;
class Exception extends BaseException
{
}