flipboxstudio / lumen-generator

A Lumen Generator You Are Missing
https://packagist.org/packages/flipbox/lumen-generator
MIT License
824 stars 126 forks source link

Add make:observer command #120

Closed jorgemudry closed 2 years ago

jorgemudry commented 2 years ago

What does this Pull Request Do?

It adds the new make:observer command.

How should this be manually tested?

  1. Require and set up the library: composer require flipbox/lumen-generator:dev-add_make_observer_command
  2. Execute the command to create a plain observer:
    php artisan make:observer PlainObserver
  3. You should end up with a new PlainObserver.php file in your app/Observers directory looking like this:
    
    <?php

namespace App\Observers;

class PlainObserver { // }

4. Create a model observer:
```bash
php artisan make:observer UserObserver --model=User
  1. You should end up with a new UserObserver.php file in your app/Observers directory looking like this:
    
    <?php

namespace App\Observers;

use App\Models\User;

class UserObserver { /**

Any background context you want to provide?

N/A

What are the relevant tickets?

N/A

Any extra info?

ok