spatie / laravel-view-models

View models in Laravel
https://spatie.be/open-source
MIT License
1.02k stars 61 forks source link

Add make: command #4

Closed brendt closed 6 years ago

freekmurze commented 6 years ago

Much like how php artisan make:model works php artisan make:view-model MyViewModel should create a new MyViewModel class in app/ViewModels, php artisan make:view-model "MyCustomNamespace\MyViewModel" should create a new MyViewModel in app/MyCustomNameSpace/ViewModels.

ijpatricio commented 6 years ago

Hey @freekmurze @brendt

As it's so similar to generating an Eloquent Model, and is extending Illuminate\Console\GeneratorCommand, are tests required?

Are you happy with the stub contents? Guess could also have the (empty) constructor?

PS: regarding https://github.com/spatie/laravel-view-models/pull/5

Also: updating README.md for instructions on adding service provider for Laravel versions <5.5?

freekmurze commented 6 years ago

Underway in #5