Skip to content

Commit

Permalink
cluster wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhanSalleh committed Jan 25, 2024
1 parent b036b9e commit 23b1aa0
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/FilamentExceptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace BezhanSalleh\FilamentExceptions;

use BezhanSalleh\ExceptionPlugin\Models\Exception;
use Filament\Clusters\Cluster;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Http\Request;
use Illuminate\Support\Arr;
Expand All @@ -13,6 +14,9 @@ class FilamentExceptions
{
protected static ?string $model = null;

/** @var class-string<Cluster> | null */
protected static ?string $cluster = null;

public function __construct(
protected Request $request
) {
Expand All @@ -28,6 +32,16 @@ public static function report(Throwable $exception): void
$reporter->reportException($exception);
}

public static function cluster(string $cluster): void
{
static::$cluster = $cluster;
}

public static function getCluster(): ?string
{
return static::$cluster;
}

public static function getModel(): ?string
{
return static::$model ?? '\\BezhanSalleh\\FilamentExceptions\\Models\\Exception';
Expand Down
6 changes: 6 additions & 0 deletions src/Resources/ExceptionResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,15 @@
use Filament\Resources\Resource;
use Filament\Tables;
use Filament\Tables\Table;
use App\Filament\Clusters\Products;

class ExceptionResource extends Resource
{
public static function getCluster(): ?string
{
return FilamentExceptions::getCluster();
}

public static function getPlugin(): FilamentExceptionsPlugin
{
return FilamentExceptionsPlugin::get();
Expand Down

0 comments on commit 23b1aa0

Please sign in to comment.