Skip to content

Commit

Permalink
Upgrade to Laravel 5.5
Browse files Browse the repository at this point in the history
This is a retrofit of the 5.1-based application on top of a clean
Laravel installation. The application structure is more-or-less the
same, but uses more current Laravel norms. The use of Vue has also
been refined by refactoring to single-file components and putting more
display logic on the client-side where it can be done less verbosely
than it was before. The UI has also been reworked around Bootstrap tab
navigation.
  • Loading branch information
lovett committed Jan 20, 2018
1 parent ed7b6d9 commit 0c59a5a
Show file tree
Hide file tree
Showing 180 changed files with 87,727 additions and 14,463 deletions.
22 changes: 19 additions & 3 deletions .env.example
@@ -1,19 +1,35 @@
APP_NAME=Laravel
APP_ENV=local APP_ENV=local
APP_KEY=
APP_DEBUG=true APP_DEBUG=true
APP_KEY=SomeRandomString APP_LOG_LEVEL=debug
APP_URL=http://localhost


DB_HOST=localhost DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead DB_DATABASE=homestead
DB_USERNAME=homestead DB_USERNAME=homestead
DB_PASSWORD=secret DB_PASSWORD=secret


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


REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

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

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
14 changes: 0 additions & 14 deletions .eslintrc.js

This file was deleted.

4 changes: 3 additions & 1 deletion .gitattributes
@@ -1,3 +1,5 @@
* text=auto * text=auto
*.css linguist-vendored *.css linguist-vendored
*.less linguist-vendored *.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
21 changes: 15 additions & 6 deletions .gitignore
@@ -1,9 +1,18 @@
.DS_Store .DS_Store
vendor ._*
node_modules .\#*
\#*
TAGS
/node_modules
/public/hot
/public/storage
/storage/*.key
/vendor
/.idea
/.vagrant
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.env .env
*.sqlite *.sqlite
public/css
storage/debugbar
reports
.php_cs.cache
75 changes: 0 additions & 75 deletions .php_cs

This file was deleted.

7 changes: 7 additions & 0 deletions Makefile
@@ -0,0 +1,7 @@
.PHONY: dummy

fakeseed: dummy
rm toils.sqlite
touch toils.sqlite
php artisan migrate
php artisan db:seed --class=FakeSeeder
31 changes: 11 additions & 20 deletions app/Client.php
Expand Up @@ -79,8 +79,7 @@ public static function listing(Builder $builder)
'clients.*, 'clients.*,
count(distinct projects.id) as projectCount, count(distinct projects.id) as projectCount,
coalesce(sum(times.minutes), 0) as totalTime, coalesce(sum(times.minutes), 0) as totalTime,
max(times.start) as latestTime, max(times.start) as latestTime'
min(times.start) as earliestTime'
); );


$builder = $builder->leftJoin( $builder = $builder->leftJoin(
Expand Down Expand Up @@ -143,26 +142,18 @@ public function projects()
*/ */
public function invoices() public function invoices()
{ {
$query = Invoice::leftJoin( return $this->hasManyThrough('App\Invoice', 'App\Project');
'projects',
'invoices.project_id',
'=',
'projects.id'
);

$query->select('invoices.*');

$query->join(
'clients',
'projects.client_id',
'=',
'clients.id'
);

$query->where('clients.id', $this->getKey());
return $query;
} }


/**
* Time entries associated with the client.
*
* @return Builder
*/
public function time()
{
return $this->hasManyThrough('App\Time', 'App\Project');
}


/** /**
* Human readable string for the value of the active flag. * Human readable string for the value of the active flag.
Expand Down
36 changes: 0 additions & 36 deletions app/Console/Commands/Inspire.php

This file was deleted.

24 changes: 17 additions & 7 deletions app/Console/Kernel.php
Expand Up @@ -5,9 +5,6 @@
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel; use Illuminate\Foundation\Console\Kernel as ConsoleKernel;


/**
* Standard Laravel Kernel class.
*/
class Kernel extends ConsoleKernel class Kernel extends ConsoleKernel
{ {
/** /**
Expand All @@ -16,17 +13,30 @@ class Kernel extends ConsoleKernel
* @var array * @var array
*/ */
protected $commands = [ protected $commands = [
\App\Console\Commands\Inspire::class, //
]; ];


/** /**
* Define the application's command schedule. * Define the application's command schedule.
* *
* @param Schedule $schedule The schedule instance * @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/ */
protected function schedule(Schedule $schedule) protected function schedule(Schedule $schedule)
{ {
$schedule->command('inspire') // $schedule->command('inspire')
->hourly(); // ->hourly();
}

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

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

This file was deleted.

47 changes: 21 additions & 26 deletions app/Exceptions/Handler.php
Expand Up @@ -3,56 +3,51 @@
namespace App\Exceptions; namespace App\Exceptions;


use Exception; use Exception;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Illuminate\Database\Eloquent\ModelNotFoundException;
use Symfony\Component\HttpKernel\Exception\HttpException;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler; use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;


/**
* Standard Laravel exception handler class.
*/
class Handler extends ExceptionHandler 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 * @var array
*/ */
protected $dontReport = [ protected $dontReport = [
HttpException::class, //
ModelNotFoundException::class, ];

/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
]; ];


/** /**
* Report or log an exception. * Report or log an exception.
* *
* 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 $e The exception instance * @param \Exception $exception
* * @return void
* @return Response
*/ */
public function report(Exception $e) public function report(Exception $exception)
{ {
return parent::report($e); parent::report($exception);
} }


/** /**
* Render an exception into an HTTP response. * Render an exception into an HTTP response.
* *
* @param Request $request The incoming request * @param \Illuminate\Http\Request $request
* @param Exception $e The exception * @param \Exception $exception
* * @return \Illuminate\Http\Response
* @return Response
*/ */
public function render($request, Exception $e) public function render($request, Exception $exception)
{ {
if ($e instanceof ModelNotFoundException) { return parent::render($request, $exception);
$e = new NotFoundHttpException($e->getMessage(), $e);
}

return parent::render($request, $e);
} }
} }
2 changes: 1 addition & 1 deletion app/Helpers/AddressHelper.php
Expand Up @@ -63,7 +63,7 @@ public static function phoneUrl($value)
$plainValue = preg_replace('/[^0-9x\#*]/', null, $value); $plainValue = preg_replace('/[^0-9x\#*]/', null, $value);


try { try {
$formattedValue = phone_format($plainValue, 'US'); $formattedValue = phone($plainValue, 'US')->formatInternational();
} catch (Exception $e) { } catch (Exception $e) {
$formattedValue = $plainValue; $formattedValue = $plainValue;
} }
Expand Down

0 comments on commit 0c59a5a

Please sign in to comment.