Generating tables
DragonFly\Lists
comes bundled with a make:table
command to generate Table
definitions for you.
Argument
The command takes 1 argument, which would be the name of the Table
definition you wish to create.
php artisan make:table UsersTable
Options
Here's a quick overview:
Flag | Shortcut | Type |
---|---|---|
--model | -m | Required |
--fields | -f | Optional |
--kernel | -k | Optional |
--route | -r | Optional |
--overwrite | -o | Optional |
Model
This option let's you set the model that the Table
definition will use to load data from.
Make sure you pass the model with it's namespace and wrap it in quotes.
--model='App\User'
-m='App\User'
Fields
This one's optional, it takes a comma separated list of column names.
--fields=id,last_name,created_at
-f=id,last_name,created_at
Kernel
You can also define the kernel identifier (this would be the key you add in Htpp\Kernel::$tables
to assign this Table
definition.
If you leave this empty it will default to the model class's name in snake case.
--kernel=users
-k=users
Route
If you want to send the AJAX request through a different URL you can set that route's name with this option.
If you leave this empty it will default to the global router.
--route=lists.load
-r=lists.load
Overwrite
This optional is only needed if you would want to overwrite an existing definition with the same name. Use with caution.
--overwrite
-o
Updated less than a minute ago