Advertisement
Virajsinh

Laravel Php Artisan Command

Jun 30th, 2025 (edited)
11
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.35 KB | None | 0 0
  1. Create Controller With Method
  2. php artisan make:controller Backend/DashboardController --resource --model=Dashboard
  3.  
  4. Create Model
  5. php artisan make:model User
  6.  
  7. Create DataTable ( if Laravel Yajra Package Installed )
  8. php artisan datatables:make UserDataTable
  9.  
  10. Create Validation File
  11. php artisan make:request User/StoreUserRequest
  12.  
  13. Create a custom validation rule
  14. make:rule RuleName
  15.  
  16. Create Mail Template
  17. php artisan make:mail User/ResetPasswordEmail
  18.  
  19. Create Observer ( in Model Action Reaction )
  20. php artisan make:observer UserObserver --model=User
  21.  
  22. Create Notification
  23. php artisan notifications:table
  24.  
  25. Create
  26. php artisan make:model MobileUser -a
  27.  
  28. | Option | Description |
  29. | ---------------------- | --------------------------------------------------- |
  30. | `-m` or `--migration` | Create a migration file |
  31. | `-c` or `--controller` | Create a controller |
  32. | `-r` or `--resource` | Create a resource controller |
  33. | `-f` or `--factory` | Create a factory |
  34. | `-s` or `--seed` | Create a seeder |
  35. | `-a` or `--all` | Generate migration, factory, seeder, and controller |
  36.  
  37. Check Route File list
  38. php artisan route:list
  39.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement