-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Add support for Filament 3 * Add support for Filament 3 * Remove config * Fix use statement * Show key in table * Composer packages * Update composer.json * Update FilamentOpcacheServiceProvider.php * widgets display w/o error * composer dependency changes - we want an explicit dependency on filament 3 - we do not want an explicit dependency on carbon via illuminate (ties us to laravel version 10) - removed unnecessary php version requirement... filament already requires 8.1 * update README * forgot to save --------- Co-authored-by: Haz <me@hazjohnson.com> Co-authored-by: Haz <hello@haztakki.solutions>
- Loading branch information
1 parent
8b9b93d
commit 1e93897
Showing
11 changed files
with
117 additions
and
62 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
<?php | ||
|
||
namespace STS\FilamentOpcache; | ||
|
||
use Filament\Contracts\Plugin; | ||
use Filament\Panel; | ||
|
||
class FilamentOpcachePlugin implements Plugin | ||
{ | ||
public static function make(): static | ||
{ | ||
return app(static::class); | ||
} | ||
|
||
public function getId(): string | ||
{ | ||
return 'filament-opcache'; | ||
} | ||
|
||
public function register(Panel $panel): void | ||
{ | ||
$panel | ||
->pages([ | ||
Pages\Config::class, | ||
Pages\Status::class, | ||
]) | ||
->widgets([ | ||
Widgets\OpcacheHitsWidget::class, | ||
Widgets\OpcacheMemoryWidget::class, | ||
]); | ||
} | ||
|
||
public function boot(Panel $panel): void | ||
{ | ||
// | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,20 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace STS\FilamentOpcache; | ||
|
||
use Filament\PluginServiceProvider; | ||
use Spatie\LaravelPackageTools\Package; | ||
use STS\FilamentOpcache\Pages; | ||
use STS\FilamentOpcache\Widgets; | ||
use Spatie\LaravelPackageTools\PackageServiceProvider; | ||
|
||
class FilamentOpcacheServiceProvider extends PluginServiceProvider | ||
class FilamentOpcacheServiceProvider extends PackageServiceProvider | ||
{ | ||
protected array $pages = [ | ||
Pages\Config::class, | ||
Pages\Status::class, | ||
]; | ||
|
||
protected array $widgets = [ | ||
Widgets\OpcacheHitsWidget::class, | ||
Widgets\OpcacheMemoryWidget::class, | ||
]; | ||
public static string $name = 'filament-opcache'; | ||
|
||
public function configurePackage(Package $package): void | ||
{ | ||
$package | ||
->name('laravel-filament-opcache') | ||
->hasViews('laravel-filament-opcache'); | ||
->name(static::$name) | ||
->hasViews(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,16 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace STS\FilamentOpcache; | ||
|
||
class Memory | ||
{ | ||
public static function humanReadable($bytes = 0) | ||
public static function humanReadable(int $bytes = 0): string | ||
{ | ||
$size = ['B', 'kB', 'MB', 'GB', 'TB']; | ||
$factor = floor((strlen($bytes) - 1) / 3); | ||
return sprintf("%.2f", $bytes / pow(1024, $factor)) . ' ' . @$size[intval($factor)]; | ||
$factor = floor((strlen((string)$bytes) - 1) / 3); | ||
|
||
return sprintf("%.2f", (string)$bytes / pow(1024, $factor)) . ' ' . @$size[intval($factor)]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace STS\FilamentOpcache\Widgets; | ||
|
||
use Appstract\Opcache\OpcacheFacade; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace STS\FilamentOpcache\Widgets; | ||
|
||
use Appstract\Opcache\OpcacheFacade; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters