kyoconseil/composer-hasable
最新稳定版本:1.1.0
Composer 安装命令:
composer require kyoconseil/composer-hasable
包简介
check if package is required in project or no
README 文档
README
Laravel-Composer-Hasable is a Laravel package that provides an easy way to check if package is required or not.
Features
- check if package is required.
- use custom directive to check if package is required.
Installation
Step 1 - Require the package
composer require kyoconseil/composer-hasable
Step 2: Require Service Provider
in the app.php config file add
'providers' => [
...
KyoConseil\ComposerHasable\ComposerHasableServiceProvider::class,
];
Uses
Use hasPackage() for check
you can use hasPackage('acme/package') for check if the package is required or not example:
$canUseLaravelTinker = hasPackage('laravel/tinker');
dump($canUseLaravelTinker); //true
$canUsePotato = hasPackage('potato');
dump($canUsePotato) //false
Use the custom directive @hasPackage() ... @endhasPackage for check
you can use @hasPackage('acme/package') <!-- HTML code here --> @endhasPackage for check and render the html code if the package is required
example:
<p>show the text if tinker laravel is required</p>
@hasPackage('laravel/tinker')
<p>yes you can use laravel tinker</p>
@endhasPackage
<p>show the text if potato package is required</p>
@hasPackage('potato')
<p>you can use potato package</p>
@endhasPackage
统计信息
- 总下载量: 30
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-08-29