programmeruz/laravel-creator

Generate Model, Migration, Seeder, Factory, Resource, Controller, SWAGGER using simple form

v1.1.1 2023-09-19 15:37 UTC

README

Laravel Creator is a package designed to simplify the code generation process in Laravel projects. With an intuitive UI at the /creator endpoint, you can easily generate migrations, seeders, models, controllers, and API resources with built-in Swagger documentation support.

Installation

Install via Composer:

Begin by pulling in the package using Composer:

composer require programmeruz/laravel-creator

Registering the Service Provider (For Laravel versions below 5.5):

After installation, if you are running a version of Laravel less than 5.5, you'll need to register the service provider. Open config/app.php and add the service provider to the providers array:

'providers' => [
    // ...
    Programmeruz\LaravelCreator\LaravelCreatorServiceProvider::class,
],

Note: Laravel 5.5 and above uses Package Auto-Discovery, so doesn't require you to manually add the ServiceProvider.

Accessing the Creator UI:

Once the package is properly installed and the service provider is registered, navigate to:

your-laravel-app-url/creator

Here, you'll find the intuitive UI to guide you through the code generation process.

Using Swagger Documentation

In order to use Swagger, don't forget to add @OA\Info in your main Controller class

/**
 * @OA\Info(
 *     version="1.0",
 *     title="Example for response examples value"
 * )
 */
 
class Controller extends BaseController
{
    use AuthorizesRequests, ValidatesRequests;
}

To utilize the Swagger feature, after setting up your routes and controllers with Laravel Creator, run the following command:

php artisan l5-swagger:generate

This will produce the necessary Swagger configuration and UI, which you can typically access at:

your-laravel-app-url/api/documentation

Final Thoughts

Laravel Creator is crafted to enhance your development workflow, ensuring you spend less time on boilerplate code and more on building your application's unique features. Should you encounter any issues or require support, please raise an issue on our GitHub repository.

Happy coding!

This documentation provides a structured introduction to your package, guiding users through the installation and basic usage processes. You can further expand it by including sections on advanced features, contribution guidelines, or any other information you find relevant.

🔗 Links

portfolio linkedin twitter