spatie/laravel-package-tools
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
illuminate/contracts | v10.48.10 | - | MIT | prod |
Spatie/laravel-package-tools is a powerful PHP package designed for Laravel that simplifies the process of creating Laravel packages. It offers a PackageServiceProvider
that can be utilized in the Laravel packages to register config files, migrations, views, translations, routes, and assets with ease. It also supports command registration and has lifecycle hooks for customization during the package start-up process.
To utilize the Spatie/laravel-package-tools, it needs to be installed via composer using composer require spatie/laravel-package-tools
. Then, you can allow your service provider to extend the Spatie\LaravelPackageTools\PackageServiceProvider
and use this packageServiceProvider
to register various elements of your Laravel packages.
For instance, to register a config file:
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;
class YourPackageServiceProvider extends PackageServiceProvider
{
public function configurePackage(Package $package) : void
{
$package->name('your-package-name')
->hasConfigFile();
}
}
Moreover, the package also provides methods for registering views, migrations, commands, translations, etc.
The comprehensive documentation for spatie/laravel-package-tools is located directly on its GitHub repository at https://github.com/spatie/laravel-package-tools.git. This includes detailed instructions on installing and using the package, as well as a plethora of informative, code-complete examples on how to best utilize the provided tools within your Laravel packages.