scriemcodat / repository
Installs: 50
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 2
Forks: 0
Open Issues: 0
pkg:composer/scriemcodat/repository
README
Description
This project includes a command-line tool that automates the creation of module directories and files, including services, repositories, interfaces, controllers, requests, models, and observers for Laravel applications.
Features
- Generates necessary module structure for MVC components.
- Automatically creates folders and files for specified components.
- Implements repository and interface patterns.
- Automatically calls Laravel artisan commands to create factories and migrations.
Installation
composer require scriemcodat/repository
Prerequisites
- PHP 8.0 or higher
- Composer
- Laravel Framework
Usage
-
Run the command to create a module:
php artisan create:module {name}Replace
{name}with the name of the model (e.g.,Company). -
Command will create the following structure:
app/Modules/Company/Controllerapp/Modules/Company/Interfaceapp/Modules/Company/Requestapp/Modules/Company/Modelapp/Modules/Company/Observerapp/Modules/Company/Repositoryapp/Modules/Company/Service
-
Auto-created files:
- Repository Interfaces
- Repository Implementations
- Factories
- Migrations
public function doSomeStuff($productSearchService ProductSearchService) { $relationSearch = [ 'Facility' => [ 'relation' => [ 'Company' => [ 'fields' => ['name'] ], ], 'fields' => ['name', 'fiscal_no', 'serial_no'] ], ]; $request->merge([ 'sortBy' => $this->sortBy ?? 'companies.id', 'orderBy' => $this->sortDirection, 'itemsPerPage' => config('app.itemsPerPage'), 'page' => $this->getPage(), 'status' => '1', 'searchText' => $this->search, 'searchIn' => ['name', 'fiscal_no', 'serial_no'], 'relationSearch' => $relationSearch, ]); $this->amefsService->getAllFiltered($request); } ## Running Tests Tests are not yet defined in this project. Add your tests in the `tests` directory following Laravel's testing practices. ## Contributing - Fork the repository. - Create a new branch (`git checkout -b feature-branch`). - Commit your changes (`git commit -m 'Add new feature'`). - Push to the branch (`git push origin feature-branch`). - Create a new Pull Request. ## License This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.