Skip to content
This repository has been archived by the owner on Feb 27, 2024. It is now read-only.

Commit

Permalink
Added SpladePluginServiceProvider
Browse files Browse the repository at this point in the history
  • Loading branch information
pascalbaljet committed Nov 28, 2023
1 parent 2283f66 commit 63502e6
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions src/SpladePluginServiceProvider.php
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
{
}
}

0 comments on commit 63502e6

Please sign in to comment.