Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade package #1

Merged
merged 36 commits into from
Mar 21, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
36 commits
Select commit Hold shift + click to select a range
1c3c6d5
Upgrade package
norbybaru Jul 8, 2023
c5a2cab
apply fmt
norbybaru Jul 8, 2023
50544ef
fix code styling
norbybaru Jul 8, 2023
bed20c5
fix
norbybaru Jul 8, 2023
34b579b
refactor
norbybaru Jul 8, 2023
4653120
add middleware scaffolding
norbybaru Oct 13, 2023
38701a4
Add command to create Job,Event,Listerner
norbybaru Oct 23, 2023
1c6bb71
Unit test command and refactor service provider
norbybaru Jan 25, 2024
a30f1ac
module view scaffolding command
norbybaru Mar 18, 2024
f199a3c
Module command for view and view component
norbybaru Jun 15, 2024
e5a5f6a
Fix code analyses
norbybaru Jun 15, 2024
fd95524
Add unit test
norbybaru Jun 16, 2024
d8a2ccc
fix
norbybaru Jun 16, 2024
802166f
fix test
norbybaru Jun 16, 2024
cd994aa
fix test
norbybaru Jun 16, 2024
5a5d842
freeze time
norbybaru Jun 16, 2024
371c2ee
fix time
norbybaru Jun 16, 2024
1b92143
fix migration file check
norbybaru Jun 16, 2024
ef94a51
refactor test
norbybaru Jun 16, 2024
4f9939e
refactor
norbybaru Jun 16, 2024
9bd6d05
refactor
norbybaru Jun 16, 2024
33d8dc5
refactor routes load
norbybaru Jun 18, 2024
692a5d4
Add module make console command and auto register module command
norbybaru Jun 28, 2024
0af36a0
add controller test
norbybaru Jul 7, 2024
c5ab49f
test
norbybaru Jul 7, 2024
35605cb
test
norbybaru Jul 7, 2024
811fb60
Add migration test
norbybaru Jul 7, 2024
78d1851
fix module path
norbybaru Jul 7, 2024
d974ad4
fix service provider auto loading
norbybaru Nov 23, 2024
10edba1
update gitignore
norbybaru Mar 21, 2025
1c434d5
update
norbybaru Mar 21, 2025
c2abd50
Add factory
norbybaru Mar 21, 2025
851cf7f
fix test
norbybaru Mar 21, 2025
66d6770
fix test
norbybaru Mar 21, 2025
ee9fa98
add dependabot
norbybaru Mar 21, 2025
4789dd6
update
norbybaru Mar 21, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "github-actions" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
# Maintain dependencies for Composer
- package-ecosystem: "composer"
directory: "/"
schedule:
interval: "weekly"
labels:
- "composer"
- "dependencies"
26 changes: 26 additions & 0 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: PHPStan

on:
push:
paths:
- '**.php'
- 'phpstan.neon.dist'

jobs:
phpstan:
name: phpstan
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v3

- name: Run PHPStan
run: ./vendor/bin/phpstan --error-format=github
25 changes: 25 additions & 0 deletions .github/workflows/pint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Laravel Pint

on:
push:
paths:
- '**.php'

jobs:
pint:
name: pint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: 8.3
coverage: none

- name: Install composer dependencies
uses: ramsey/composer-install@v3

- name: Run pint
run: ./vendor/bin/pint --test
53 changes: 53 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
name: Run Unit Tests

on:
pull_request:
push:
branches:
- main

jobs:
build:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
php: [8.1, 8.2, 8.3]
laravel: [10.*, 11.*]
dependency-version: [prefer-lowest, prefer-stable]
exclude:
- laravel: 11.*
php: 8.1

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }}

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Setup PHP
uses: shivammathur/setup-php@v2
with:
php-version: ${{matrix.php}}

- name: Get Composer cache directory
id: composer-cache
run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT

- name: Cache Composer dependencies
uses: actions/cache@v4
with:
path: ${{ steps.composer-cache.outputs.dir }}
# Use composer.json for key, if composer.lock is not committed.
key: php-${{ matrix.php }}-lara-${{ matrix.laravel }}-composer-${{ matrix.dependency-version }}-${{ hashFiles('**/composer.json') }}
# key: ${{ runner.os }}-composer-${{ hashFiles('**/composer.lock') }}
restore-keys: php-${{ matrix.php }}-lara-${{ matrix.laravel }}-composer-${{ matrix.dependency-version }}-

- name: Install Composer dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction

- name: Run PHPUnit tests
run: vendor/bin/phpunit --testdox
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
.DS_Store
build/
vendor/
composer.lock
composer.lock
*.cache
9 changes: 4 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,10 @@ Run the following command from your projects root
```php
composer require norbybaru/modularize
```

For Laravel versions lower than 5.5, this step is important after running above script.
- Open your `config/app.php` file and add custom service provider:
```php
NorbyBaru\Modularize\ModularizeServiceProvider::class
## Config
Publish configuration
```bash
php artisan vendor:publish --provider="NorbyBaru\Modularize\ModularizeServiceProvider" --tag="modularize-config"
```

## Usage
Expand Down
37 changes: 30 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"name": "norbybaru/modularize",
"description": "Generate modular structure files for laravel",
"description": "Modularize Laravel application using a modular pattern",
"homepage": "https://github.com/norbybaru/modularize",
"keywords": ["laravel", "modular", "modules", "module", "structure", "modular", "laravel-modular", "modularize"],
"require": {
"php": ">=5.6.4",
"illuminate/support": "^5.6 || ^6.0 || ^7.0"
},
"license": "MIT",
"version": "1.2.2",
"authors": [
{
"name": "Norby Baruani",
Expand All @@ -20,12 +15,40 @@
"NorbyBaru\\Modularize\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"NorbyBaru\\Modularize\\Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"providers": [
"NorbyBaru\\Modularize\\ModularizeServiceProvider"
]
}
},
"minimum-stability": "dev"
"minimum-stability": "dev",
"prefer-stable": true,
"scripts": {
"analyse": "vendor/bin/phpstan analyse",
"pint": "./vendor/bin/pint -v",
"post-autoload-dump": [
"@php vendor/bin/testbench package:discover --ansi"
],
"test": "phpunit"
},
"config": {
"sort-packages": true
},
"require": {
"php": "^8.1",
"illuminate/console": "^10.13|^11.0",
"illuminate/support": "^10.13|^11.0"
},
"require-dev": {
"laravel/pint": "^1.10",
"nunomaduro/larastan": "^2.0",
"orchestra/testbench": "^8.5|^9.0",
"phpunit/phpunit": "^9.5|^10.13|^11.0"
}
}
20 changes: 20 additions & 0 deletions config/modularize.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?php

return [

/**
* By enabling modular config, the package will autoload all modules found in the root_path directory
*/
'enable' => true,

/**
* Define application root directory folder to create modules files
*/
'root_path' => 'modules',

/**
* Routes created under the Routes/ directory of a module would be autoload to be discovered by the application.
* Setting 'autoload_routes => false' will require manually registering module routes through a service provider.
*/
'autoload_routes' => true,
];
16 changes: 16 additions & 0 deletions phpstan.neon.dist
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
includes:
- ./vendor/nunomaduro/larastan/extension.neon

parameters:

paths:
- src
- config

# The level 9 is the highest level
level: 5

tmpDir: build/phpstan
checkModelProperties: true
checkMissingIterableValueType: true
treatPhpDocTypesAsCertain: false
23 changes: 23 additions & 0 deletions phpunit.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<phpunit
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
backupGlobals="false"
bootstrap="vendor/autoload.php"
colors="true"
processIsolation="false"
stopOnFailure="false"
xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.0/phpunit.xsd"
cacheDirectory=".phpunit.cache"
backupStaticProperties="false"
>
<testsuites>
<testsuite name="Test Suite">
<directory suffix="Test.php">./tests</directory>
</testsuite>
</testsuites>
<php>
<env name="APP_ENV" value="testing" force="true"/>
<env name="APP_KEY" value="AckfSECXIvnK5r28GVIWUAxmbBSjTsmF"/>
<env name="DB_CONNECTION" value="testing"/>
</php>
</phpunit>
3 changes: 3 additions & 0 deletions pint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"preset": "laravel"
}
Loading