Skip to content

Commit

Permalink
Migration to latest Laravel LTS 6.x
Browse files Browse the repository at this point in the history
  • Loading branch information
taviroquai committed Nov 4, 2019
1 parent a164bb4 commit b0dc326
Show file tree
Hide file tree
Showing 172 changed files with 4,211 additions and 26,597 deletions.
41 changes: 32 additions & 9 deletions .env.example
@@ -1,21 +1,44 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_KEY=Gdyiljd9xE67xyrMv1ojNKVajgT7oVJC
APP_URL=http://localhost

DB_CONNECTION=pgsql
DB_HOST=localhost
DB_DATABASE=mapigniter2
DB_USERNAME=mapigniter2
DB_PASSWORD=postgres
DB_PORT=5432
LOG_CHANNEL=stack

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=laravel
DB_USERNAME=root
DB_PASSWORD=

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
QUEUE_DRIVER=sync
SESSION_LIFETIME=120

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_DRIVER=smtp
MAIL_HOST=mailtrap.io
MAIL_HOST=smtp.mailtrap.io
MAIL_PORT=2525
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
16 changes: 16 additions & 0 deletions .styleci.yml
@@ -0,0 +1,16 @@
php:
preset: laravel
enabled:
- alpha_ordered_imports
disabled:
- length_ordered_imports
- unused_use
finder:
not-name:
- index.php
- server.php
js:
finder:
not-name:
- webpack.mix.js
css: true
6 changes: 0 additions & 6 deletions CHANGELOG.md

This file was deleted.

22 changes: 0 additions & 22 deletions LICENSE

This file was deleted.

33 changes: 0 additions & 33 deletions app/Console/Commands/Inspire.php

This file was deleted.

18 changes: 15 additions & 3 deletions app/Console/Kernel.php
Expand Up @@ -13,7 +13,7 @@ class Kernel extends ConsoleKernel
* @var array
*/
protected $commands = [
\App\Console\Commands\Inspire::class,
//
];

/**
Expand All @@ -24,7 +24,19 @@ class Kernel extends ConsoleKernel
*/
protected function schedule(Schedule $schedule)
{
$schedule->command('inspire')
->hourly();
// $schedule->command('inspire')
// ->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');

require base_path('routes/console.php');
}
}
8 changes: 0 additions & 8 deletions app/Events/Event.php

This file was deleted.

34 changes: 18 additions & 16 deletions app/Exceptions/Handler.php
Expand Up @@ -3,47 +3,49 @@
namespace App\Exceptions;

use Exception;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;

class Handler extends ExceptionHandler
{
/**
* A list of the exception types that should not be reported.
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
HttpException::class,
//
];

/**
* Report or log an exception.
* A list of the inputs that are never flashed for validation exceptions.
*
* This is a great spot to send exceptions to Sentry, Bugsnag, etc.
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];

/**
* Report or log an exception.
*
* @param \Exception $e
* @param \Exception $exception
* @return void
*/
public function report(Exception $e)
public function report(Exception $exception)
{
return parent::report($e);
parent::report($exception);
}

/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Exception $e
* @param \Exception $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Exception $e)
public function render($request, Exception $exception)
{
if($e instanceof NotFoundHttpException)
{
return response()->view('pages/demo_notfound', [], 404);
}
return parent::render($request, $e);
return parent::render($request, $exception);
}
}
5 changes: 3 additions & 2 deletions app/Http/Controllers/Admin/BrandController.php
Expand Up @@ -34,6 +34,7 @@ public function save()
{
$input = \Input::except('_token');
$input['active'] = empty($input['active']) ? 0 : 1;
$input['css'] = empty($input['css']) ? '' : $input['css'];

// Validate
$validator = \Validator::make($input, [
Expand Down Expand Up @@ -64,9 +65,9 @@ public function save()
}

// At least 1 brand must be active
if (\DB::table('brands')->where('active', 1)->count() == 0) {
if (\DB::table('brands')->where('active', true)->count() == 0) {
$first = \DB::table('brands')->first();
\DB::table('brands')->where('id', $first->id)->update(['active' => 1]);
\DB::table('brands')->where('id', $first->id)->update(['active' => true]);
}

try {
Expand Down
3 changes: 2 additions & 1 deletion app/Http/Controllers/Admin/LayerController.php
@@ -1,5 +1,6 @@
<?php namespace App\Http\Controllers\Admin;

use Illuminate\Support\Str;
use App\Content;
use App\Layer;
use App\GeoPackage;
Expand Down Expand Up @@ -61,7 +62,7 @@ public function save()
if (empty($input['id'])) {

// Pre validate
$input['seo_slug'] = empty($input['seo_slug']) ? str_slug($input['title']) : $input['seo_slug'];
$input['seo_slug'] = empty($input['seo_slug']) ? Str::slug($input['title']) : $input['seo_slug'];

// Validate required params
$rules = [
Expand Down
1 change: 1 addition & 0 deletions app/Http/Controllers/Admin/PageController.php
Expand Up @@ -37,6 +37,7 @@ public function save()
{
$input = \Input::except('_token');
$input['name'] = strtolower($input['name']);
$input['css'] = empty($input['css']) ? '' : $input['css'];

$validator = \Validator::make($input, [
'name' => 'required|alpha_dash|max:255|unique:pages'.(!empty($input['id']) ? ',name,'.$input['id'] : ''),
Expand Down
39 changes: 39 additions & 0 deletions app/Http/Controllers/Auth/ConfirmPasswordController.php
@@ -0,0 +1,39 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ConfirmsPasswords;

class ConfirmPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Confirm Password Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password confirmations and
| uses a simple trait to include the behavior. You're free to explore
| this trait and override any functions that require customization.
|
*/

use ConfirmsPasswords;

/**
* Where to redirect users when the intended url fails.
*
* @var string
*/
protected $redirectTo = '/home';

/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
}
}
35 changes: 35 additions & 0 deletions app/Http/Controllers/Auth/ForgotPasswordController.php
@@ -0,0 +1,35 @@
<?php

namespace App\Http\Controllers\Auth;

use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;

class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/

use SendsPasswordResetEmails;

/**
* Create a new password controller instance.
*
* @return void
*/
public function __construct()
{
// Load idiom
Idiom::loadIdiom();

$this->middleware('guest');
}
}

0 comments on commit b0dc326

Please sign in to comment.