diff --git a/app/Http/Controllers/Dashboard/DashboardController.php b/app/Http/Controllers/Dashboard/DashboardController.php new file mode 100644 index 0000000..5ff2766 --- /dev/null +++ b/app/Http/Controllers/Dashboard/DashboardController.php @@ -0,0 +1,20 @@ +middleware('role:Uesr'); + } + + public function index() { + return redirect('/'); + } + + public function profile() { + return redirect('/'); + } +} diff --git a/app/Http/Controllers/Hauling/HaulingController.php b/app/Http/Controllers/Hauling/HaulingController.php index 68d9bca..e0d2916 100644 --- a/app/Http/Controllers/Hauling/HaulingController.php +++ b/app/Http/Controllers/Hauling/HaulingController.php @@ -15,8 +15,7 @@ use App\Library\Hauling\HaulingHelper; class HaulingController extends Controller { public function __construct() { - $this->middleware('auth'); - $this->middleware('role:Guest'); + // } /** diff --git a/app/Http/Middleware/Authenticate.php b/app/Http/Middleware/Authenticate.php index a4be5c5..e550d9c 100644 --- a/app/Http/Middleware/Authenticate.php +++ b/app/Http/Middleware/Authenticate.php @@ -14,8 +14,10 @@ class Authenticate extends Middleware */ protected function redirectTo($request) { - if (! $request->expectsJson()) { - return route('login'); + if($this->auth->check()) { + return route('/'); + } else { + return route('/'); } } } diff --git a/app/Http/Middleware/RedirectIfAuthenticated.php b/app/Http/Middleware/RedirectIfAuthenticated.php index e4cec9c..89cb8ca 100644 --- a/app/Http/Middleware/RedirectIfAuthenticated.php +++ b/app/Http/Middleware/RedirectIfAuthenticated.php @@ -4,9 +4,18 @@ namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; +use Socialite; +use DB; + +use App\Models\User\User; +use Seat\Eseye\Cache\NullCache; +use Seat\Eseye\Configuration; +use Seat\Eseye\Containers\EsiAuthentication; +use Seat\Eseye\Eseye; class RedirectIfAuthenticated { + /** * Handle an incoming request. * @@ -18,9 +27,8 @@ class RedirectIfAuthenticated public function handle($request, Closure $next, $guard = null) { if (Auth::guard($guard)->check()) { - return redirect('/home'); + return redirect()->to('/dashboard'); } - return $next($request); } -} +} \ No newline at end of file diff --git a/composer.json b/composer.json index 29d4a42..952bae5 100644 --- a/composer.json +++ b/composer.json @@ -14,6 +14,7 @@ "laravel/framework": "^6.0", "laravel/socialite": "^4.2", "laravel/tinker": "^1.0", + "laravelcollective/html": "^6.0", "twbs/bootstrap": "^4.3" }, "require-dev": { diff --git a/composer.lock b/composer.lock index ce0c50f..ec102db 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,11 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], +<<<<<<< HEAD "content-hash": "f7d6457916d37f9d2351ce632fc5dd35", +======= + "content-hash": "5fb9de1acc8a170ba905235ac9fda870", +>>>>>>> c55f404a504fc5daf976929df5f96b2bc8421ec1 "packages": [ { "name": "dnoegel/php-xdg-base-dir", @@ -978,6 +982,74 @@ ], "time": "2019-08-07T15:10:45+00:00" }, + { + "name": "laravelcollective/html", + "version": "v6.0.2", + "source": { + "type": "git", + "url": "https://github.com/LaravelCollective/html.git", + "reference": "2f181aba73390eec13d398bf57877b1cc3bc2588" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/2f181aba73390eec13d398bf57877b1cc3bc2588", + "reference": "2f181aba73390eec13d398bf57877b1cc3bc2588", + "shasum": "" + }, + "require": { + "illuminate/http": "6.0.*", + "illuminate/routing": "6.0.*", + "illuminate/session": "6.0.*", + "illuminate/support": "6.0.*", + "illuminate/view": "6.0.*", + "php": ">=7.2" + }, + "require-dev": { + "illuminate/database": "6.0.*", + "mockery/mockery": "~1.0", + "phpunit/phpunit": "~7.1" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "6.0-dev" + }, + "laravel": { + "providers": [ + "Collective\\Html\\HtmlServiceProvider" + ], + "aliases": { + "Form": "Collective\\Html\\FormFacade", + "Html": "Collective\\Html\\HtmlFacade" + } + } + }, + "autoload": { + "psr-4": { + "Collective\\Html\\": "src/" + }, + "files": [ + "src/helpers.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Adam Engebretson", + "email": "adam@laravelcollective.com" + }, + { + "name": "Taylor Otwell", + "email": "taylorotwell@gmail.com" + } + ], + "description": "HTML and Form Builders for the Laravel Framework", + "homepage": "https://laravelcollective.com", + "time": "2019-09-23T06:16:50+00:00" + }, { "name": "league/flysystem", "version": "1.0.55", diff --git a/database/migrations/2014_10_12_000000_create_users_table.php b/database/migrations/2014_10_12_000000_create_users_table.php index 024721d..8e7ebb9 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -17,7 +17,7 @@ class CreateUsersTable extends Migration Schema::create('users', function (Blueprint $table) { $table->increments('id'); $table->string('name'); - $table->integer('character_id')->unsigned()->unique(); + $table->unsignedInteger('character_id')->unique(); $table->string('avatar'); $table->string('access_token')->nullable(); $table->string('refresh_token')->nullable(); @@ -32,7 +32,7 @@ class CreateUsersTable extends Migration if(!Schema::hasTable('user_roles')) { Schema::create('user_roles', function (Blueprint $table) { $table->increments('id'); - $table->integer('character_id')->unsigned(); + $table->unsignedInteger('character_id'); $table->foreign('character_id')->references('character_id')->on('users'); $table->string('role')->default('None'); $table->timestamps(); @@ -42,7 +42,7 @@ class CreateUsersTable extends Migration if(!Schema::hasTable('esi_tokens')) { Schema::create('esi_tokens', function (Blueprint $table) { $table->increments('id'); - $table->integer('character_id')->unique(); + $table->unsignedInteger('character_id')->unique(); $table->foreign('character_id')->references('character_id')->on('users'); $table->string('access_token'); $table->string('refresh_token'); @@ -54,7 +54,7 @@ class CreateUsersTable extends Migration if(!Schema::hasTable('esi_scopes')) { Schema::create('esi_scopes', function (Blueprint $table) { $table->increments('id'); - $table->integer('character_id'); + $table->unsignedInteger('character_id'); $table->foreign('character_id')->references('character_id')->on('users'); $table->string('scope'); $table->timestamps(); @@ -64,7 +64,7 @@ class CreateUsersTable extends Migration if(!Schema::hasTable('user_permissions')) { Schema::create('user_permissions', function (Blueprint $table) { $table->increments('id'); - $table->integer('character_id')->unisnged(); + $table->unsignedInteger('character_id'); $table->foreign('character_id')->references('character_id')->on('users'); $table->string('permission'); $table->timestamps(); @@ -86,6 +86,11 @@ class CreateUsersTable extends Migration $table->timestamps(); }); + DB::table('available_user_roles')->insert([ + 'role' => 'None', + 'description' => 'No roles whatsoever on the site.', + ]); + DB::table('available_user_roles')->insert([ 'role' => 'Guest', 'description' => 'Guest of the site.', diff --git a/database/migrations/2019_09_26_050854_create_lookup_tables.php b/database/migrations/2019_09_26_050854_create_lookup_tables.php index fdc6e93..cc9c646 100644 --- a/database/migrations/2019_09_26_050854_create_lookup_tables.php +++ b/database/migrations/2019_09_26_050854_create_lookup_tables.php @@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class NewLookupTables extends Migration +class CreateLookupTables extends Migration { /** * Run the migrations. diff --git a/database/seeds/SolarSystemSeeder.php b/database/seeds/SolarSystemSeeder.php index 90f1cab..65318f4 100644 --- a/database/seeds/SolarSystemSeeder.php +++ b/database/seeds/SolarSystemSeeder.php @@ -34,7 +34,7 @@ class SolarSystemSeeder extends Seeder } - $count = SolarSystem::where(['system_id' => $system])->count(); + $count = SolarSystem::where(['solar_system_id' => $system])->count(); if($count == 0) { SolarSystem::insert([ 'name' => $info->name, diff --git a/resources/views/hauling/display/test.blade.php b/resources/views/hauling/display/test.blade.php new file mode 100644 index 0000000..793aa68 --- /dev/null +++ b/resources/views/hauling/display/test.blade.php @@ -0,0 +1 @@ +This is a test \ No newline at end of file diff --git a/resources/views/layouts/navbars/loggedout.blade.php b/resources/views/layouts/navbars/loggedout.blade.php index 5d67057..a36b975 100644 --- a/resources/views/layouts/navbars/loggedout.blade.php +++ b/resources/views/layouts/navbars/loggedout.blade.php @@ -3,7 +3,7 @@ - United Hauling + United Hauling