PURPOSE a middleware package can run just before each actual request is treated, e.g. to check for authentication, permissions a middleware package can run just before a response is sent back, e.g. to set HTTP headers USAGE >php artisan make:middleware CheckSomething Usage: make:middleware <name> Arguments: name …
Tag Archives:
artisan make:seeder
PURPOSE used to fill database tables with dummy or default data, typically right after creating the table through a database migration USAGE php artisan make:seeder WidgetsTableSeeder Description: Create a new seeder class Usage: make:seeder <name> Arguments: name The name of the class Options: …
artisan make:migration
PURPOSE A ‘migration’ is any change in the database layout It can be creating a new table, removing/dropping a table or modifying the layout of an existing database table. USAGE >php artisan make:migration create_widgets_table >php artisan make:migration alter_widgets_table >php artisan make:migration drop_widgets_table Description: Create a new migration file Usage: make:migration [options] [–] <name> …
artisan make:model
PURPOSE typically there will be a Model for each table in the database while the Migration defines the fields in a table, the Model will define how to interact with the table. E.g. updating a database record might imply some calculations, some checks and only then database update command. USAGE >php artisan make:model Widget Usage: …
artisan make:controller
PURPOSE Controllers are used when it’s too complex to just specify a (static) view in the routes list. Controllers typically return a view (in the most common case of a web view, thus a rendered HTML page). USAGE >php artisan make:controller FooController Description: Create a new controller class Usage: make:controller [options] [–] <name> …