Generating Commands
Sauf provides a simple way to create custom commands for your command-line application. You can use the sauf make:... command to create a new command with a pre-configured basic structure.
WARNING
sauf make:... can only be used in development environment.
Make Command
make:command <names>: Create a new command.<names>: Name of the command you want to create. You can pass multiple names to create multiple commands at once.
Usage
sh
$ npx sauf make:commandsh
$ pnpx sauf make:commandsh
$ yarn sauf make:commandsh
$ bunx sauf make:commandMake Controller
make:controller <names>: Create a new controller.<names>: Name of the controller you want to create. You can pass multiple names to create multiple controllers at once.
Usage
sh
$ npx sauf make:controllersh
$ pnpx sauf make:controllersh
$ yarn sauf make:controllersh
$ bunx sauf make:controllerMake Factory
make:factory <model>: Create a new factory.<model>: Name of the model that the factory will be linked to.
Usage
sh
$ npx sauf make:factorysh
$ pnpx sauf make:factorysh
$ yarn sauf make:factorysh
$ bunx sauf make:factoryMake Gate
make:gate <names>: Create a new gate.<names>: Name of the gate you want to create. You can pass multiple names to create multiple gates at once.
Usage
sh
$ npx sauf make:gatesh
$ pnpx sauf make:gatesh
$ yarn sauf make:gatesh
$ bunx sauf make:gateMake Middleware
make:middleware <names>: Create a new middleware.<names>: Name of the middleware you want to create. You can pass multiple names to create multiple middlewares at once.
Usage
sh
$ npx sauf make:middlewaresh
$ pnpx sauf make:middlewaresh
$ yarn sauf make:middlewaresh
$ bunx sauf make:middlewareMake Model
make:model <names>: Create a new model.<names>: Name of the model you want to create. You can pass multiple names to create multiple models at once.
Usage
sh
$ npx sauf make:modelsh
$ pnpx sauf make:modelsh
$ yarn sauf make:modelsh
$ bunx sauf make:modelMake Policy
make:policy [option] <name>: Create a new policy.<name>: Name of the policy you want to create.-m, --model <model>: Specify the model that the policy will be linked to.
Usage
sh
$ npx sauf make:policysh
$ pnpx sauf make:policysh
$ yarn sauf make:policysh
$ bunx sauf make:policyMake Request
make:request <names>: Create a new request.<names>: Name of the request you want to create. You can pass multiple names to create multiple requests at once.
Usage
sh
$ npx sauf make:requestsh
$ pnpx sauf make:requestsh
$ yarn sauf make:requestsh
$ bunx sauf make:requestMake Resource
make:resource [options] <names>: Create a new resource.<names>: Name of the resource you want to create. You can pass multiple names to create multiple resources at once.-c, --collection: Create a collection-type resource.
Usage
sh
$ npx sauf make:resourcesh
$ pnpx sauf make:resourcesh
$ yarn sauf make:resourcesh
$ bunx sauf make:resourceMake Seeder
make:seeder <model>: Create a new seeder.<model>: Name of the model that the seeder will be linked to.
Usage
sh
$ npx sauf make:seedersh
$ pnpx sauf make:seedersh
$ yarn sauf make:seedersh
$ bunx sauf make:seeder