-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 8ca73ee
Showing
13 changed files
with
10,099 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false | ||
|
||
[*.{yml,yaml}] | ||
indent_size = 2 | ||
|
||
[docker-compose.yml] | ||
indent_size = 4 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
* text=auto eol=lf | ||
|
||
*.blade.php diff=html | ||
*.css diff=css | ||
*.html diff=html | ||
*.md diff=markdown | ||
*.php diff=php | ||
|
||
/.github export-ignore | ||
CHANGELOG.md export-ignore | ||
.styleci.yml export-ignore |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
name: "Run Tests - Current" | ||
|
||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
test: | ||
|
||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
php: [ 8.3, 8.2 ] | ||
laravel: [ "^11.0" ] | ||
dependency-version: [ prefer-lowest, prefer-stable ] | ||
include: | ||
- laravel: "^11.0" | ||
testbench: 9.* | ||
exclude: | ||
- laravel: "^11.0" | ||
php: 8.1 | ||
|
||
name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.dependency-version }} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mailparse, mbstring, zip, pcntl, pdo, sqlite, pdo_sqlite, iconv | ||
coverage: none | ||
|
||
- name: Install dependencies (remove passport) | ||
run: composer remove --dev laravel/passport --no-interaction --no-update | ||
if: matrix.laravel == '^8.12' | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" "symfony/console:>=4.3.4" "mockery/mockery:^1.3.2" "nesbot/carbon:>=2.62.1" --no-interaction --no-update | ||
composer update --${{ matrix.dependency-version }} --prefer-dist --no-interaction | ||
- name: Execute tests | ||
run: vendor/bin/phpunit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/.phpunit.cache | ||
/node_modules | ||
/public/build | ||
/public/hot | ||
/public/storage | ||
/storage/*.key | ||
/vendor | ||
.env | ||
.env.backup | ||
.env.production | ||
.phpactor.json | ||
.phpunit.result.cache | ||
Homestead.json | ||
Homestead.yaml | ||
auth.json | ||
npm-debug.log | ||
yarn-error.log | ||
/.fleet | ||
/.idea | ||
/.vscode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
php: | ||
preset: laravel | ||
disabled: | ||
- no_unused_imports | ||
finder: | ||
not-name: | ||
- index.php | ||
js: true | ||
css: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# 📨 Another Laravel CRUD Generator | ||
|
||
Another Laravel CRUD generator. | ||
|
||
This generator only generates the PHP files for a route model based resource controllers. | ||
|
||
Not frontend, no UI, just JSON based backend code. | ||
|
||
## Repository and QueryFilter based controllers | ||
This package is a bit different, as it will include Repository and QueryFilter classes for each CRUD. | ||
|
||
The Repositories are very simple classes that wire up the QueryFilters with the Controllers. | ||
|
||
The QueryFilters are based on the outstanding Laracasts tutorial: | ||
|
||
https://laracasts.com/series/eloquent-techniques/episodes/4 | ||
|
||
THe biggest difference with this implementation of the Dedicated Query filters, is that we use a plain array instead of the Request object. | ||
This makes it easier to reuse the Filters in Jobs, where you don't want to serialize the Request object. | ||
|
||
https://github.com/axyr/laravel-query-filters | ||
|
||
## Generated files | ||
|
||
The generate command will generate the following files: | ||
|
||
- Model | ||
- Controller | ||
- Resources | ||
- Requests | ||
- Policy | ||
- Factory | ||
- migration | ||
- Repository | ||
- Filter | ||
- ControllerTest | ||
- ControllerAuthorisationTest | ||
- FilterTest | ||
|
||
## Modules | ||
|
||
By Default the files will be installed in a app/Modules/{Model} directory. | ||
|
||
The philosophy here is that with Repositories, Filters and Policy classes, we are highly likely creating an above average complex application, | ||
where we want strict separation of concerns from the start and not only groupd files by type only. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
{ | ||
"name": "axyr/laravel-crud-generator", | ||
"description": "Opiniated Laravel CRUD generator for a Module/Repository/Filter based CRUD setup.", | ||
"type": "library", | ||
"autoload": { | ||
"psr-4": { | ||
"Axyr\\CrudGenerator\\": "src/" | ||
} | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Martijn van Nieuwenhoven", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"require": { | ||
"php": "^8.2", | ||
"laravel/framework": "^11.9" | ||
}, | ||
"require-dev": { | ||
"roave/security-advisories": "dev-latest", | ||
"orchestra/testbench": "^9.1" | ||
} | ||
} |
Oops, something went wrong.