console.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. use Illuminate\Foundation\Inspiring;
  3. use Illuminate\Support\Facades\Artisan;
  4. use App\Commands\CreateCrud;
  5. use App\Commands\RefreshPermissions;
  6. use App\Commands\TestWebsocketEvent;
  7. Artisan::command('inspire', function () {
  8. $this->comment(Inspiring::quote());
  9. })->purpose('Display an inspiring quote');
  10. Artisan::command('create:crud {name} {--m|model} {--s|service} {--c|controller} {--r|request} {--e|resource} {--t|route} {--g|migration} {--all}', function () {
  11. $this->call(CreateCrud::class, [
  12. 'name' => $this->argument('name'),
  13. '--model' => $this->option('model'),
  14. '--service' => $this->option('service'),
  15. '--controller' => $this->option('controller'),
  16. '--request' => $this->option('request'),
  17. '--resource' => $this->option('resource'),
  18. '--route' => $this->option('route'),
  19. '--migration' => $this->option('migration'),
  20. '--all' => $this->option('all'),
  21. ]);
  22. })->purpose('Create CRUD operations with typed Models');
  23. Artisan::command('permissions:refresh', function () {
  24. $this->call(RefreshPermissions::class);
  25. })->purpose('Refresh all permissions and user type permissions');
  26. Artisan::command('websocket:test {room} {--event=test-event} {--data=}', function () {
  27. $this->call(TestWebsocketEvent::class, [
  28. 'room' => $this->argument('room'),
  29. '--event' => $this->option('event'),
  30. '--data' => $this->option('data'),
  31. ]);
  32. })->purpose('Test websocket broadcasting by emitting an event');