Skip to content

Commit 470ee04

Browse files
committed
add support for automatic package discovery (Laravel 5.5)
1 parent 2530cd7 commit 470ee04

12 files changed

+66
-36
lines changed

composer.json

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,19 @@
1717
}
1818
],
1919
"require": {
20-
"php": ">=5.6.4"
20+
"php": ">=7.0.0"
2121
},
2222
"autoload": {
2323
"psr-4": {
2424
"Bpocallaghan\\Generators\\": "src/"
2525
}
2626
},
27-
"minimum-stability": "dev"
27+
"minimum-stability": "dev",
28+
"extra": {
29+
"laravel": {
30+
"providers": [
31+
"Bpocallaghan\\Generators\\GeneratorsServiceProvider"
32+
]
33+
}
34+
}
2835
}

readme.md

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ You can publish the stubs. You can add your own stubs to generate.
55

66
Interested in a laravel admin starter project where the package is being used. [Admin Starter Project](https://github.com/bpocallaghan/laravel-admin-starter)
77

8-
Laravel 5.1, use tag 2.1.3, Laravel 5.2 or Laravel 5.3, use branch 3, Laravel 5.4 use latest
8+
```
9+
Laravel 5.1 - v2.1.3
10+
Laravel 5.2 - v3.0.3
11+
Laravel 5.3 - v3.0.3
12+
Laravel 5.4 - v4.1.9
13+
Laravel 5.5 - v5.0.0+
14+
```
915

1016
## Commands
1117
```bash
@@ -70,7 +76,7 @@ Update your project's `composer.json` file.
7076
composer require bpocallaghan/generators --dev
7177
```
7278

73-
App the Service Provider
79+
Add the Service Provider (Laravel 5.5 has automatic discovery of packages)
7480
You'll only want to use these generators for local development, add the provider in `app/Providers/AppServiceProvider.php`:
7581

7682
```php

src/Commands/EventGenerateCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class EventGenerateCommand extends GeneratorCommand
3434
*
3535
* @return void
3636
*/
37-
public function fire()
37+
public function handle()
3838
{
3939
$provider = $this->laravel->getProvider(EventServiceProvider::class);
4040

src/Commands/FileCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ private function getFileName()
6767
*
6868
* @return void
6969
*/
70-
public function fire()
70+
public function handle()
7171
{
7272
// setup
7373
$this->setSettings();

src/Commands/GeneratorCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function __construct(Filesystem $files, Composer $composer)
5050
*
5151
* @return void
5252
*/
53-
public function fire()
53+
public function handle()
5454
{
5555
$args = [
5656
'name' => $this->argumentName(),

src/Commands/ListenerCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ListenerCommand extends GeneratorCommand
3636
*
3737
* @return void
3838
*/
39-
public function fire()
39+
public function handle()
4040
{
4141
if (!$this->option('event')) {
4242
return $this->error('Missing required option: --event=*NameOfEvent*');

src/Commands/MigrationCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class MigrationCommand extends GeneratorCommand
4242
*
4343
* @return mixed
4444
*/
45-
public function fire()
45+
public function handle()
4646
{
4747
$this->meta = (new NameParser)->parse($this->argumentName());
4848

src/Commands/MigrationPivotCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class MigrationPivotCommand extends GeneratorCommand
3232
*
3333
* @return mixed
3434
*/
35-
public function fire()
35+
public function handle()
3636
{
3737
$name = $this->parseName($this->getNameInput());
3838
$path = $this->getPath($name);

src/Commands/ModelCommand.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,9 @@ class ModelCommand extends GeneratorCommand
3232
*
3333
* @return void
3434
*/
35-
public function fire()
35+
public function handle()
3636
{
37-
parent::fire();
37+
parent::handle();
3838

3939
if ($this->option('migration')) {
4040
$name = $this->getMigrationName();

src/Commands/PublishCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class PublishCommand extends GeneratorCommand
2525
/**
2626
* Execute the command
2727
*/
28-
public function fire()
28+
public function handle()
2929
{
3030
$this->copyConfigFile();
3131
$this->copyStubsDirectory();

0 commit comments

Comments
 (0)