Skip to content

Commit

Permalink
Merge pull request #1 from nWidart/master
Browse files Browse the repository at this point in the history
Uptodate
  • Loading branch information
rupeshstha authored Sep 4, 2024
2 parents 00b7bec + 59cf936 commit dabad7f
Show file tree
Hide file tree
Showing 558 changed files with 10,430 additions and 12,088 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# These are supported funding model platforms

github: nwidart
github: dcblogdev
17 changes: 0 additions & 17 deletions .github/stale.yml

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ jobs:
strategy:
max-parallel: 2
matrix:
php-versions: ['8.1']
php-versions: ['8.2', '8.3']

name: PHP ${{ matrix.php-versions }}

steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@master
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,7 @@ coverage
.php_cs.cache
.phpunit.result.cache
.idea
.php-cs-fixer.cache
.DS_Store
src/.DS_Store
tests/.DS_Store
2 changes: 0 additions & 2 deletions .php-cs-fixer.dist.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@
'no_whitespace_in_blank_line' => true,
// There MUST be one blank line after the namespace declaration.
'blank_line_after_namespace' => true,
// There should be exactly one blank line before a namespace declaration.
'single_blank_line_before_namespace' => true,
// Each namespace use MUST go on its own line and there MUST be one blank line after the use statements block.
'single_line_after_imports' => true,
// Ensure there is no code on the same line as the PHP open tag and it is followed by a blankline.
Expand Down
187 changes: 186 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,192 @@ All Notable changes to `laravel-modules` will be documented in this file.

## Next

## 10.0 - 2023-02-14
- [@omerbaflah](https://github.com/omerbaflah) Fixes Invokable Controller Stub
- [@solomon-ochepa](https://github.com/solomon-ochepa) Added create module:make-class command

## 11.0.10 - 2024-05-05

- [@dcblogdev](https://github.com/dcblogdev) Update controller, service, helper, and action methods
- [@omerbaflah](https://github.com/omerbaflah) Update service stubs
- [@omerbaflah](https://github.com/omerbaflah) Update action stubs
- [@AbdulkarimOmer](https://github.com/AbdulkarimOmer) Added invokable option into make-controller command
- [@dcblogdev](https://github.com/dcblogdev) Updated vite-module-loader.js to handle case when a modules does not have a vite.config.js file
- [@alissn](https://github.com/alissn) Added direction option to command module:seed

## 11.0.9 - 2024-04-30

- [@dcblogdev](https://github.com/dcblogdev) added make-event-provider command, modules come with event as default now

## 11.0.8 - 2024-04-29

- [@solomon-ochepa](https://github.com/solomon-ochepa) Remove custom namespaces from generator [factory and seeder]
- [@dcblogdev](https://github.com/dcblogdev) added make-action command
- [@dcblogdev](https://github.com/dcblogdev) added make-cast command
- [@dcblogdev](https://github.com/dcblogdev) added make-enum command
- [@dcblogdev](https://github.com/dcblogdev) added make-exception command
- [@dcblogdev](https://github.com/dcblogdev) added make-helper command
- [@dcblogdev](https://github.com/dcblogdev) added make-interface command
- [@dcblogdev](https://github.com/dcblogdev) added make-scope command
- [@dcblogdev](https://github.com/dcblogdev) added make-trait command
- [@dcblogdev](https://github.com/dcblogdev) added missing return type for make-service command
- [@dcblogdev](https://github.com/dcblogdev) updated config

## 11.0.7 - 2024-04-25

## Changes

- [@dcblogdev](https://github.com/dcblogdev) Force the config replacement option for composer 'APP_FOLDER_NAME', to be handled even when its not present.
- [@solomon-ochepa](https://github.com/solomon-ochepa) Path Namespace - generate a well-formatted StudlyCase namespace from paths
- [@korridor](https://github.com/korridor) Fixed public path for octane setup
- [@dcblogdev](https://github.com/dcblogdev) added invokable and force options into make-service command
- [@dcblogdev](https://github.com/dcblogdev) Restrict fresh migration to module scope
- [@kowston](https://github.com/kowston) Changed wording for command descriptions to be consistent

## 11.0.6 - 2024-04-21

- [@alissn](https://github.com/alissn) change package version to Pretty on php artisan about
- [@alissn](https://github.com/alissn) fix stubs composer for app_folder
- [@dcblogdev](https://github.com/dcblogdev) added make-service command

## 11.0.5 - 2024-04-17

## Changes

- [@alissn](https://github.com/alissn) check command has direction option, load module with 'priority'


## 11.0.4 - 2024-04-08

## Changes

- [@dcblogdev](https://github.com/dcblogdev) Updated config to use namespace and path for seeders and factories
- [@solomon-ochepa](https://github.com/solomon-ochepa) Updated vendor / author keys for config/.env
- [@enterprime](https://github.com/enterprime) Corrected factories to Factories and added cache options to ENV

## Added

- [@dcblogdev](https://github.com/dcblogdev) Added return type array definition
- [@dcblogdev](https://github.com/dcblogdev) Added test to confirm author details

## 11.0.3 - 2024-03-24

## Added

- [@enterprime](https://github.com/enterprime) Passing the values of vendor, author's name, and author's email in a line during module creation.
- [@enterprime](https://github.com/enterprime) control the author through the .env configuration file.

## 11.0.2 - 2024-03-24

## Fixed

- [@enterprime](https://github.com/enterprime) fixed module:migrate-rollback command

## 11.0.1 - 2024-03-23

## Added

- [@alissn](https://github.com/alissn) add RouteServiceProvider Configuration in Generator
- [@alissn](https://github.com/alissn) added Laravel Modules package version to command 'about'
- [@dcblogdev](https://github.com/dcblogdev) Added view:make command to generate views

## Changed

- [@alissn](https://github.com/alissn) Run command php-cs-fixer fix
- [@solomon-ochepa](https://github.com/solomon-ochepa) updated route-provider.stub to loose the optional namespace

## 11.0.0 - 2024-03-19

## Fixed

- [@Subtixx](https://github.com/subtixx) Fix Issue #1752 - Hardcoded string + undefined variable
- [@jaymeh](https://github.com/jaymeh) fix: Failed to load module script for static assets such as images
- [@alissn](https://github.com/alissn) Fixing failing tests

## Changed

- [@dcblogdev](https://github.com/dcblogdev) ensure class_exists for both Capital and lower case namespaces
- [@dcblogdev](https://github.com/dcblogdev) create database folders by default
- [@dcblogdev](https://github.com/dcblogdev) set route service provider to use blank namespace by default
- [@dcblogdev](https://github.com/dcblogdev) updated tests for compatability with PhpUnit 12
- [@dcblogdev](https://github.com/dcblogdev) added replacement placeholders in config for API stubs
- [@dcblogdev](https://github.com/dcblogdev) updated vite to rename placeholder with module name
- [@dcblogdev](https://github.com/dcblogdev) Added support for Laravel 11
- [@solomon-ochepa](https://github.com/solomon-ochepa) updated API route stub to use controller
- [@solomon-ochepa](https://github.com/solomon-ochepa) updated config comments
- [@alissn](https://github.com/alissn) rearrange Command Classes into Folders and Update Namespace Structure
- [@alissn](https://github.com/alissn) delete command module:migrate-fresh
- [@alissn](https://github.com/alissn) Fixing Case of tests/Unit and tests/Feature
- [@alissn](https://github.com/alissn) Updated commands to use Laravel Prompt
- [@dcblogdev](https://github.com/dcblogdev) updated event stub to include Dispatchable and InteractsWithSockets traits

## 10.0.6 - 2024-01-28

## Added

- [@alissn](https://github.com/alissn) Add command module prune

## 10.0.5 - 2024-01-22

## Added

- [@azim-kordpour](https://github.com/azim-kordpour) Add PHPDoc static to all methods in Module facade

## Changed

- [@dcblogdev](https://github.com/dcblogdev) Reverted config to use `App` and `Database` namespace / folders by default
- [@alissn](https://github.com/alissn) Command Synchronization and Alphabetical Sorting in ConsoleServiceProvider
- [@fpermana](https://github.com/fpermana) Update ObserverMakeCommand.php

## Fixed

- [@alissn](https://github.com/alissn) revert extend class to ShowModelCommand
- [@benjaminniess](https://github.com/benjaminniess) Fix ModelShowCommand extends property


## 10.0.4 - 2023-11-13

## Changed
- [@dcblogdev](https://github.com/dcblogdev) updated module:publish-config to a dynamic path to the service provider

## 10.0.3 - 2023-10-02

## Changed

- [@solomon-ochepa](https://github.com/solomon-ochepa) updated multiple & config stubs to follow modern laravel standards
- [@dcblogdev](https://github.com/dcblogdev) updated enabled `$MODULE_NAMESPACE$` & `$CONTROLLER_NAMESPACE$` placeholders to be used inside stubs
- [@hungthai1401](https://github.com/hungthai1401) updated rule stub

## Added

- [@dcblogdev](https://github.com/dcblogdev) added support for using modules inside the main `vite.config.js` file https://github.com/nWidart/laravel-modules/pull/1682
- [@dcblogdev](https://github.com/dcblogdev) added option to generate a factory by using the flag `-f` when generating a model
- [@hungthai1401](https://github.com/hungthai1401 ) added implicit rule https://github.com/nWidart/laravel-modules/pull/1664


## 10.0.2 - 2023-09-18

## Changed

- reordered config commands and added missing observer command

## 10.0.1 - 2023-09-18

## Added

- [@JaberWiki](https://github.com/JaberWiki) Added Include an optional flag `subpath` for rolling back a module's specific migration file [#1626](https://github.com/nWidart/laravel-modules/pull/1626)
- [@sergiy-petrov](https://github.com/sergiy-petrov) Added support for testing GitHub actions against PHP versions 8.2 and 8.3. [#1624](https://github.com/nWidart/laravel-modules/pull/1624)
- [@hanieas](https://github.com/hanieas) Added make Observer command. [#1623](https://github.com/nWidart/laravel-modules/pull/1623)
- [@alissn](https://github.com/alissn) Add phpdoc to Module facade class for IDE auto-completion. [#1589](https://github.com/nWidart/laravel-modules/pull/1589)
- [@aryala7](https://github.com/aryala7) Add command to create broadcasting channel [#1599](https://github.com/nWidart/laravel-modules/pull/1599)

## Changed

- [@Rattone](https://github.com/Rattone) Updated stubs for command from `name` to `signature` [#1625](https://github.com/nWidart/laravel-modules/pull/1625)
- [@moeen-basra](https://github.com/moeen-basra) Remove the unused Factory import [#1596](https://github.com/nWidart/laravel-modules/pull/1596)
- [@moeen-basra](https://github.com/moeen-basra) Replace the \Config::get with config function [#1596](https://github.com/nWidart/laravel-modules/pull/1596)
- [@aryala7](https://github.com/aryala7) Changed disable module Command to accept array of modules instead of single module to disable [#1591](https://github.com/nWidart/laravel-modules/pull/1591)

## 10.0.0 - 2023-02-14

### Changed

Expand Down
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# CONTRIBUTING

Contributions are welcome, and are accepted via pull requests.
Please review these guidelines before submitting any pull requests.

## Process

1. Fork the project
1. Create a new branch
1. Code, test, commit and push
1. Open a pull request detailing your changes.

## Guidelines

* Please ensure the coding style running `composer pcf`.
* * Pull requests should be accompanied by passing tests.
* Please remember ensure you commit to the correct major version, IE v11 for Laravel 11.

## Setup

Clone your fork, then install the dev dependencies:
```bash
composer install
```
## PHP CS Fixer

Run php-cs-fixer:
```bash
composer pcf
```
## Tests

Run all tests:
```bash
composer test
```

Check coverage:
```bash
composer test-coverage
```
57 changes: 31 additions & 26 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@

[![Latest Version on Packagist](https://img.shields.io/packagist/v/nwidart/laravel-modules.svg?style=flat-square)](https://packagist.org/packages/nwidart/laravel-modules)
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Build Status](https://img.shields.io/travis/nWidart/laravel-modules/master.svg?style=flat-square)](https://travis-ci.org/nWidart/laravel-modules)
[![Scrutinizer Coverage](https://img.shields.io/scrutinizer/coverage/g/nWidart/laravel-modules.svg?maxAge=86400&style=flat-square)](https://scrutinizer-ci.com/g/nWidart/laravel-modules/?branch=master)
[![Quality Score](https://img.shields.io/scrutinizer/g/nWidart/laravel-modules.svg?style=flat-square)](https://scrutinizer-ci.com/g/nWidart/laravel-modules)
[![Total Downloads](https://img.shields.io/packagist/dt/nwidart/laravel-modules.svg?style=flat-square)](https://packagist.org/packages/nwidart/laravel-modules)

| **Laravel** | **laravel-modules** |
Expand All @@ -19,18 +17,20 @@
| 8.0 | ^8.0 |
| 9.0 | ^9.0 |
| 10.0 | ^10.0 |
| 11.0 | ^11.0 |

`nwidart/laravel-modules` is a Laravel package which created to manage your large Laravel app using modules. Module is like a Laravel package, it has some views, controllers or models. This package is supported and tested in Laravel 10.
`nwidart/laravel-modules` is a Laravel package created to manage your large Laravel app using modules. A Module is like a Laravel package, it has some views, controllers or models. This package is supported and tested in Laravel 11.

This package is a re-published, re-organised and maintained version of [pingpong/modules](https://github.com/pingpong-labs/modules), which isn't maintained anymore. This package is used in [AsgardCMS](https://asgardcms.com/).
This package is a re-published, re-organised and maintained version of [pingpong/modules](https://github.com/pingpong-labs/modules), which isn't maintained anymore.

With one big added bonus that the original package didn't have: **tests**.
With one big bonus that the original package didn't have: **tests**.

Find out why you should use this package in the article: [Writing modular applications with laravel-modules](https://nicolaswidart.com/blog/writing-modular-applications-with-laravel-modules).
## upgrade
To upgrade to version V11 follow [Upgrade Guide](https://laravelmodules.com/docs/v11/upgrade) on official document.

## Install

To install through Composer, by run the following command:
To install via Composer, run:

``` bash
composer require nwidart/laravel-modules
Expand All @@ -46,26 +46,36 @@ php artisan vendor:publish --provider="Nwidart\Modules\LaravelModulesServiceProv

### Autoloading

By default, the module classes are not loaded automatically. You can autoload your modules using `psr-4`. For example:

``` json
{
"autoload": {
"psr-4": {
"App\\": "app/",
"Modules\\": "Modules/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/"
}

}
By default, the module classes are not loaded automatically. You can autoload your modules by adding merge-plugin to the extra section:

```json
"extra": {
"laravel": {
"dont-discover": []
},
"merge-plugin": {
"include": [
"Modules/*/composer.json"
]
}
},
```

**Tip: don't forget to run `composer dump-autoload` afterwards.**

## Documentation

You'll find installation instructions and full documentation on [https://docs.laravelmodules.com/](https://docs.laravelmodules.com/).
You'll find installation instructions and full documentation on [https://laravelmodules.com/](https://laravelmodules.com/docs).

## Demo

You can see a demo using Laravel Breeze at https://github.com/laravel-modules-com/breeze-demo

This is a complete application using Auth, Base and Profile modules.

## Community

We also have a Discord community. [https://discord.gg/hkF7BRvRZK](https://discord.gg/hkF7BRvRZK) For quick help, ask questions in the appropriate channel.

## Credits

Expand All @@ -74,11 +84,6 @@ You'll find installation instructions and full documentation on [https://docs.la
- [gravitano](https://github.com/gravitano)
- [All Contributors](../../contributors)

## About Nicolas Widart

Nicolas Widart is a freelance web developer specialising on the Laravel framework. View all my packages [on my website](https://nwidart.com/), or visit [my website](https://nicolaswidart.com).


## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.
Loading

0 comments on commit dabad7f

Please sign in to comment.