diff --git a/app/Http/Controllers/Hauling/Hauling.php b/app/Http/Controllers/Hauling/Hauling.php index 2ac803a..3f3601b 100644 --- a/app/Http/Controllers/Hauling/Hauling.php +++ b/app/Http/Controllers/Hauling/Hauling.php @@ -32,13 +32,33 @@ class Hauling extends Controller $this->validate($request, [ 'name1' => 'required', 'name2' => 'required', + 'collateral' => 'required', + 'size' => 'required', ]); + $size = $request->size; + $collateral = $request->collateral; + $time = '1 week'; + $duration = '3 days'; + $hHelper = new HaulingHelper; $jumps = $hHelper->JumpsBetweenSystems($request->name1, $request->name2); - return view('hauling.display.results')->with('jumps', $jumps); + if($size > 0 && $size <= 57500) { + $cost = $jumps * 750000; + } else if($size > 57500 && $size < 800000) { + $cost = $jumps * 1000000; + } else { + $cost = -1; + } + + return view('hauling.display.results')->with('jumps', $jumps) + ->with('cost', $cost) + ->with('collateral', $collateral) + ->with('size', $size) + ->with('time', $time) + ->with('duration', $duration); } /** diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index ee8ca5b..c013f68 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -13,7 +13,7 @@ class AppServiceProvider extends ServiceProvider */ public function register() { - // + Schema::defaultStringLength(191); } /** diff --git a/app/Providers/RouteServiceProvider.php b/app/Providers/RouteServiceProvider.php index 548e4be..682581d 100644 --- a/app/Providers/RouteServiceProvider.php +++ b/app/Providers/RouteServiceProvider.php @@ -35,11 +35,9 @@ class RouteServiceProvider extends ServiceProvider */ public function map() { - $this->mapApiRoutes(); + //$this->mapApiRoutes(); $this->mapWebRoutes(); - - // } /** diff --git a/config/auth.php b/config/auth.php index 897dc82..ef343f0 100644 --- a/config/auth.php +++ b/config/auth.php @@ -68,7 +68,7 @@ return [ 'providers' => [ 'users' => [ 'driver' => 'eloquent', - 'model' => App\User::class, + 'model' => App\Models\User\User::class, ], // 'users' => [ diff --git a/resources/views/dashboard/dashboard.blade.php b/resources/views/dashboard/dashboard.blade.php new file mode 100644 index 0000000..2992b2b --- /dev/null +++ b/resources/views/dashboard/dashboard.blade.php @@ -0,0 +1,50 @@ +middleware('auth'); + $this->middleware('role:Guest'); + } + + /** + * Create dashboard where user logs in + * + * @return void + */ + public function index() { + return view('dashboard.dashboard'); + } + + /** + * Create profile for user + * + * @return void + */ + public function profile() { + return view('dashboard.profile'); + } + +} + +?> diff --git a/resources/views/dashboard/profile.blade.php b/resources/views/dashboard/profile.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/error/401.blade.php b/resources/views/error/401.blade.php new file mode 100644 index 0000000..f94f82f --- /dev/null +++ b/resources/views/error/401.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '401') +@section('title', __('Unauthorized')) + +@section('image') +
+
+@endsection + +@section('message', __('Sorry, you are not authorized to access this page.')) \ No newline at end of file diff --git a/resources/views/error/403.blade.php b/resources/views/error/403.blade.php new file mode 100644 index 0000000..00ad810 --- /dev/null +++ b/resources/views/error/403.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '403') +@section('title', __('Forbidden')) + +@section('image') +
+
+@endsection + +@section('message', __($exception->getMessage() ?: __('Sorry, you are forbidden from accessing this page.'))) \ No newline at end of file diff --git a/resources/views/error/404.blade.php b/resources/views/error/404.blade.php new file mode 100644 index 0000000..33e8fb2 --- /dev/null +++ b/resources/views/error/404.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '404') +@section('title', __('Page Not Found')) + +@section('image') +
+
+@endsection + +@section('message', __('Sorry, the page you are looking for could not be found.')) \ No newline at end of file diff --git a/resources/views/error/419.blade.php b/resources/views/error/419.blade.php new file mode 100644 index 0000000..40410b4 --- /dev/null +++ b/resources/views/error/419.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '419') +@section('title', __('Page Expired')) + +@section('image') +
+
+@endsection + +@section('message', __('Sorry, your session has expired. Please refresh and try again.')) \ No newline at end of file diff --git a/resources/views/error/429.blade.php b/resources/views/error/429.blade.php new file mode 100644 index 0000000..8861baa --- /dev/null +++ b/resources/views/error/429.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '429') +@section('title', __('Too Many Requests')) + +@section('image') +
+
+@endsection + +@section('message', __('Sorry, you are making too many requests to our servers.')) \ No newline at end of file diff --git a/resources/views/error/500.blade.php b/resources/views/error/500.blade.php new file mode 100644 index 0000000..6c617a5 --- /dev/null +++ b/resources/views/error/500.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '500') +@section('title', __('Error')) + +@section('image') +
+
+@endsection + +@section('message', __('Whoops, something went wrong on our servers.')) \ No newline at end of file diff --git a/resources/views/error/503.blade.php b/resources/views/error/503.blade.php new file mode 100644 index 0000000..11a5f33 --- /dev/null +++ b/resources/views/error/503.blade.php @@ -0,0 +1,11 @@ +@extends('errors::illustrated-layout') + +@section('code', '503') +@section('title', __('Service Unavailable')) + +@section('image') +
+
+@endsection + +@section('message', __($exception->getMessage() ?: __('Sorry, we are doing some maintenance. Please check back soon.'))) \ No newline at end of file diff --git a/resources/views/error/illustrated-layout.blade.php b/resources/views/error/illustrated-layout.blade.php new file mode 100644 index 0000000..f9f8c59 --- /dev/null +++ b/resources/views/error/illustrated-layout.blade.php @@ -0,0 +1,395 @@ + + + + @yield('title') + + + + + + + + + + + + +
+
+
+
+ @yield('code', __('Oh no')) +
+ +
+ +

+ @yield('message') +

+ + + + +
+
+ +
+ @yield('image') +
+
+ + \ No newline at end of file diff --git a/resources/views/error/layout.blade.php b/resources/views/error/layout.blade.php new file mode 100644 index 0000000..68e9edb --- /dev/null +++ b/resources/views/error/layout.blade.php @@ -0,0 +1,52 @@ + + + + + + + @yield('title') + + + + + + + + + +
+
+
+ @yield('message') +
+
+
+ + \ No newline at end of file diff --git a/resources/views/inc/error.blade.php b/resources/views/inc/error.blade.php new file mode 100644 index 0000000..8a1b67e --- /dev/null +++ b/resources/views/inc/error.blade.php @@ -0,0 +1,16 @@ +@extends('layouts.b4') +@section('content') +
+
+ Error +
+
+ @foreach($errors as $error) + + @endforeach +
+
+@endsection \ No newline at end of file diff --git a/resources/views/inc/messages.blade.php b/resources/views/inc/messages.blade.php new file mode 100644 index 0000000..937272f --- /dev/null +++ b/resources/views/inc/messages.blade.php @@ -0,0 +1,19 @@ +@if(count($errors) > 0) + @foreach($errors->all() as $error) +
+ {{$error}} +
+ @endforeach +@endif + +@if(session('success')) +
+ {{session('success')}} +
+@endif + +@if(session('error')) +
+ {{session('error')}} +
+@endif \ No newline at end of file diff --git a/resources/views/welcome.blade.php b/resources/views/welcome.blade.php deleted file mode 100644 index 3fb48cc..0000000 --- a/resources/views/welcome.blade.php +++ /dev/null @@ -1,100 +0,0 @@ - - - - - - - Laravel - - - - - - - - -
- @if (Route::has('login')) - - @endif - -
-
- Laravel -
- - -
-
- - diff --git a/routes/web.php b/routes/web.php index 810aa34..b07a18d 100644 --- a/routes/web.php +++ b/routes/web.php @@ -12,5 +12,31 @@ */ Route::get('/', function () { - return view('welcome'); + if(Auth::check()) { + return redirect('/dashboard'); + } + return redirect('/display'); +})->name('/'); + +Route::group(['middleware' => ['auth']], function(){ + /** + * Dashboard Controller Display pages + */ + Route::get('/dashboard', 'Dashboard\DashboardController@index'); + Route::get('/profile', 'Dashboard\DashboardController@profile'); + }); + +/** + * Login Display pages + */ +Route::get('/login', 'Auth\LoginController@redirectToProvider')->name('login'); +Route::get('/callback', 'Auth\LoginController@handleProviderCallback')->name('callback'); +Route::get('/logout', 'Auth\LoginController@logout')->name('logout'); + +/** + * Unsecure Display pages + */ +Route::get('/display', 'Hauling\HaulingController@displayForm')->name('display'); +Route::post('/display', 'Hauling\HaulingController@displayFormResults'); +Route::get('/display/quotes', 'Hauling\HaulingController@displayQuotes')->name('quotes');