Browse Source
Merge pull request #52 from nafiesl/47_laravel_7_upgrade
Laravel 7 Upgrade
pull/60/head
Nafies Luthfi
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with
1156 additions and
776 deletions
-
.gitignore
-
.travis.yml
-
app/Couple.php
-
app/Exceptions/Handler.php
-
app/Http/Middleware/Lang.php
-
app/User.php
-
composer.json
-
composer.lock
-
readme.id.md
-
readme.md
-
tests/Feature/ManageUserFamiliesTest.php
|
|
|
@ -9,4 +9,7 @@ Homestead.json |
|
|
|
Homestead.yaml |
|
|
|
npm-debug.log |
|
|
|
.env |
|
|
|
.env.backup |
|
|
|
.phpunit.result.cache |
|
|
|
yarn-error.log |
|
|
|
/ftpsync.settings |
|
|
|
@ -1,7 +1,7 @@ |
|
|
|
language: php |
|
|
|
|
|
|
|
php: |
|
|
|
- 7.2 |
|
|
|
- 7.3 |
|
|
|
|
|
|
|
before_script: |
|
|
|
- travis_retry composer self-update |
|
|
|
|
|
|
|
@ -2,8 +2,8 @@ |
|
|
|
|
|
|
|
namespace App; |
|
|
|
|
|
|
|
use Ramsey\Uuid\Uuid; |
|
|
|
use Illuminate\Database\Eloquent\Model; |
|
|
|
use Ramsey\Uuid\Uuid; |
|
|
|
|
|
|
|
class Couple extends Model |
|
|
|
{ |
|
|
|
@ -14,6 +14,13 @@ class Couple extends Model |
|
|
|
*/ |
|
|
|
public $incrementing = false; |
|
|
|
|
|
|
|
/** |
|
|
|
* The "type" of the primary key ID. |
|
|
|
* |
|
|
|
* @var string |
|
|
|
*/ |
|
|
|
protected $keyType = 'string'; |
|
|
|
|
|
|
|
public function husband() |
|
|
|
{ |
|
|
|
return $this->belongsTo(User::class); |
|
|
|
|
|
|
|
@ -3,7 +3,7 @@ |
|
|
|
namespace App\Exceptions; |
|
|
|
|
|
|
|
use Log; |
|
|
|
use Exception; |
|
|
|
use Throwable; |
|
|
|
use Illuminate\Auth\AuthenticationException; |
|
|
|
use Illuminate\Auth\Access\AuthorizationException; |
|
|
|
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; |
|
|
|
@ -29,10 +29,10 @@ class Handler extends ExceptionHandler |
|
|
|
* |
|
|
|
* This is a great spot to send exceptions to Sentry, Bugsnag, etc. |
|
|
|
* |
|
|
|
* @param \Exception $exception |
|
|
|
* @param \Throwable $exception |
|
|
|
* @return void |
|
|
|
*/ |
|
|
|
public function report(Exception $exception) |
|
|
|
public function report(Throwable $exception) |
|
|
|
{ |
|
|
|
parent::report($exception); |
|
|
|
} |
|
|
|
@ -41,10 +41,10 @@ class Handler extends ExceptionHandler |
|
|
|
* Render an exception into an HTTP response. |
|
|
|
* |
|
|
|
* @param \Illuminate\Http\Request $request |
|
|
|
* @param \Exception $exception |
|
|
|
* @param \Throwable $exception |
|
|
|
* @return \Illuminate\Http\Response |
|
|
|
*/ |
|
|
|
public function render($request, Exception $exception) |
|
|
|
public function render($request, Throwable $exception) |
|
|
|
{ |
|
|
|
return parent::render($request, $exception); |
|
|
|
} |
|
|
|
|
|
|
|
@ -15,7 +15,7 @@ class Lang |
|
|
|
*/ |
|
|
|
public function handle($request, Closure $next) |
|
|
|
{ |
|
|
|
app()->setLocale(request('lang', session('lang', 'id'))); |
|
|
|
app()->setLocale(request('lang', session('lang', 'en'))); |
|
|
|
if (request('lang')) { |
|
|
|
session(['lang' => request('lang')]); |
|
|
|
} |
|
|
|
|
|
|
|
@ -19,6 +19,13 @@ class User extends Authenticatable |
|
|
|
public $incrementing = false; |
|
|
|
|
|
|
|
/** |
|
|
|
* The "type" of the primary key ID. |
|
|
|
* |
|
|
|
* @var string |
|
|
|
*/ |
|
|
|
protected $keyType = 'string'; |
|
|
|
|
|
|
|
/** |
|
|
|
* The attributes that are mass assignable. |
|
|
|
* |
|
|
|
* @var array |
|
|
|
|
|
|
|
@ -5,20 +5,21 @@ |
|
|
|
"license": "MIT", |
|
|
|
"type": "project", |
|
|
|
"require": { |
|
|
|
"php": "^7.1.3", |
|
|
|
"backup-manager/laravel": "^1.3", |
|
|
|
"php": "^7.3", |
|
|
|
"backup-manager/laravel": "^2.0", |
|
|
|
"fideloper/proxy": "^4.0", |
|
|
|
"laravel/framework": "5.8.*", |
|
|
|
"laravel/tinker": "~1.0", |
|
|
|
"laravel/framework": "^7.0", |
|
|
|
"laravel/tinker": "^2.0", |
|
|
|
"laravel/ui": "^2.0", |
|
|
|
"luthfi/formfield": "^1.0" |
|
|
|
}, |
|
|
|
"require-dev": { |
|
|
|
"barryvdh/laravel-debugbar": "^3.1", |
|
|
|
"filp/whoops": "^2.0", |
|
|
|
"fzaninotto/faker": "^1.4", |
|
|
|
"laravel/browser-kit-testing": "^5.0", |
|
|
|
"laravel/browser-kit-testing": "^6.0", |
|
|
|
"mockery/mockery": "^1.0", |
|
|
|
"phpunit/phpunit": "^7.5" |
|
|
|
"phpunit/phpunit": "^8.5" |
|
|
|
}, |
|
|
|
"autoload": { |
|
|
|
"classmap": [ |
|
|
|
|
|
|
|
@ -59,7 +59,7 @@ Aplikasi ini menggunakan Bahasa Indonesia dan Bahasa Inggris, diatur pada `confi |
|
|
|
|
|
|
|
Aplikasi ini dapat dipasang pada server lokal dan onlne dengan spesifikasi berikut: |
|
|
|
|
|
|
|
1. PHP 7.2 (dan mengikuti [server requirements Laravel 5.8](https://laravel.com/docs/5.8#server-requirements) lainnya), |
|
|
|
1. PHP 7.3 (dan mengikuti [server requirements Laravel 7.x](https://laravel.com/docs/7.x/installation#server-requirements) lainnya), |
|
|
|
2. Database MySQL atau MariaDB, |
|
|
|
3. SQlite (untuk automated testing). |
|
|
|
|
|
|
|
|
|
|
|
@ -54,7 +54,7 @@ This application uses Bahasa Indonesia and English based on `config.locale`. |
|
|
|
|
|
|
|
This application can be installed on local server and online server with these specifications : |
|
|
|
|
|
|
|
1. PHP 7.2 (and meet other [Laravel 5.8 server requirements](https://laravel.com/docs/5.8#server-requirements)), |
|
|
|
1. PHP 7.3 (and meet other [Laravel 7.x server requirements](https://laravel.com/docs/7.x/installation#server-requirements)), |
|
|
|
2. MySQL or MariaDB database, |
|
|
|
3. SQlite (for automated testing). |
|
|
|
|
|
|
|
|
|
|
|
@ -3,8 +3,8 @@ |
|
|
|
namespace Tests\Feature; |
|
|
|
|
|
|
|
use App\User; |
|
|
|
use Tests\TestCase; |
|
|
|
use Illuminate\Foundation\Testing\RefreshDatabase; |
|
|
|
use Tests\TestCase; |
|
|
|
|
|
|
|
class ManageUserFamiliesTest extends TestCase |
|
|
|
{ |
|
|
|
@ -312,7 +312,7 @@ class ManageUserFamiliesTest extends TestCase |
|
|
|
$marriageId = $husband->fresh()->wifes->first()->pivot->id; |
|
|
|
|
|
|
|
$this->visit(route('profile')); |
|
|
|
$this->click('Set Orang Tua'); |
|
|
|
$this->click(__('user.set_parent')); |
|
|
|
$this->seeElement('select', ['name' => 'set_parent_id']); |
|
|
|
|
|
|
|
$this->submitForm('set_parent_button', [ |
|
|
|
|