moharamiamir/codegen

generate code for you

0.1.8 2023-08-15 11:02 UTC

This package is auto-updated.

Last update: 2024-04-15 12:36:29 UTC


README

This project provides a fast and streamlined way to create a RESTful API using Laravel Prompt. By answering a few questions, you can generate all the necessary code to set up your API.

Getting Started

To get started with the Laravel Prompt API Generator, please follow these steps:

Install the necessary dependencies:

composer require this package

composer require moharami/codegen --dev

Set your database variable

open .env file and put your database variable that your program can connect to database correctly.

Run the following command:

php artisan make:code

Answer the prompted questions to configure your API. These questions will include details about routes, controllers, models, and database migration.

Once you have answered all the questions, the Laravel Prompt API Generator will generate all the necessary code files and configurations for your RESTful API.

Finally, run the following command to start your API server:

php artisan serve

Your RESTful API is now up and running! You can access it by visiting http://localhost:8000 in your browser.

What files does it create?

the list of files that this command creates is :

  1. Model
  2. Migration (add fields you write in propmt)
  3. Controller
  4. BaseController
  5. Request(save and update) - for validation base on your input
  6. Reource
  7. Factory
  8. Seeder
  9. Route ( add a new route )
  10. Exception

Contributing

Contributions are welcome! If you encounter any issues or have any suggestions for the Laravel Prompt API Generator, feel free to open an issue or submit a pull request.

License

This project is licensed under the MIT License - see the LICENSE file for details.