timwassenburg/laravel-artisan-extender

A collection of generators for Laravel

v1.0.0 2023-04-21 15:51 UTC

This package is auto-updated.

Last update: 2024-10-27 12:26:33 UTC


README

Logo

Latest Version on Packagist Total Downloads License

Table of Contents

  1. Installation
  2. Usage
  3. Contributing
  4. License

Installation

Install the package with composer.

composer require timwassenburg/laravel-artisan-extender --dev

Usage

Generate services

To generate a new service use the following artisan command.

php artisan make:service UserService

Optionally, you can add multiple method names (seperated by comma) with the --methods param.

php artisan make:service UserService --methods=register,login,logout

Learn more about the Service Generator

Generate actions

Run the following command on the command-line to generate a new action.

php artisan make:action {name}

Learn more about the Action Generator

Generate repositories

Run the following command.

php artisan make:repository UserRepository

This example will generate the following files:

app\Repositories\Eloquent\UserRepository
app\Repositories\UserRepositoryInterface

Learn more about the Repository Generator

Generate traits

Run the following command on the command-line to generate a new trait.

php artisan make:trait {name}

Optionally, you can add multiple method names (seperated by comma) with the --methods param.

Learn more about the Trait Generator

php artisan make:trait Notifiable --methods=notify,notifications

Generate pivot tables

Run the following command on the command-line to generate a new migration for the pivot table.

php artisan make:pivot {first_table_name} {second_table_name}

The command will create a new migration in database/migrations. Run the migrations to create the table.

php artisan migrate

Learn more about the Pivot Table Generator

Contributing

Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated.

If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

The MIT License (MIT). Please see License File for more information.