-
-
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.
- Loading branch information
1 parent
b6eaa26
commit 458eb3d
Showing
7 changed files
with
93 additions
and
56 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 was deleted.
Oops, something went wrong.
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,65 @@ | ||
<?php | ||
|
||
namespace DaniloPolani\FilamentMemoryTracker; | ||
|
||
use DaniloPolani\FilamentMemoryTracker\Widgets\MemoryTrackerWidget; | ||
use Filament\FilamentManager; | ||
use Filament\PluginServiceProvider; | ||
use Spatie\LaravelPackageTools\Package; | ||
|
||
class WidgetServiceProvider extends PluginServiceProvider | ||
{ | ||
public static string $name = 'filament-memory-tracker'; | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function configurePackage(Package $package): void | ||
{ | ||
parent::configurePackage($package); | ||
|
||
$package | ||
->hasAssets() | ||
->hasConfigFile(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
public function packageRegistered(): void | ||
{ | ||
$this->app->singletonIf('filament', fn (): FilamentManager => new FilamentManager()); | ||
|
||
parent::packageRegistered(); | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getWidgets(): array | ||
{ | ||
return [ | ||
MemoryTrackerWidget::class, | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getStyles(): array | ||
{ | ||
return [ | ||
self::$name . '-styles' => asset('/vendor/' . self::$name . '/memory-tracker.css'), | ||
]; | ||
} | ||
|
||
/** | ||
* {@inheritDoc} | ||
*/ | ||
protected function getScripts(): array | ||
{ | ||
return [ | ||
self::$name . '-scripts' => asset('/vendor/' . self::$name . '/memory-tracker.js'), | ||
]; | ||
} | ||
} |
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