Custom commands to create controllers and models in Codeigniter 4, designed to facilitate the generation of base code for projects.
For installation, you only need to clone this repository.
git clone https://[email protected]/KurodaSensei/custom-commands-ci4.git
Once the files are downloaded, copy the Commands folder into the App directory of your CI4 project and voila, you can use the commands.
Create Controllers
php spark make:controller UserController
It will create the UserController.php controller in the App/Controllers directory.
Create Controllers in a subdirectory
php spark make:controller Users.UserController
It will create the UserController.php controller in the App/Controllers/Users directory.
Create Resources Controllers
php spark make:controller --resource OR -r
It will create the UserController.php controller with common API methods REST (index, create, update, show, delete).
Create Models
php spark make:model User OR make:model User.User
It will create the User.php model in a App/Model directory or in App/Model/User directory
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate.