diff --git a/app/Http/Controllers/AdminPanelController.php b/app/Http/Controllers/AdminPanelController.php new file mode 100644 index 0000000..aee487a --- /dev/null +++ b/app/Http/Controllers/AdminPanelController.php @@ -0,0 +1,13 @@ + $data['surname'], 'email' => $data['email'], 'password' => Hash::make($data['password']), + 'is_Admin' => false ]); } } diff --git a/app/User.php b/app/User.php index bd7b03e..d7a690e 100644 --- a/app/User.php +++ b/app/User.php @@ -16,7 +16,7 @@ class User extends Authenticatable * @var array */ protected $fillable = [ - 'name', 'surname', 'email', 'password', + 'name', 'surname', 'email', 'password', 'is_Admin', ]; /** @@ -25,7 +25,7 @@ class User extends Authenticatable * @var array */ protected $hidden = [ - 'password', 'remember_token', + 'password', 'remember_token' ]; /** 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 6f827db..5a04027 100644 --- a/database/migrations/2014_10_12_000000_create_users_table.php +++ b/database/migrations/2014_10_12_000000_create_users_table.php @@ -20,6 +20,7 @@ class CreateUsersTable extends Migration $table->string('email')->unique(); $table->timestamp('email_verified_at')->nullable(); $table->string('password'); + $table->boolean('is_Admin'); $table->rememberToken(); $table->timestamps(); }); diff --git a/database/seeds/DatabaseSeeder.php b/database/seeds/DatabaseSeeder.php index 91cb6d1..9a895dc 100644 --- a/database/seeds/DatabaseSeeder.php +++ b/database/seeds/DatabaseSeeder.php @@ -11,6 +11,12 @@ class DatabaseSeeder extends Seeder */ public function run() { - // $this->call(UsersTableSeeder::class); + DB::table('users')->insert([ + 'name' => 'admin', + 'surname' => 'main', + 'email' => 'admin@admin.com', + 'password' => bcrypt('pass1234'), + 'is_Admin' => true + ]); } } diff --git a/resources/views/auth/login.blade.php b/resources/views/auth/login.blade.php index c12b97e..4d4bdf3 100644 --- a/resources/views/auth/login.blade.php +++ b/resources/views/auth/login.blade.php @@ -1,5 +1,7 @@ @extends('layouts.app') +@section('title') Login @endsection + @section('content')
You are not allowed to see this page.
+ Go somewhere nice + @else +