384 Laravel 6 changes (#385)

* 384 Laravel 6 changes

* Library versions

* Update package versions

* Add keyType to models

* Remove unused dependencies

* StyleCI fixes

* Fix models for test

* Fix tests output and update test runner

* Unused imports

* Update exceptions handler

* Fix login page
This commit is contained in:
Nabeel S
2019-09-13 08:05:02 -04:00
committed by GitHub
parent 7a76ac4226
commit 23eb9dcbda
48 changed files with 935 additions and 829 deletions

View File

@@ -9,6 +9,14 @@ indent_size = 2
indent_style = space indent_style = space
indent_size = 4 indent_size = 4
[*.blade.php]
indent_style = space
indent_size = 2
[*.stub]
indent_style = space
indent_size = 4
[Makefile] [Makefile]
indent_style = tab indent_style = tab

View File

@@ -13,6 +13,9 @@
<directory suffix="Test.php">./tests</directory> <directory suffix="Test.php">./tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<extensions>
<extension class="Tests\Bootstrap"/>
</extensions>
<filter> <filter>
<whitelist processUncoveredFilesFromWhitelist="true"> <whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory> <directory suffix=".php">./app</directory>
@@ -22,16 +25,21 @@
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/> <listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
</listeners> </listeners>
<php> <php>
<env name="APP_ENV" value="unittest"/>
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
<env name="APP_DEBUG" value="true"/>
<env name="APP_LOG_LEVEL" value="debug"/>
<env name="DB_CONNECTION" value="memory"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<ini name="error_reporting" value="E_ALL"/> <ini name="error_reporting" value="E_ALL"/>
<ini name="display_errors" value="On"/> <ini name="display_errors" value="On"/>
<ini name="display_startup_errors" value="On"/> <ini name="display_startup_errors" value="On"/>
<server name="APP_ENV" value="testing"/>
<server name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
<server name="APP_DEBUG" value="true"/>
<server name="APP_LOG_LEVEL" value="debug"/>
<server name="DB_CONNECTION" value="memory"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="QUEUE_DRIVER" value="sync"/>
<server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
<server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
<server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
<server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
<server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>
</php> </php>
</phpunit> </phpunit>

View File

@@ -2,7 +2,7 @@
namespace App\Console; namespace App\Console;
use Log; use Illuminate\Support\Facades\Log;
use Symfony\Component\Process\Process; use Symfony\Component\Process\Process;
/** /**
@@ -10,6 +10,16 @@ use Symfony\Component\Process\Process;
*/ */
abstract class Command extends \Illuminate\Console\Command abstract class Command extends \Illuminate\Console\Command
{ {
public function __construct()
{
parent::__construct();
// Running in the console but not in the tests
if (app()->runningInConsole() && env('APP_ENV') !== 'testing') {
$this->redirectLoggingToFile('stdout');
}
}
/** /**
* @return mixed * @return mixed
*/ */

View File

@@ -7,9 +7,6 @@ use App\Facades\Utils;
use GuzzleHttp\Client; use GuzzleHttp\Client;
use Illuminate\Database\Eloquent\Collection; use Illuminate\Database\Eloquent\Collection;
/**
* Class AcarsReplay
*/
class AcarsReplay extends Command class AcarsReplay extends Command
{ {
protected $signature = 'phpvms:replay {files} {--manual} {--write-all} {--no-submit}'; protected $signature = 'phpvms:replay {files} {--manual} {--write-all} {--no-submit}';
@@ -47,8 +44,6 @@ class AcarsReplay extends Command
{ {
parent::__construct(); parent::__construct();
$this->redirectLoggingToFile('stdout');
$this->httpClient = new Client([ $this->httpClient = new Client([
'base_uri' => config('app.url'), 'base_uri' => config('app.url'),
'headers' => [ 'headers' => [

View File

@@ -3,23 +3,13 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Console\Command;
use Artisan; use Illuminate\Support\Facades\Artisan;
/**
* Class ComposerCommand
*/
class ComposerCommand extends Command class ComposerCommand extends Command
{ {
protected $signature = 'phpvms:composer {cmd}'; protected $signature = 'phpvms:composer {cmd}';
protected $description = 'Composer related tasks'; protected $description = 'Composer related tasks';
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('stdout');
}
/** /**
* Run composer update related commands * Run composer update related commands
*/ */

View File

@@ -3,12 +3,9 @@
namespace App\Console\Commands; namespace App\Console\Commands;
use App\Console\Command; use App\Console\Command;
use Log; use Illuminate\Support\Facades\Log;
use Tivie\OS\Detector; use Tivie\OS\Detector;
/**
* Class CreateDatabase
*/
class CreateDatabase extends Command class CreateDatabase extends Command
{ {
protected $signature = 'database:create {--reset} {--conn=?}'; protected $signature = 'database:create {--reset} {--conn=?}';
@@ -21,8 +18,6 @@ class CreateDatabase extends Command
public function __construct() public function __construct()
{ {
parent::__construct(); parent::__construct();
$this->redirectLoggingToFile('stdout');
$this->os = new Detector(); $this->os = new Detector();
} }

View File

@@ -19,9 +19,6 @@ use Illuminate\Support\Facades\Schema;
use PDO; use PDO;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
/**
* Class DevCommands
*/
class DevCommands extends Command class DevCommands extends Command
{ {
protected $signature = 'phpvms {cmd} {param?}'; protected $signature = 'phpvms {cmd} {param?}';
@@ -37,7 +34,6 @@ class DevCommands extends Command
{ {
parent::__construct(); parent::__construct();
$this->redirectLoggingToFile('stdout');
$this->dbSvc = $dbSvc; $this->dbSvc = $dbSvc;
} }

View File

@@ -27,7 +27,6 @@ class DevInstall extends Command
{ {
parent::__construct(); parent::__construct();
$this->redirectLoggingToFile('stdout');
$this->databaseSeeder = $databaseSeeder; $this->databaseSeeder = $databaseSeeder;
} }

View File

@@ -5,9 +5,6 @@ namespace App\Console\Commands;
use App\Console\Command; use App\Console\Command;
use App\Services\ImportService; use App\Services\ImportService;
/**
* Class ImportCsv
*/
class ImportCsv extends Command class ImportCsv extends Command
{ {
protected $signature = 'phpvms:csv-import {type} {file}'; protected $signature = 'phpvms:csv-import {type} {file}';
@@ -24,7 +21,6 @@ class ImportCsv extends Command
{ {
parent::__construct(); parent::__construct();
$this->redirectLoggingToFile('stdout');
$this->importer = $importer; $this->importer = $importer;
} }

View File

@@ -6,21 +6,11 @@ use App\Console\Command;
use App\Models\Enums\NavaidType; use App\Models\Enums\NavaidType;
use App\Models\Navdata; use App\Models\Navdata;
/**
* Class NavdataImport
*/
class NavdataImport extends Command class NavdataImport extends Command
{ {
protected $signature = 'phpvms:navdata'; protected $signature = 'phpvms:navdata';
protected $description = ''; protected $description = '';
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('stdout');
}
/** /**
* @throws \League\Geotools\Exception\InvalidArgumentException * @throws \League\Geotools\Exception\InvalidArgumentException
* *

View File

@@ -5,20 +5,11 @@ namespace App\Console\Commands;
use App\Console\Command; use App\Console\Command;
use GuzzleHttp\Client; use GuzzleHttp\Client;
/**
* Class TestApi
*/
class TestApi extends Command class TestApi extends Command
{ {
protected $signature = 'phpvms:test-api {apikey} {url}'; protected $signature = 'phpvms:test-api {apikey} {url}';
protected $httpClient; protected $httpClient;
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('stdout');
}
/** /**
* Run dev related commands * Run dev related commands
*/ */

View File

@@ -6,9 +6,6 @@ use App\Console\Command;
use App\Services\VersionService; use App\Services\VersionService;
use Symfony\Component\Yaml\Yaml; use Symfony\Component\Yaml\Yaml;
/**
* Class Version
*/
class Version extends Command class Version extends Command
{ {
protected $signature = 'phpvms:version {--write} {--base-only}'; protected $signature = 'phpvms:version {--write} {--base-only}';
@@ -19,7 +16,6 @@ class Version extends Command
{ {
parent::__construct(); parent::__construct();
$this->redirectLoggingToFile('stdout');
$this->versionSvc = $versionSvc; $this->versionSvc = $versionSvc;
} }

View File

@@ -14,13 +14,6 @@ class YamlExport extends Command
protected $signature = 'phpvms:yaml-export {tables*}'; protected $signature = 'phpvms:yaml-export {tables*}';
protected $description = 'YAML table export'; protected $description = 'YAML table export';
public function __construct()
{
parent::__construct();
$this->redirectLoggingToFile('stdout');
}
/** /**
* Run dev related commands * Run dev related commands
*/ */

View File

@@ -24,7 +24,6 @@ class YamlImport extends Command
parent::__construct(); parent::__construct();
$this->dbSvc = $dbSvc; $this->dbSvc = $dbSvc;
$this->redirectLoggingToFile('stdout');
} }
/** /**

View File

@@ -9,9 +9,6 @@ use App\Console\Cron\Weekly;
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
/**
* Class Kernel
*/
class Kernel extends ConsoleKernel class Kernel extends ConsoleKernel
{ {
/** /**

View File

@@ -7,8 +7,6 @@ namespace App\Contracts;
*/ */
class FormRequest extends \Illuminate\Foundation\Http\FormRequest class FormRequest extends \Illuminate\Foundation\Http\FormRequest
{ {
protected $sanitizer;
/** /**
* @return bool * @return bool
*/ */

View File

@@ -9,6 +9,7 @@ use App\Exceptions\Converters\ValidationException;
use Exception; use Exception;
use Illuminate\Auth\Access\AuthorizationException; use Illuminate\Auth\Access\AuthorizationException;
use Illuminate\Auth\AuthenticationException; use Illuminate\Auth\AuthenticationException;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Database\Eloquent\ModelNotFoundException; use Illuminate\Database\Eloquent\ModelNotFoundException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Illuminate\Http\Request; use Illuminate\Http\Request;
@@ -19,6 +20,7 @@ use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\HttpException as SymfonyHttpException; use Symfony\Component\HttpKernel\Exception\HttpException as SymfonyHttpException;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface; use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Whoops\Handler\HandlerInterface;
/** /**
* Class Handler * Class Handler
@@ -133,4 +135,16 @@ class Handler extends ExceptionHandler
return $this->convertExceptionToResponse($e); return $this->convertExceptionToResponse($e);
} }
/**
* Ignition error page integration
*/
protected function whoopsHandler()
{
try {
return app(HandlerInterface::class);
} catch (BindingResolutionException $e) {
return parent::whoopsHandler();
}
}
} }

View File

@@ -8,6 +8,7 @@ use App\Http\Resources\AirportDistance as AirportDistanceResource;
use App\Repositories\AirportRepository; use App\Repositories\AirportRepository;
use App\Services\AirportService; use App\Services\AirportService;
use Illuminate\Http\Request; use Illuminate\Http\Request;
use Prettus\Repository\Criteria\RequestCriteria;
/** /**
* Class AirportController * Class AirportController
@@ -45,6 +46,8 @@ class AirportController extends Controller
$where['hub'] = $request->get('hub'); $where['hub'] = $request->get('hub');
} }
$this->airportRepo->pushCriteria(new RequestCriteria($request));
$airports = $this->airportRepo $airports = $this->airportRepo
->whereOrder($where, 'icao', 'asc') ->whereOrder($where, 'icao', 'asc')
->paginate(); ->paginate();

View File

@@ -28,6 +28,8 @@ class Acars extends Model
use HashIdTrait; use HashIdTrait;
public $table = 'acars'; public $table = 'acars';
protected $keyType = 'string';
public $incrementing = false; public $incrementing = false;
public $fillable = [ public $fillable = [

View File

@@ -30,8 +30,10 @@ class Airport extends Model
use FilesTrait; use FilesTrait;
public $table = 'airports'; public $table = 'airports';
public $timestamps = false;
protected $keyType = 'string';
public $incrementing = false; public $incrementing = false;
public $timestamps = false;
protected $fillable = [ protected $fillable = [
'id', 'id',

View File

@@ -23,7 +23,9 @@ class File extends Model
use HashIdTrait; use HashIdTrait;
use ReferenceTrait; use ReferenceTrait;
protected $table = 'files'; public $table = 'files';
protected $keyType = 'string';
public $incrementing = false; public $incrementing = false;
protected $fillable = [ protected $fillable = [

View File

@@ -38,12 +38,14 @@ class Flight extends Model
use HashIdTrait; use HashIdTrait;
public $table = 'flights'; public $table = 'flights';
public $incrementing = false;
/** The form wants this */ /** The form wants this */
public $hours; public $hours;
public $minutes; public $minutes;
protected $keyType = 'string';
public $incrementing = false;
protected $fillable = [ protected $fillable = [
'id', 'id',
'airline_id', 'airline_id',

View File

@@ -4,13 +4,11 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/**
* Class Navdata
*/
class Navdata extends Model class Navdata extends Model
{ {
public $table = 'navdata'; public $table = 'navdata';
protected $keyType = 'string';
public $timestamps = false; public $timestamps = false;
public $incrementing = false; public $incrementing = false;

View File

@@ -4,9 +4,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/**
* Class News
*/
class News extends Model class News extends Model
{ {
public $table = 'news'; public $table = 'news';

View File

@@ -13,8 +13,6 @@ use Carbon\Carbon;
use Illuminate\Support\Collection; use Illuminate\Support\Collection;
/** /**
* Class Pirep
*
* @property string id * @property string id
* @property string flight_number * @property string flight_number
* @property string route_code * @property string route_code
@@ -57,6 +55,8 @@ class Pirep extends Model
use HashIdTrait; use HashIdTrait;
public $table = 'pireps'; public $table = 'pireps';
protected $keyType = 'string';
public $incrementing = false; public $incrementing = false;
/** The form wants this */ /** The form wants this */

View File

@@ -5,8 +5,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/** /**
* Class PirepComment
*
* @property string pirep_id * @property string pirep_id
* @property int user_id * @property int user_id
*/ */

View File

@@ -4,9 +4,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/**
* Class PirepFare
*/
class PirepFare extends Model class PirepFare extends Model
{ {
public $table = 'pirep_fares'; public $table = 'pirep_fares';

View File

@@ -5,8 +5,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/** /**
* Class PirepField
*
* @property string name * @property string name
* @property string slug * @property string slug
*/ */

View File

@@ -6,7 +6,11 @@ use App\Contracts\Model;
use App\Models\Enums\PirepFieldSource; use App\Models\Enums\PirepFieldSource;
/** /**
* Class PirepFieldValue * @property string pirep_id
* @property string name
* @property string slug
* @property string value
* @property string source
*/ */
class PirepFieldValue extends Model class PirepFieldValue extends Model
{ {

View File

@@ -5,8 +5,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/** /**
* Class Rank
*
* @property string name * @property string name
* @property int hours * @property int hours
* @property float manual_base_pay_rate * @property float manual_base_pay_rate

View File

@@ -5,8 +5,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/** /**
* Class Setting
*
* @property string id * @property string id
* @property string name * @property string name
* @property string key * @property string key
@@ -19,6 +17,8 @@ use App\Contracts\Model;
class Setting extends Model class Setting extends Model
{ {
public $table = 'settings'; public $table = 'settings';
protected $keyType = 'string';
public $incrementing = false; public $incrementing = false;
protected $fillable = [ protected $fillable = [

View File

@@ -4,9 +4,6 @@ namespace App\Models;
use App\Contracts\Model; use App\Contracts\Model;
/**
* Class UserAward
*/
class UserAward extends Model class UserAward extends Model
{ {
public $table = 'user_awards'; public $table = 'user_awards';

View File

@@ -2,10 +2,10 @@
namespace App\Providers; namespace App\Providers;
use App\Support\TimezonelistExtended; use App\Support\Timezonelist;
use Illuminate\Support\ServiceProvider; use Illuminate\Support\ServiceProvider;
class ExtendedTimezonelistProvider extends ServiceProvider class TimezonelistProvider extends ServiceProvider
{ {
/** /**
* Bootstrap services. * Bootstrap services.
@@ -24,7 +24,7 @@ class ExtendedTimezonelistProvider extends ServiceProvider
public function register() public function register()
{ {
$this->app->singleton('timezonelist', function ($app) { $this->app->singleton('timezonelist', function ($app) {
return new TimezonelistExtended(); return new Timezonelist();
}); });
} }
} }

View File

@@ -1,12 +1,67 @@
<?php <?php
/**
* MIT License
* Copyright (c) 2017 Anh Đỗ
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
namespace App\Support; namespace App\Support;
use DateTimeZone; use DateTimeZone;
use Jackiedo\Timezonelist\Timezonelist;
class TimezonelistExtended extends Timezonelist /**
* This library is from:
* https://github.com/JackieDo/Timezone-List
*
* With some changes to suite the formatting, etc that we need
*/
class Timezonelist
{ {
/**
* Whitespace seperate
*/
const WHITESPACE_SEP = '&nbsp;&nbsp;&nbsp;&nbsp;';
/**
* Popular timezones
*
* @var array
*/
protected $popularTimezones = [
'GMT' => 'GMT timezone',
'UTC' => 'UTC timezone',
];
/**
* All continents of the world
*
* @var array
*/
protected $continents = [
'Africa' => DateTimeZone::AFRICA,
'America' => DateTimeZone::AMERICA,
'Antarctica' => DateTimeZone::ANTARCTICA,
'Arctic' => DateTimeZone::ARCTIC,
'Asia' => DateTimeZone::ASIA,
'Atlantic' => DateTimeZone::ATLANTIC,
'Australia' => DateTimeZone::AUSTRALIA,
'Europe' => DateTimeZone::EUROPE,
'Indian' => DateTimeZone::INDIAN,
'Pacific' => DateTimeZone::PACIFIC,
];
/** /**
* Format to display timezones * Format to display timezones
* *

View File

@@ -12,49 +12,44 @@
"ext-mbstring": "*", "ext-mbstring": "*",
"ext-simplexml": "*", "ext-simplexml": "*",
"ext-pdo": "*", "ext-pdo": "*",
"composer/composer": "1.8.*", "composer/composer": "~1.8.0",
"laravel/framework": "5.8.*", "laravel/framework": "~6.0.0",
"akaunting/money": "1.0.*", "akaunting/money": "^1.0",
"anhskohbo/no-captcha": "3.0.*", "anhskohbo/no-captcha": "^3.0",
"appstract/laravel-opcache": "^2.0", "appstract/laravel-opcache": "^2.0",
"arrilot/laravel-widgets": "3.13.*", "arrilot/laravel-widgets": "~3.13.0",
"doctrine/dbal": "2.9.*", "doctrine/dbal": "~2.9.2",
"elcobvg/laravel-opcache": "0.4.*", "elcobvg/laravel-opcache": "~0.4",
"fzaninotto/faker": "^1.8", "guzzlehttp/guzzle": "~6.3.3",
"guzzlehttp/guzzle": "6.3.*", "hashids/hashids": "^2.0.0",
"hashids/hashids": "2.0.*", "igaster/laravel-theme": "^2.0",
"igaster/laravel-theme": "2.0.*",
"intervention/image": "2.4.*", "intervention/image": "2.4.*",
"irazasyed/laravel-gamp": "1.3.*", "irazasyed/laravel-gamp": "^1.4",
"jackiedo/timezonelist": "5.*",
"jmikola/geojson": "1.0.*", "jmikola/geojson": "1.0.*",
"joshbrw/laravel-module-installer": "0.1.*", "joshbrw/laravel-module-installer": "0.1.*",
"laracasts/flash": "3.0.*", "laracasts/flash": "^3.0",
"laravel/helpers": "^1.0", "laravel/helpers": "^1.0",
"laravelcollective/html": "^5.8", "laravelcollective/html": "~6.0.0",
"league/csv": "9.2.*", "league/csv": "9.2.*",
"league/geotools": "0.8.*", "league/geotools": "0.8.*",
"league/iso3166": "2.1.*", "league/iso3166": "2.1.*",
"markrogoyski/math-php": "^0.38.0", "markrogoyski/math-php": "^0.38.0",
"myclabs/deep-copy": "1.8.*", "myclabs/deep-copy": "1.8.*",
"nabeel/vacentral": "2.x", "nabeel/vacentral": "~2.0",
"nwidart/laravel-modules": "5.*", "nwidart/laravel-modules": "~5.1",
"php-units-of-measure/php-units-of-measure": "2.1.*", "php-units-of-measure/php-units-of-measure": "~2.1.0",
"pragmarx/version": "0.2.*", "pragmarx/version": "0.2.*",
"predis/predis": "1.1.*", "prettus/l5-repository": "~2.6.0",
"prettus/l5-repository": "2.6.*", "santigarcor/laratrust": "~5.2.0",
"santigarcor/laratrust": "5.2.*", "sebastiaanluca/laravel-helpers": "~4.0",
"sebastiaanluca/laravel-helpers": "3.*", "semver/semver": "~1.1.0",
"semver/semver": "1.1.*", "spatie/laravel-backup": "~6.3",
"spatie/laravel-backup": "6.3.*", "spatie/valuestore": "~1.2.3",
"spatie/laravel-pjax": "1.3.*", "symfony/polyfill-iconv": "~1.12",
"spatie/valuestore": "1.2.*",
"symfony/polyfill-iconv": "^1.11",
"theiconic/php-ga-measurement-protocol": "2.7.*", "theiconic/php-ga-measurement-protocol": "2.7.*",
"tivie/php-os-detector": "1.1.*", "tivie/php-os-detector": "~1.1.0",
"toin0u/geotools-laravel": "1.0.*", "webpatser/laravel-uuid": "~3.0",
"waavi/sanitizer": "1.0.*", "facade/ignition": "^1.6"
"webpatser/laravel-uuid": "3.*"
}, },
"require-dev": { "require-dev": {
"barryvdh/laravel-debugbar": "^3.0", "barryvdh/laravel-debugbar": "^3.0",
@@ -62,6 +57,7 @@
"bpocallaghan/generators": "5.0.1", "bpocallaghan/generators": "5.0.1",
"codedungeon/phpunit-result-printer": "^0.13.0", "codedungeon/phpunit-result-printer": "^0.13.0",
"filp/whoops": "~2.0", "filp/whoops": "~2.0",
"fzaninotto/faker": "~1.8.0",
"friendsofphp/php-cs-fixer": "^2.15", "friendsofphp/php-cs-fixer": "^2.15",
"mockery/mockery": "0.9.*", "mockery/mockery": "0.9.*",
"nunomaduro/collision": "^2.0", "nunomaduro/collision": "^2.0",

1076
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -68,8 +68,6 @@ return [
Laracasts\Flash\FlashServiceProvider::class, Laracasts\Flash\FlashServiceProvider::class,
Prettus\Repository\Providers\RepositoryServiceProvider::class, Prettus\Repository\Providers\RepositoryServiceProvider::class,
SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class, SebastiaanLuca\Helpers\Collections\CollectionMacrosServiceProvider::class,
Toin0u\Geotools\GeotoolsServiceProvider::class,
Jackiedo\Timezonelist\TimezonelistServiceProvider::class,
Irazasyed\LaravelGAMP\LaravelGAMPServiceProvider::class, Irazasyed\LaravelGAMP\LaravelGAMPServiceProvider::class,
Igaster\LaravelTheme\themeServiceProvider::class, Igaster\LaravelTheme\themeServiceProvider::class,
Nwidart\Modules\LaravelModulesServiceProvider::class, Nwidart\Modules\LaravelModulesServiceProvider::class,
@@ -84,7 +82,7 @@ return [
App\Providers\AuthServiceProvider::class, App\Providers\AuthServiceProvider::class,
App\Providers\EventServiceProvider::class, App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class, App\Providers\RouteServiceProvider::class,
App\Providers\ExtendedTimezonelistProvider::class, App\Providers\TimezonelistProvider::class,
App\Providers\MeasurementsProvider::class, App\Providers\MeasurementsProvider::class,
App\Providers\BindServiceProviders::class, App\Providers\BindServiceProviders::class,
], ],
@@ -106,7 +104,6 @@ return [
'Flash' => Laracasts\Flash\Flash::class, 'Flash' => Laracasts\Flash\Flash::class,
'Form' => Collective\Html\FormFacade::class, 'Form' => Collective\Html\FormFacade::class,
'Gate' => Illuminate\Support\Facades\Gate::class, 'Gate' => Illuminate\Support\Facades\Gate::class,
'Geotools' => Toin0u\Geotools\Facade\Geotools::class,
'Hash' => Illuminate\Support\Facades\Hash::class, 'Hash' => Illuminate\Support\Facades\Hash::class,
'Html' => Collective\Html\HtmlFacade::class, 'Html' => Collective\Html\HtmlFacade::class,
'Lang' => Illuminate\Support\Facades\Lang::class, 'Lang' => Illuminate\Support\Facades\Lang::class,

View File

@@ -32,9 +32,9 @@ return [
'timezone' => '+00:00', 'timezone' => '+00:00',
'prefix' => '', 'prefix' => '',
], ],
'unittest' => [ 'testing' => [
'driver' => 'sqlite', 'driver' => 'sqlite',
'database' => storage_path('unittest.sqlite'), 'database' => storage_path('testing.sqlite'),
'timezone' => '+00:00', 'timezone' => '+00:00',
'prefix' => '', 'prefix' => '',
], ],
@@ -50,11 +50,19 @@ return [
'redis' => [ 'redis' => [
'cluster' => false, 'cluster' => false,
'client' => 'phpredis',
'default' => [ 'default' => [
'host' => env('REDIS_HOST', 'localhost'), 'host' => env('REDIS_HOST', 'localhost'),
'password' => env('REDIS_PASSWORD', null), 'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379), 'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DATABASE', 1), 'database' => env('REDIS_DATABASE', 1),
], ],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
], ],
]; ];

110
config/ignition.php Normal file
View File

@@ -0,0 +1,110 @@
<?php
return [
/*
|--------------------------------------------------------------------------
| Editor
|--------------------------------------------------------------------------
|
| Choose your preferred editor to use when clicking any edit button.
|
| Supported: "phpstorm", "vscode", "vscode-insiders",
| "sublime", "atom"
|
*/
'editor' => env('IGNITION_EDITOR', 'phpstorm'),
/*
|--------------------------------------------------------------------------
| Theme
|--------------------------------------------------------------------------
|
| Here you may specify which theme Ignition should use.
|
| Supported: "light", "dark", "auto"
|
*/
'theme' => env('IGNITION_THEME', 'light'),
/*
|--------------------------------------------------------------------------
| Sharing
|--------------------------------------------------------------------------
|
| You can share local errors with colleagues or others around the world.
| Sharing is completely free and doesn't require an account on Flare.
|
| If necessary, you can completely disable sharing below.
|
*/
'enable_share_button' => env('IGNITION_SHARING_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Ignored Solution Providers
|--------------------------------------------------------------------------
|
| You may specify a list of solution providers (as fully qualified class
| names) that shouldn't be loaded. Ignition will ignore these classes
| and possible solutions provided by them will never be displayed.
|
*/
'ignored_solution_providers' => [
//
],
/*
|--------------------------------------------------------------------------
| Runnable Solutions
|--------------------------------------------------------------------------
|
| Some solutions that Ignition displays are runnable and can perform
| various tasks. Runnable solutions are enabled when your app has
| debug mode enabled. You may also fully disable this feature.
|
*/
'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS', null),
/*
|--------------------------------------------------------------------------
| Remote Path Mapping
|--------------------------------------------------------------------------
|
| If you are using a remote dev server, like Laravel Homestead, Docker, or
| even a remote VPS, it will be necessary to specify your path mapping.
|
| Leaving one, or both of these, empty or null will not trigger the remote
| URL changes and Ignition will treat your editor links as local files.
|
| "remote_sites_path" is an absolute base path for your sites or projects
| in Homestead, Vagrant, Docker, or another remote development server.
|
| Example value: "/home/vagrant/Code"
|
| "local_sites_path" is an absolute base path for your sites or projects
| on your local computer where your IDE or code editor is running on.
|
| Example values: "/Users/<name>/Code", "C:\Users\<name>\Documents\Code"
|
*/
'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', ''),
'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''),
/*
|--------------------------------------------------------------------------
| Housekeeping Endpoint Prefix
|--------------------------------------------------------------------------
|
| Ignition registers a couple of routes when it is enabled. Below you may
| specify a route prefix that will be used to host all internal links.
|
*/
'housekeeping_endpoint_prefix' => '_ignition',
];

View File

@@ -14,6 +14,9 @@
<directory suffix="Test.php">./tests</directory> <directory suffix="Test.php">./tests</directory>
</testsuite> </testsuite>
</testsuites> </testsuites>
<extensions>
<extension class="Tests\Bootstrap"/>
</extensions>
<listeners> <listeners>
<listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/> <listener class="NunoMaduro\Collision\Adapters\Phpunit\Listener"/>
</listeners> </listeners>
@@ -23,16 +26,21 @@
</whitelist> </whitelist>
</filter> </filter>
<php> <php>
<env name="APP_ENV" value="unittest"/>
<env name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
<env name="APP_DEBUG" value="true"/>
<env name="APP_LOG_LEVEL" value="error"/>
<env name="DB_CONNECTION" value="memory"/>
<env name="CACHE_DRIVER" value="array"/>
<env name="SESSION_DRIVER" value="array"/>
<env name="QUEUE_DRIVER" value="sync"/>
<ini name="error_reporting" value="E_ALL" /> <ini name="error_reporting" value="E_ALL" />
<ini name="display_errors" value="On" /> <ini name="display_errors" value="On" />
<ini name="display_startup_errors" value="On" /> <ini name="display_startup_errors" value="On" />
<server name="APP_ENV" value="testing"/>
<server name="APP_KEY" value="base64:ve66Z5Kt/zTN3p++0zOPu854PHfZkwJE5VuoFAlzHtI="/>
<server name="APP_DEBUG" value="true"/>
<server name="APP_LOG_LEVEL" value="error"/>
<server name="DB_CONNECTION" value="memory"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="QUEUE_DRIVER" value="sync"/>
<server name="APP_CONFIG_CACHE" value="bootstrap/cache/config.phpunit.php"/>
<server name="APP_SERVICES_CACHE" value="bootstrap/cache/services.phpunit.php"/>
<server name="APP_PACKAGES_CACHE" value="bootstrap/cache/packages.phpunit.php"/>
<server name="APP_ROUTES_CACHE" value="bootstrap/cache/routes.phpunit.php"/>
<server name="APP_EVENTS_CACHE" value="bootstrap/cache/events.phpunit.php"/>
</php> </php>
</phpunit> </phpunit>

View File

@@ -86,6 +86,7 @@ return [
// Overrides config/logging.php // Overrides config/logging.php
'logging' => [ 'logging' => [
'default' => 'stack',
'channels' => [ 'channels' => [
'single' => ['level' => 'debug'], 'single' => ['level' => 'debug'],
'daily' => ['level' => 'debug'], 'daily' => ['level' => 'debug'],

View File

@@ -16,7 +16,7 @@
<link rel="shortcut icon" type="image/png" href="{{ public_asset('/assets/img/favicon.png') }}"/> <link rel="shortcut icon" type="image/png" href="{{ public_asset('/assets/img/favicon.png') }}"/>
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet"/> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet"/>
<link href="{{ public_asset('/assets/frontend/css/bootstrap.min.css') }}" rel="stylesheet"/> <link href="{{ public_asset('/assets/frontend/css/bootstrap.min.css') }}" rel="stylesheet"/>
<link href="{{ public_asset('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/> <link href="{{ public_mix('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/>
<link href="{{ public_asset('/assets/frontend/css/styles.css') }}" rel="stylesheet"/> <link href="{{ public_asset('/assets/frontend/css/styles.css') }}" rel="stylesheet"/>
{{-- Start of the required files in the head block --}} {{-- Start of the required files in the head block --}}

View File

@@ -11,7 +11,9 @@
<meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' /> <meta content='width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0, shrink-to-fit=no' name='viewport' />
<link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" /> <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700,200" rel="stylesheet" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" /> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/latest/css/font-awesome.min.css" />
<link href="{{ public_mix('/assets/frontend/css/vendor.min.css') }}" rel="stylesheet" /> <link href="{{ public_asset('/assets/frontend/css/bootstrap.min.css') }}" rel="stylesheet"/>
<link href="{{ public_mix('/assets/frontend/css/now-ui-kit.css') }}" rel="stylesheet"/>
<link href="{{ public_asset('/assets/frontend/css/styles.css') }}" rel="stylesheet"/>
@yield('css') @yield('css')
</head> </head>

View File

@@ -2,80 +2,73 @@
@section('title', __('common.login')) @section('title', __('common.login'))
@section('content') @section('content')
<div class="navbar-translate"> <div class="col-md-4 ml-auto mr-auto content-center">
<a class="navbar-brand" href="https://demos.creative-tim.com/now-ui-kit/index.html" rel="tooltip"
title="Designed by Invision. Coded by Creative Tim" data-placement="bottom" target="_blank">
Now Ui Kit
</a>
<button class="navbar-toggler navbar-toggler" type="button" data-toggle="collapse" data-target="#navigation"
aria-controls="navigation-index" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-bar top-bar"></span>
<span class="navbar-toggler-bar middle-bar"></span>
<span class="navbar-toggler-bar bottom-bar"></span>
</button>
</div>
<div class="col-md-4 ml-auto mr-auto content-center">
<div class="card card-login card-plain"> <div class="card card-login card-plain">
{{ Form::open(['url' => url('/login'), 'method' => 'post']) }} {{ Form::open(['url' => url('/login'), 'method' => 'post']) }}
<div class="header header-primary text-center"> <div class="header header-primary text-center">
<div class="logo-container" style="width: 320px;"> <div class="logo-container" style="width: 320px;">
<img src="{{ public_asset('/assets/frontend/img/logo.svg') }}" width="320" height="320" style="background: #FFF"> <img src="{{ public_asset('/assets/frontend/img/logo.svg') }}" width="320" height="320"
</div> style="background: #FFF">
</div> </div>
<div class="content"> </div>
<div class="input-group form-group-no-border{{ $errors->has('email') ? ' has-error' : '' }} input-lg"> <div class="card-body">
<span class="input-group-addon"> <div class="input-group form-group-no-border{{ $errors->has('email') ? ' has-error' : '' }} input-lg">
<i class="now-ui-icons users_circle-08"></i> <div class="input-group-prepend">
</span> <span class="input-group-text">
{{ <i class="now-ui-icons users_circle-08"></i>
Form::text('email', old('email'), [ </span>
'id' => 'email', </div>
'placeholder' => __('common.email'), {{
'class' => 'form-control', Form::text('email', old('email'), [
'required' => true, 'id' => 'email',
]) 'placeholder' => __('common.email'),
}} 'class' => 'form-control',
</div> 'required' => true,
@if ($errors->has('email')) ])
<span class="help-block"> }}
<strong>{{ $errors->first('email') }}</strong> </div>
</span> @if ($errors->has('email'))
@endif <span class="help-block">
<strong>{{ $errors->first('email') }}</strong>
</span>
@endif
<div class="input-group form-group-no-border{{ $errors->has('password') ? ' has-error' : '' }} input-lg"> <div class="input-group form-group-no-border{{ $errors->has('password') ? ' has-error' : '' }} input-lg">
<span class="input-group-addon"> <div class="input-group-prepend">
<i class="now-ui-icons ui-1_lock-circle-open"></i> <span class="input-group-text">
</span> <i class="now-ui-icons text_caps-small"></i>
{{ </span>
Form::password('password', [ </div>
'name' => 'password', {{
'class' => 'form-control', Form::password('password', [
'placeholder' => __('auth.password'), 'name' => 'password',
'required' => true, 'class' => 'form-control',
]) 'placeholder' => __('auth.password'),
}} 'required' => true,
</div> ])
@if ($errors->has('password')) }}
<span class="help-block"> </div>
<strong>{{ $errors->first('password') }}</strong> @if ($errors->has('password'))
</span> <span class="help-block">
@endif <strong>{{ $errors->first('password') }}</strong>
</span>
@endif
</div> </div>
<div class="footer text-center"> <div class="footer text-center">
<button class="btn btn-primary btn-round btn-lg btn-block">@lang('common.login')</button> <button class="btn btn-primary btn-round btn-lg btn-block">@lang('common.login')</button>
</div> </div>
<div class="pull-left"> <div class="pull-left">
<h6> <h6>
<a href="{{ url('/register') }}" class="link">@lang('auth.createaccount')</a> <a href="{{ url('/register') }}" class="link">@lang('auth.createaccount')</a>
</h6> </h6>
</div> </div>
<div class="pull-right"> <div class="pull-right">
<h6> <h6>
<a href="{{ url('/password/reset') }}" class="link">@lang('auth.forgotpassword')?</a> <a href="{{ url('/password/reset') }}" class="link">@lang('auth.forgotpassword')?</a>
</h6> </h6>
</div> </div>
{{ Form::close() }} {{ Form::close() }}
</div> </div>
</div> </div>
@endsection @endsection

View File

@@ -15,8 +15,14 @@
@endif @endif
{{ __('Before proceeding, please check your email for a verification link.') }} {{ __('Before proceeding, please check your email for a verification link.') }}
{{ __('If you did not receive the email') }}, <a {{ __('If you did not receive the email') }},
href="{{ route('verification.resend') }}">{{ __('click here to request another') }}</a>.
<form class="d-inline" method="POST" action="{{ route('verification.resend') }}">
@csrf
<button type="submit" class="btn btn-link p-0 m-0 align-baseline">
{{ __('click here to request another') }}
</button>.
</form>
</div> </div>
</div> </div>
</div> </div>

39
tests/Bootstrap.php Normal file
View File

@@ -0,0 +1,39 @@
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
use PHPUnit\Runner\AfterLastTestHook;
use PHPUnit\Runner\BeforeFirstTestHook;
class Bootstrap implements BeforeFirstTestHook, AfterLastTestHook
{
/*
|--------------------------------------------------------------------------
| Bootstrap The Test Environment
|--------------------------------------------------------------------------
|
| You may specify console commands that execute once before your test is
| run. You are free to add your own additional commands or logic into
| this file as needed in order to help your test suite run quicker.
|
*/
use CreatesApplication;
public function executeBeforeFirstTest(): void
{
$console = $this->createApplication()->make(Kernel::class);
$commands = [
'config:cache',
'event:cache',
];
foreach ($commands as $command) {
$console->call($command);
}
}
public function executeAfterLastTest(): void
{
array_map('unlink', glob('bootstrap/cache/*.phpunit.php'));
}
}

View File

@@ -0,0 +1,21 @@
<?php
namespace Tests;
use Illuminate\Contracts\Console\Kernel;
trait CreatesApplication
{
/**
* Creates the application.
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Kernel::class)->bootstrap();
return $app;
}
}

View File

@@ -7,14 +7,15 @@ use GuzzleHttp\Handler\MockHandler;
use GuzzleHttp\HandlerStack; use GuzzleHttp\HandlerStack;
use GuzzleHttp\Psr7\Response; use GuzzleHttp\Psr7\Response;
use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Routing\Middleware\ThrottleRequests;
use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Mail;
use Tests\CreatesApplication;
use Tests\TestData; use Tests\TestData;
/**
* Class TestCase
*/
class TestCase extends Illuminate\Foundation\Testing\TestCase class TestCase extends Illuminate\Foundation\Testing\TestCase
{ {
use TestData; use TestData;
use CreatesApplication;
/** /**
* The base URL to use while testing the application. * The base URL to use while testing the application.
@@ -45,8 +46,10 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
ThrottleRequests::class ThrottleRequests::class
); );
Mail::fake();
Artisan::call('database:create', ['--reset' => true]); Artisan::call('database:create', ['--reset' => true]);
Artisan::call('migrate:refresh', ['--env' => 'unittest']); Artisan::call('migrate:refresh', ['--env' => 'testing']);
} }
public function tearDown() : void public function tearDown() : void
@@ -54,18 +57,6 @@ class TestCase extends Illuminate\Foundation\Testing\TestCase
parent::tearDown(); parent::tearDown();
} }
/**
* Creates the application. Required to be implemented
*
* @return \Illuminate\Foundation\Application
*/
public function createApplication()
{
$app = require __DIR__.'/../bootstrap/app.php';
$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
return $app;
}
/** /**
* @param $user * @param $user
* @param array $headers * @param array $headers