cwccode / laravel-contracts
A Laravel artisan command to make interfaces
Installs: 3 481
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 0
Forks: 0
Open Issues: 0
Requires
- laravel/framework: >=5.0
Requires (Dev)
- roave/security-advisories: dev-master
This package is not auto-updated.
Last update: 2021-10-04 10:51:18 UTC
README
cwccode/laravel-contracts
is a package that adds a make:contract
command to Laravel, to create interfaces for your application.
Installation
You can install the package using composer:
composer require --dev cwccode/laravel-contracts
For Laravel 5.4 or less, you'll need to register the service provider manually in /config/app.php
Usage
To make a new interface, simply run:
php artisan make:contract InterfaceName
This will produce the following file in app/Contracts/InterfaceName.php
:
<?php namespace App\Contracts; interface InterfaceName { // }
You can also specify some methods by passing one or more --method
options:
php artisan make:contract InterfaceName --method=method1 --method=method2
This will produce:
<?php namespace App\Contracts; interface InterfaceName { /** * method1 * * @return void */ public function method1(); /** * method2 * * @return void */ public function method2(); }