diff --git a/skolehjem/app/Http/Controllers/UserController.php b/skolehjem/app/Http/Controllers/UserController.php
index 92c82bb..efafadd 100644
--- a/skolehjem/app/Http/Controllers/UserController.php
+++ b/skolehjem/app/Http/Controllers/UserController.php
@@ -154,6 +154,13 @@ class UserController extends Controller
/** @var User $user */
$user->update($data);
+ $user->roles()->detach();
+ $user->forgetCachedPermissions();
+
+ foreach ($request->roles as $role){
+ $user->assignRole($role);
+ }
+
$user->save();
// }
@@ -231,5 +238,13 @@ class UserController extends Controller
return redirect()->route('users.login');
}
+ public function account()
+ {
+ return Response::detect("users.account");
+ }
+ public function accountedit()
+ {
+ return Response::detect("users.edit");
+ }
}
diff --git a/skolehjem/app/User.php b/skolehjem/app/User.php
index a7a7023..ac8b735 100644
--- a/skolehjem/app/User.php
+++ b/skolehjem/app/User.php
@@ -21,7 +21,7 @@ class User extends Authenticatable
* @var array
*/
protected $fillable = [
- 'name_first', "name_last", 'email', 'password', "phone", "roles"
+ 'name_first', "name_last", 'email', 'password', "phone"
];
/**
diff --git a/skolehjem/resources/views/admin/contacts/index.blade.php b/skolehjem/resources/views/admin/contacts/index.blade.php
index 2d39848..dc0d212 100644
--- a/skolehjem/resources/views/admin/contacts/index.blade.php
+++ b/skolehjem/resources/views/admin/contacts/index.blade.php
@@ -30,7 +30,7 @@
@csrf
@method("delete")
-
+
diff --git a/skolehjem/resources/views/admin/events/index.blade.php b/skolehjem/resources/views/admin/events/index.blade.php
index 8a6c273..95e6bb1 100644
--- a/skolehjem/resources/views/admin/events/index.blade.php
+++ b/skolehjem/resources/views/admin/events/index.blade.php
@@ -28,7 +28,7 @@
@csrf
@method("delete")
-
+
diff --git a/skolehjem/resources/views/admin/external-links/index.blade.php b/skolehjem/resources/views/admin/external-links/index.blade.php
index e9f726b..069db81 100644
--- a/skolehjem/resources/views/admin/external-links/index.blade.php
+++ b/skolehjem/resources/views/admin/external-links/index.blade.php
@@ -26,7 +26,7 @@
@csrf
@method("delete")
-
+
diff --git a/skolehjem/resources/views/admin/menuplans/index.blade.php b/skolehjem/resources/views/admin/menuplans/index.blade.php
index f5ceebf..e1f75d2 100644
--- a/skolehjem/resources/views/admin/menuplans/index.blade.php
+++ b/skolehjem/resources/views/admin/menuplans/index.blade.php
@@ -32,7 +32,7 @@
@csrf
@method("delete")
-
+
diff --git a/skolehjem/resources/views/admin/roles/index.blade.php b/skolehjem/resources/views/admin/roles/index.blade.php
index 47d2d5e..29aab0d 100644
--- a/skolehjem/resources/views/admin/roles/index.blade.php
+++ b/skolehjem/resources/views/admin/roles/index.blade.php
@@ -26,7 +26,7 @@
@csrf
@method("delete")
-
+
diff --git a/skolehjem/resources/views/admin/staff/create.blade.php b/skolehjem/resources/views/admin/staff/create.blade.php
deleted file mode 100644
index 3430725..0000000
--- a/skolehjem/resources/views/admin/staff/create.blade.php
+++ /dev/null
@@ -1,30 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Opret
-@endsection
-
-@section("path")
- Opret Personal /
-@endsection
-
-@section("content")
-
Opret Personal:
-
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/delete.blade.php b/skolehjem/resources/views/admin/staff/delete.blade.php
deleted file mode 100644
index 4c3f81e..0000000
--- a/skolehjem/resources/views/admin/staff/delete.blade.php
+++ /dev/null
@@ -1,13 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Fjern
-@endsection
-
-@section("path")
- Fjern Personal /
-@endsection
-
-@section("content")
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/edit.blade.php b/skolehjem/resources/views/admin/staff/edit.blade.php
deleted file mode 100644
index aa0b337..0000000
--- a/skolehjem/resources/views/admin/staff/edit.blade.php
+++ /dev/null
@@ -1,31 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Rediger
-@endsection
-
-@section("path")
- Rediger Personal /
-@endsection
-
-@section("content")
- Rediger Personal:
-
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/index.blade.php b/skolehjem/resources/views/admin/staff/index.blade.php
deleted file mode 100644
index 52c333d..0000000
--- a/skolehjem/resources/views/admin/staff/index.blade.php
+++ /dev/null
@@ -1,41 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Vis
-@endsection
-
-@section("path")
- Vis Personal /
-@endsection
-
-@section("content")
-
-
- Fornavn |
- Efternavn |
- Email |
- Tlf nr |
- |
- |
-
- @foreach($staffs as $staff)
-
- {{ $staff->name_first }} |
- {{ $staff->name_last }} |
- {{ $staff->email }} |
- {{ $staff->phone }} |
- $staff->id ]) }}"> |
-
- |
-
- @endforeach
-
-
- {{ $staffs->links() }}
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/login.blade.php b/skolehjem/resources/views/admin/staff/login.blade.php
deleted file mode 100644
index 5accdac..0000000
--- a/skolehjem/resources/views/admin/staff/login.blade.php
+++ /dev/null
@@ -1,27 +0,0 @@
-@extends("app.layout.base")
-
-@section("title")
- Login
-@endsection
-
-@section("content")
-
-
-
-
-
- Forgot password?
-
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/logout.blade.php b/skolehjem/resources/views/admin/staff/logout.blade.php
deleted file mode 100644
index d364bbd..0000000
--- a/skolehjem/resources/views/admin/staff/logout.blade.php
+++ /dev/null
@@ -1,14 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Home - Logud
-@endsection
-
-@section("path")
- Logud /
-@endsection
-
-@section("content")
-
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/show.blade.php b/skolehjem/resources/views/admin/staff/show.blade.php
deleted file mode 100644
index 5563064..0000000
--- a/skolehjem/resources/views/admin/staff/show.blade.php
+++ /dev/null
@@ -1,14 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Vis
-@endsection
-
-@section("path")
- Vis Personal /
-@endsection
-
-@section("content")
- show.blade.php
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/store.blade.php b/skolehjem/resources/views/admin/staff/store.blade.php
deleted file mode 100644
index 43ae210..0000000
--- a/skolehjem/resources/views/admin/staff/store.blade.php
+++ /dev/null
@@ -1,14 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Opret
-@endsection
-
-@section("path")
- Opret Personal /
-@endsection
-
-@section("content")
- Personal blev (ikke) oprettet.
-@endsection
diff --git a/skolehjem/resources/views/admin/staff/update.blade.php b/skolehjem/resources/views/admin/staff/update.blade.php
deleted file mode 100644
index 7f7a25f..0000000
--- a/skolehjem/resources/views/admin/staff/update.blade.php
+++ /dev/null
@@ -1,14 +0,0 @@
-@extends("admin.layout.base")
-@extends("admin.layout.header")
-
-@section("title")
- Personal - Rediger
-@endsection
-
-@section("path")
- Rediger Personal /
-@endsection
-
-@section("content")
- Din Personal blev (ikke) redigeret.
-@endsection
diff --git a/skolehjem/resources/views/admin/users/create.blade.php b/skolehjem/resources/views/admin/users/create.blade.php
index 6cc39a2..0802da9 100644
--- a/skolehjem/resources/views/admin/users/create.blade.php
+++ b/skolehjem/resources/views/admin/users/create.blade.php
@@ -25,9 +25,9 @@
-
-