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

Task/v2/laravel11 #1076

Closed
wants to merge 13 commits into from
10 changes: 5 additions & 5 deletions .github/workflows/phpstan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0]
laravel: ["8.*"]
laravel-require: [8.0]
php: [8.2]
laravel: ["11.*"]
laravel-require: [11.0]

name: "PHP ${{ matrix.php }} / Laravel ${{ matrix.laravel }}"

Expand All @@ -36,7 +36,7 @@ jobs:
extensions: mbstring, pdo_sqlite, fileinfo, gd, php_pgsql
coverage: none

# Install legacy factories for Laravel 8/9
# Install legacy factories for Laravel 11
- name: Install legacy factories for Laravel
run: composer create-project laravel/laravel:^${{matrix.laravel-require}} laravel

Expand All @@ -59,7 +59,7 @@ jobs:

# Badaso Core Test PHPStan
- name: Badaso core test PHPStan
run: cd laravel &&
run: cd laravel &&
./vendor/bin/phpstan analyse -c vendor/badaso/core/phpstan.neon.dist


18 changes: 9 additions & 9 deletions .github/workflows/phpunit.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,15 +38,15 @@ jobs:
strategy:
fail-fast: false
matrix:
php: [8.0, 8.1]
laravel: ["8.*", "9.*"]
laravel-require: [8.0]
php: [8.2]
laravel: ["11.*"]
laravel-require: [11.0]
mysql-version: [8.0]
coverage: [none]
include:
- php: 8.1
laravel: 9.*
laravel-require: 8.0
- php: 8.2
laravel: 11.*
laravel-require: 11.0
mysql-version: 8.0
coverage: xdebug

Expand All @@ -70,7 +70,7 @@ jobs:
extensions: mbstring, pdo_sqlite, fileinfo, gd, php_pgsql, json, openssl, php_pcov
coverage: xdebug

# Install legacy factories for Laravel 8/9
# Install legacy factories for Laravel 11
- name: Install legacy factories for Laravel
run: composer create-project laravel/laravel:^${{matrix.laravel-require}} laravel

Expand Down Expand Up @@ -130,8 +130,8 @@ jobs:
sed -i 's/DB_PASSWORD=/DB_PASSWORD=postgres/g' .env &&
sed -i 's/DB_HOST=127.0.0.1/DB_HOST=localhost/g' .env &&
sed -i 's/DB_USERNAME=root/DB_USERNAME=postgres/g' .env &&
sed -i 's/DB_PORT=3306/DB_PORT=5432/g' .env
sed -i 's/DB_PORT=3306/DB_PORT=5432/g' .env


# Pgsql | Laravel setup
- name: Pgsql | Laravel setup
Expand Down
2 changes: 1 addition & 1 deletion .gitpod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ image:
file: .gitpod.Dockerfile
tasks:
- name: Starting Project
init: composer create-project laravel/laravel:^8.0 laravel &&
init: composer create-project laravel/laravel:^11.0 laravel &&
mkdir -p laravel/packages/badaso/core &&
mv {,.}* laravel/packages/badaso/core 2>/dev/null; true &&
cd laravel &&
Expand Down
164 changes: 81 additions & 83 deletions .gitpod/composer.json
Original file line number Diff line number Diff line change
@@ -1,86 +1,84 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"require": {
"php": "^8.2",
"laravel/framework": "^11.0",
"laravel/tinker": "^2.9",
"laravel-doctrine/orm": "2.1",
"psr/http-message": "1.1",
"arcanedev/log-viewer": "^11.0",
"darkaonline/l5-swagger": "^8.6",
"phpstan/phpstan": "^1.11",
"spatie/laravel-backup": "^8.8",
"unisharp/laravel-filemanager": "^2.9",
"spatie/laravel-activitylog": "^4.8",
"php-open-source-saver/jwt-auth": "^2.3",
"google/apiclient": "^2.16",
"spatie/flysystem-dropbox": "^3.0",
"masbug/flysystem-google-drive-ext": "^2.3",
"laravel/octane": "^2.3",
"laravel/sanctum": "^4.0",
"laravel/ui": "^4.5",
"webpatser/laravel-uuid": "^4.0",
"predis/predis": "^2.2",
"league/flysystem-aws-s3-v3": "^3.28",
"league/flysystem": "^3.28",
"doctrine/dbal": "^3.8"
},
"require-dev": {
"fakerphp/faker": "^1.23",
"laravel/pint": "^1.13",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.6",
"nunomaduro/collision": "^8.0",
"phpunit/phpunit": "^11.0.1",
"spatie/laravel-ignition": "^2.4"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Uasoft\\Badaso\\": "packages/badaso/core/src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"license": "MIT",
"require": {
"php": "^7.3|^8.0",
"fruitcake/laravel-cors": "^2.0",
"laravel/framework": "^8.75",
"masbug/flysystem-google-drive-ext": "*",
"google/apiclient": "^2.12",
"arcanedev/log-viewer": "^8.1|^9.0",
"darkaonline/l5-swagger": "^8.0|^8.3",
"doctrine/dbal": "^2.5",
"guzzlehttp/guzzle": "^7.2",
"larapack/doctrine-support": "^0.1.9",
"laravel/octane": "^1.2",
"laravel/sanctum": "^2.14.1",
"laravel/tinker": "^2.7",
"laravel/ui": "^3.4",
"league/flysystem": "~1.1|~2.0|~3.0",
"league/flysystem-aws-s3-v3": "^1.0.28|^3.0",
"php-open-source-saver/jwt-auth": "^1.4",
"phpstan/phpstan": "^1.4",
"predis/predis": "^1.1",
"symfony/var-exporter": "^5.2.0|^6.0",
"spatie/flysystem-dropbox": "^1.2.2|^2.0",
"spatie/laravel-activitylog": "^3.17|^4.4",
"spatie/laravel-backup": "^6.16|^8.1.0",
"unisharp/laravel-filemanager": "^2.4",
"webpatser/laravel-uuid": "^4.0",
"zircote/swagger-php": "^3.2"
},
"require-dev": {
"facade/ignition": "^2.5",
"fakerphp/faker": "^1.9.1",
"laravel/sail": "^1.0.1",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^5.10",
"phpunit/phpunit": "^9.5.10"
},
"autoload": {
"psr-4": {
"App\\": "app/",
"Database\\Factories\\": "database/factories/",
"Database\\Seeders\\": "database/seeders/",
"Uasoft\\Badaso\\": "packages/badaso/core/src/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"scripts": {
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover --ansi"
],
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
"post-update-cmd": [
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate --ansi"
]
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"config": {
"optimize-autoloader": true,
"preferred-install": "dist",
"sort-packages": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
30 changes: 10 additions & 20 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Steps for registering and getting a license on Badaso Dashboard can be found on

After getting the license, you can proceed to Badaso installation.

1, Clone badaso into Laravel project. Sample:
1. Clone badaso into Laravel project. Sample:
- Root Laravel Project
- /packages // new folder
- /badaso // new folder
Expand All @@ -56,26 +56,16 @@ cd into badaso directory, then run
git clone https://github.com/uasoft-indonesia/badaso.git
```

2. Add the following Badaso provider and JWT provider to ```/config/app.php```.
2. Add the following Badaso provider ```/bootstrap/providers.php```.

```
'providers' => [
'return' => [
...,
Uasoft\Badaso\Providers\BadasoServiceProvider::class,
PHPOpenSourceSaver\JWTAuth\Providers\LaravelServiceProvider::class,
"Uasoft\\Badaso\\Providers\\BadasoServiceProvider"
]
```

3. Add the following aliases to ```config/app.php```.
```
'aliases' => [
...,
'JWTAuth' => PHPOpenSourceSaver\JWTAuth\Facades\JWTAuth::class,
'JWTFactory' => PHPOpenSourceSaver\JWTAuth\Facades\JWTFactory::class,
]
```

4. Add badaso providers to autoload
3. Add badaso providers to autoload

```
"autoload": {
Expand All @@ -87,21 +77,21 @@ git clone https://github.com/uasoft-indonesia/badaso.git
}
```

5. Copy required library from ```packages/badaso/core/composer.json``` to ```/composer.json``` then ```composer install```
4. Copy required library from ```packages/badaso/core/composer.json``` to ```/composer.json``` then ```composer install```

6. Run the following commands to update dependencies in package.json and webpack.
5. Run the following commands to update dependencies in package.json and webpack.
```
php artisan badaso:setup
```

7. Run the following commands in sequence.
6. Run the following commands in sequence.
```
composer dump-autoload
php artisan migrate
php artisan db:seed --class=BadasoSeeder
```

8. Open the ```env``` file then add the following lines.
7. Open the ```env``` file then add the following lines.
```
#Set a key as secret key for generating JWT token
JWT_SECRET=
Expand Down Expand Up @@ -131,7 +121,7 @@ MIX_LOG_VIEWER_ROUTE="log-viewer"
MIX_ADMIN_PANEL_ROUTE_PREFIX, MIX_API_ROUTE_PREFIX & MIX_LOG_VIEWER_ROUTE should be different
:::

9. Add the following Badaso guard and auth provider in ```config/auth.php```. Make sure to use Badaso guard as auth default in ```config/auth.php```.
8. Add the following Badaso guard and auth provider in ```config/auth.php```. Make sure to use Badaso guard as auth default in ```config/auth.php```.
<!--DOCUSAURUS_CODE_TABS-->
<!--PHP-->
```php
Expand Down
41 changes: 18 additions & 23 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,30 +24,25 @@
},
"type": "library",
"require": {
"laravel-doctrine/orm": "2.1",
"psr/http-message": "1.1",
"arcanedev/log-viewer": "8.1.0",
"larapack/doctrine-support": "0.1.9",
"darkaonline/l5-swagger": "8.5",
"symfony/var-exporter": "5.4.21",
"phpstan/phpstan": "1.10.15",
"spatie/laravel-backup": "7.8",
"unisharp/laravel-filemanager": "2.6",
"spatie/laravel-activitylog": "4.7.1",
"php-open-source-saver/jwt-auth": "2.1.0",
"google/apiclient": "2.13.2",
"spatie/flysystem-dropbox": "1.2.3",
"masbug/flysystem-google-drive-ext": "1.3.2",
"laravel/octane": "1.5.5",
"laravel/sanctum": "2.15.1",
"laravel/tinker": "2.8.1",
"laravel/ui": "3.4.6",
"webpatser/laravel-uuid": "4.0.1",
"predis/predis": "2.1.2",
"guzzlehttp/guzzle": "7.5.1",
"zircote/swagger-php": "4.7.10",
"doctrine/dbal": "2.13.9",
"league/flysystem-aws-s3-v3": "1.0.29",
"league/flysystem": "1.1.10"
"arcanedev/log-viewer": "^11.0",
"darkaonline/l5-swagger": "^8.6",
"phpstan/phpstan": "^1.11",
"spatie/laravel-backup": "^8.8",
"unisharp/laravel-filemanager": "^2.9",
"spatie/laravel-activitylog": "^4.8",
"php-open-source-saver/jwt-auth": "^2.3",
"google/apiclient": "^2.16",
"spatie/flysystem-dropbox": "^3.0",
"masbug/flysystem-google-drive-ext": "^2.3",
"laravel/octane": "^2.3",
"laravel/sanctum": "^4.0",
"laravel/ui": "^4.5",
"webpatser/laravel-uuid": "^4.0",
"predis/predis": "^2.2",
"league/flysystem-aws-s3-v3": "^3.28",
"league/flysystem": "^3.28"
},
"require-dev": {
"phpunit/phpunit": "^9.5",
Expand Down
6 changes: 6 additions & 0 deletions src/Config/badaso-hidden-tables.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,10 @@
'personal_access_tokens',
'users',
'password_resets',
'cache',
'cache_locks',
'jobs',
'job_batches',
'password_reset_tokens',
'sessions',
];
Loading
Loading