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
parent
commit
a45f1c38a1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      .gitignore
  2. 2
      .travis.yml
  3. 9
      app/Couple.php
  4. 10
      app/Exceptions/Handler.php
  5. 2
      app/Http/Middleware/Lang.php
  6. 7
      app/User.php
  7. 13
      composer.json
  8. 1878
      composer.lock
  9. 2
      readme.id.md
  10. 2
      readme.md
  11. 4
      tests/Feature/ManageUserFamiliesTest.php

3
.gitignore

@ -9,4 +9,7 @@ Homestead.json
Homestead.yaml Homestead.yaml
npm-debug.log npm-debug.log
.env .env
.env.backup
.phpunit.result.cache
yarn-error.log
/ftpsync.settings /ftpsync.settings

2
.travis.yml

@ -1,7 +1,7 @@
language: php language: php
php: php:
- 7.2
- 7.3
before_script: before_script:
- travis_retry composer self-update - travis_retry composer self-update

9
app/Couple.php

@ -2,8 +2,8 @@
namespace App; namespace App;
use Ramsey\Uuid\Uuid;
use Illuminate\Database\Eloquent\Model; use Illuminate\Database\Eloquent\Model;
use Ramsey\Uuid\Uuid;
class Couple extends Model class Couple extends Model
{ {
@ -14,6 +14,13 @@ class Couple extends Model
*/ */
public $incrementing = false; public $incrementing = false;
/**
* The "type" of the primary key ID.
*
* @var string
*/
protected $keyType = 'string';
public function husband() public function husband()
{ {
return $this->belongsTo(User::class); return $this->belongsTo(User::class);

10
app/Exceptions/Handler.php

@ -3,7 +3,7 @@
namespace App\Exceptions; namespace App\Exceptions;
use Log; use Log;
use Exception;
use Throwable;
use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\AuthenticationException;
use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; 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. * This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* *
* @param \Exception $exception
* @param \Throwable $exception
* @return void * @return void
*/ */
public function report(Exception $exception)
public function report(Throwable $exception)
{ {
parent::report($exception); parent::report($exception);
} }
@ -41,10 +41,10 @@ class Handler extends ExceptionHandler
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param \Illuminate\Http\Request $request * @param \Illuminate\Http\Request $request
* @param \Exception $exception
* @param \Throwable $exception
* @return \Illuminate\Http\Response * @return \Illuminate\Http\Response
*/ */
public function render($request, Exception $exception)
public function render($request, Throwable $exception)
{ {
return parent::render($request, $exception); return parent::render($request, $exception);
} }

2
app/Http/Middleware/Lang.php

@ -15,7 +15,7 @@ class Lang
*/ */
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
app()->setLocale(request('lang', session('lang', 'id')));
app()->setLocale(request('lang', session('lang', 'en')));
if (request('lang')) { if (request('lang')) {
session(['lang' => request('lang')]); session(['lang' => request('lang')]);
} }

7
app/User.php

@ -19,6 +19,13 @@ class User extends Authenticatable
public $incrementing = false; public $incrementing = false;
/** /**
* The "type" of the primary key ID.
*
* @var string
*/
protected $keyType = 'string';
/**
* The attributes that are mass assignable. * The attributes that are mass assignable.
* *
* @var array * @var array

13
composer.json

@ -5,20 +5,21 @@
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": "^7.1.3",
"backup-manager/laravel": "^1.3",
"php": "^7.3",
"backup-manager/laravel": "^2.0",
"fideloper/proxy": "^4.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" "luthfi/formfield": "^1.0"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.1", "barryvdh/laravel-debugbar": "^3.1",
"filp/whoops": "^2.0", "filp/whoops": "^2.0",
"fzaninotto/faker": "^1.4", "fzaninotto/faker": "^1.4",
"laravel/browser-kit-testing": "^5.0",
"laravel/browser-kit-testing": "^6.0",
"mockery/mockery": "^1.0", "mockery/mockery": "^1.0",
"phpunit/phpunit": "^7.5"
"phpunit/phpunit": "^8.5"
}, },
"autoload": { "autoload": {
"classmap": [ "classmap": [

1878
composer.lock
File diff suppressed because it is too large
View File

2
readme.id.md

@ -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: 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, 2. Database MySQL atau MariaDB,
3. SQlite (untuk automated testing). 3. SQlite (untuk automated testing).

2
readme.md

@ -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 : 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, 2. MySQL or MariaDB database,
3. SQlite (for automated testing). 3. SQlite (for automated testing).

4
tests/Feature/ManageUserFamiliesTest.php

@ -3,8 +3,8 @@
namespace Tests\Feature; namespace Tests\Feature;
use App\User; use App\User;
use Tests\TestCase;
use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\RefreshDatabase;
use Tests\TestCase;
class ManageUserFamiliesTest extends TestCase class ManageUserFamiliesTest extends TestCase
{ {
@ -312,7 +312,7 @@ class ManageUserFamiliesTest extends TestCase
$marriageId = $husband->fresh()->wifes->first()->pivot->id; $marriageId = $husband->fresh()->wifes->first()->pivot->id;
$this->visit(route('profile')); $this->visit(route('profile'));
$this->click('Set Orang Tua');
$this->click(__('user.set_parent'));
$this->seeElement('select', ['name' => 'set_parent_id']); $this->seeElement('select', ['name' => 'set_parent_id']);
$this->submitForm('set_parent_button', [ $this->submitForm('set_parent_button', [

Loading…
Cancel
Save