This repository has been archived by the owner on Feb 27, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 6
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
2283f66
commit 63502e6
Showing
1 changed file
with
48 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
<?php | ||
|
||
namespace ProtoneMedia\SpladeCore; | ||
|
||
use ProtoneMedia\SpladeCore\Facades\SpladePlugin; | ||
use Spatie\LaravelPackageTools\Package; | ||
use Spatie\LaravelPackageTools\PackageServiceProvider; | ||
|
||
abstract class SpladePluginServiceProvider extends PackageServiceProvider implements SpladePluginProvider | ||
{ | ||
protected string $pluginName = ''; | ||
|
||
protected string $composerPackageName = ''; | ||
|
||
public function getPluginName(): string | ||
{ | ||
return $this->pluginName; | ||
} | ||
|
||
public function getComposerPackageName(): string | ||
{ | ||
return $this->composerPackageName; | ||
} | ||
|
||
public function getLibraryBuildFilename(): string | ||
{ | ||
return 'splade-core-plugin'; | ||
} | ||
|
||
public function configurePackage(Package $package): void | ||
{ | ||
$package | ||
->name($this->pluginName) | ||
->hasViews($this->pluginName); | ||
|
||
foreach ($this->getComponents() as $component) { | ||
$package->hasViewComponent('', $component); | ||
} | ||
|
||
SpladePlugin::registerPluginProvider($this); | ||
|
||
$this->configureSpladePackage($package); | ||
} | ||
|
||
public function configureSpladePackage(Package $package): void | ||
{ | ||
} | ||
} |