Index: app/Http/Controllers/Dashboard/DepartmentsController.php
===================================================================
--- app/Http/Controllers/Dashboard/DepartmentsController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
+++ app/Http/Controllers/Dashboard/DepartmentsController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
@@ -0,0 +1,75 @@
+<?php
+
+namespace App\Http\Controllers\Dashboard;
+
+use App\Helpers\Alert;
+use App\Http\Requests\Dashboard\NewDepartmentRequest;
+use App\Http\Requests\Dashboard\UpdateDepartmentRequest;
+use App\Models\Department;
+use App\Models\User;
+use Illuminate\Http\Request;
+use App\Http\Controllers\Controller;
+use Illuminate\Support\Facades\Auth;
+
+class DepartmentsController extends Controller
+{
+    public function index()
+    {
+        return view("dashboard.departments.index")->with([
+            "departments" => Department::all()
+        ]);
+    }
+
+    public function create()
+    {
+        return view("dashboard.departments.create");
+    }
+
+    public function editShow($id)
+    {
+        return view("dashboard.departments.edit")->with([
+            "department" => Department::findOrFail($id)
+        ]);
+    }
+
+    public function edit(UpdateDepartmentRequest $request, $id)
+    {
+        $department = Department::findOrFail($id);
+
+        $department->name = $request->name;
+        $department->code = $request->code;
+
+        $department->save();
+
+        Alert::flash("Department edited successfully");
+
+        return redirect()->route("dashboard.departments.index");
+    }
+
+    public function store(NewDepartmentRequest $request)
+    {
+        $department = new Department();
+
+        $department->name = $request->name;
+        $department->code = $request->code;
+
+        $department->user_id = auth()->id();
+
+        $department->save();
+
+        Alert::flash("New Department added successfully");
+
+        return redirect()->route("dashboard.departments.index");
+    }
+
+    public function destroy(Request $request, $id)
+    {
+        $department = Department::find($id);
+
+        $department->delete();
+
+        Alert::flash($department->name . " deleted successfully");
+
+        return redirect()->route("dashboard.departments.index");
+    }
+}
Index: app/Http/Controllers/Dashboard/IndexController.php
===================================================================
--- app/Http/Controllers/Dashboard/IndexController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
+++ app/Http/Controllers/Dashboard/IndexController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Http\Controllers\Dashboard;
+
+use App\Helpers\Alert;
+use App\Models\User;
+use App\Http\Controllers\Controller;
+
+class IndexController extends Controller
+{
+    public function index()
+    {
+        $counters = array(
+            "users" => User::count(),
+        );
+
+        Alert::flash("test");
+
+        return view("dashboard.index")->with([
+            "counters" => $counters,
+        ]);
+    }
+}
Index: app/Http/Controllers/Dashboard/NotificationsController.php
===================================================================
--- app/Http/Controllers/Dashboard/NotificationsController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
+++ app/Http/Controllers/Dashboard/NotificationsController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
@@ -0,0 +1,81 @@
+<?php
+
+namespace App\Http\Controllers\Dashboard;
+
+use Carbon\Carbon;
+use App\Http\Controllers\Controller;
+
+class NotificationsController extends Controller
+{
+    public $notifications;
+    private $notificationsLimit = 10;
+
+    public function __construct() {
+        $this->middleware("auth");
+        $this->notifications = null;
+    }
+
+    public function notifications() {
+        return view("dashboard.notifications.index")->with([
+            "notifications" => $this->decode(auth()->user()->notifications, true)
+        ]);
+    }
+
+    public function getNotifications() {
+        return auth()->user()->readNotifications;
+    }
+
+    public function getUnreadNotifications() {
+        return auth()->user()->unreadNotifications;
+    }
+
+    public function markNotificationsAsRead() {
+        return auth()->user()->unreadNotifications->markAsRead();
+    }
+
+    public function showNotifications() {
+
+        $this->notifications = collect();
+
+        if($this->getUnreadNotifications()->count() == 0) {
+            $this->notifications->push($this->getNotifications()->take($this->notificationsLimit));
+            $this->notifications = $this->notifications->flatten();
+            return response()->json($this->decode($this->notifications->reverse()));
+        }
+
+        if($this->getUnreadNotifications()->count() > 10) {
+            $this->notifications->push($this->getUnreadNotifications()->take($this->notificationsLimit));
+        } else {
+            $readNotifications = $this->notificationsLimit - $this->getUnreadNotifications()->count();
+            $this->notifications->push($this->getUnreadNotifications());
+            $this->notifications->push($this->getNotifications()->take($readNotifications));
+        }
+
+        $this->notifications = $this->notifications->flatten();
+
+        return response()->json($this->decode($this->notifications->reverse()));
+    }
+
+    public function decode($notifications, $isShowOnly = false) {
+
+        $response = array();
+        $decoded = json_decode($notifications);
+
+        foreach($decoded as $notification) {
+            $isRead = empty($notification->read_at) ? false : true;
+            array_push($response, [
+                "isRead" => $isRead,
+                // "from" => $notification->data->from,
+                "url" => $notification->data->url,
+                "message" => $notification->data->message,
+                "ago" => Carbon::parse($notification->created_at)->diffForHumans(),
+            ]);
+        }
+
+        if(!$isShowOnly) {
+            $this->markNotificationsAsRead();
+        }
+
+        return $response;
+    }
+}
Index: app/Http/Controllers/Dashboard/SettingsController.php
===================================================================
--- app/Http/Controllers/Dashboard/SettingsController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
+++ app/Http/Controllers/Dashboard/SettingsController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
@@ -0,0 +1,82 @@
+<?php
+
+namespace App\Http\Controllers\Dashboard;
+
+use App\Helpers\Alert;
+use App\Http\Requests\Dashboard\EmailSettingsRequest;
+use App\Http\Requests\Dashboard\NewUserRequest;
+use App\Http\Requests\Dashboard\PasswordSettingsRequest;
+use App\Http\Requests\Dashboard\PhotosSettingsRequest;
+use App\Http\Requests\Dashboard\SocialLinksSettingsRequest;
+use App\Http\Requests\Dashboard\UsernameSettingsRequest;
+use App\Http\Requests\Dashboard\UserProfileSettingsRequest;
+use App\Models\Post;
+use App\Models\Role;
+use App\Models\User;
+use App\Models\UserProfile;
+use Illuminate\Support\Str;
+use Illuminate\Http\Request;
+use App\Http\Controllers\Controller;
+use Illuminate\Support\Facades\File;
+use Illuminate\Support\Facades\Hash;
+use App\Notifications\VerifyNewEmail;
+use Illuminate\Support\Facades\Storage;
+use Propaganistas\LaravelPhone\PhoneNumber;
+use Propaganistas\LaravelIntl\Facades\Country;
+
+class SettingsController extends Controller
+{
+    public function settings()
+    {
+        return view("dashboard.settings.index")->with([
+            "user" => auth()->user(),
+            "adminAndEditors" => User::where("role_id", 1)->orWhere("role_id", 2)->get()
+        ]);
+    }
+
+    public function updateUsername(UsernameSettingsRequest $request)
+    {
+        $user = auth()->user();
+        $user->username = $request->username;
+        $user->save();
+
+        auth()->logout();
+        session()->flush();
+
+        return redirect()->route("auth.loginShow");
+    }
+
+    public function updatePassword(PasswordSettingsRequest $request)
+    {
+        $user = auth()->user();
+        $user->password = bcrypt($request->password);
+        $user->save();
+
+        auth()->logout();
+        session()->flush();
+
+        return redirect()->route("auth.loginShow");
+    }
+
+    public function updateEmail(EmailSettingsRequest $request)
+    {
+        $user = auth()->user();
+
+        $user->email = $request->email;
+        $user->is_active = false;
+        $user->security_code = $user->generateSecurityCode();
+        $user->verify_token = $user->generateVerifyToken();
+
+        $user->save();
+
+        $user->notify(new VerifyNewEmail($user));
+
+        auth()->logout();
+        session()->flush();
+
+        return redirect()->route("auth.loginShow");
+    }
+
+
+
+}
Index: app/Http/Controllers/Dashboard/UsersController.php
===================================================================
--- app/Http/Controllers/Dashboard/UsersController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
+++ app/Http/Controllers/Dashboard/UsersController.php	(revision 194a35967c638db611da70bbf868d51cd9124ed2)
@@ -0,0 +1,131 @@
+<?php
+
+namespace App\Http\Controllers\Dashboard;
+
+use App\Helpers\Alert;
+use App\Http\Requests\Dashboard\NewUserRequest;
+use App\Http\Requests\Dashboard\UpdateUserRequest;
+use App\Models\Role;
+use App\Models\User;
+use App\Notifications\VerifyNewEmail;
+use Illuminate\Http\Request;
+use App\Notifications\WelcomeUser;
+use App\Http\Controllers\Controller;
+
+class UsersController extends Controller
+{
+    public function index()
+    {
+        return view("dashboard.users.index")->with([
+            "users" => User::all()
+        ]);
+    }
+
+    public function create()
+    {
+        return view("dashboard.users.create")->with([
+            "roles" => Role::all(),
+        ]);
+    }
+
+    public function store(NewUserRequest $request)
+    {
+        $user = new User();
+
+        $user->name = $request->name;
+        $user->surname = $request->surname;
+        $user->email = $request->email;
+        $user->mobile_number = $request->mobile_number;
+        $user->username = $request->username;
+        $user->password = $user->generateTemporaryPassword();
+        $user->security_code = $user->generateSecurityCode();
+        $user->verify_token = $user->generateVerifyToken();
+
+        $user->role_id = $request->userRole;
+
+        $user->save();
+
+        $user->notify(new WelcomeUser($user));
+
+        Alert::flash("New user added successfully");
+
+        return redirect()->route("dashboard.users.index");
+    }
+
+    public function editShow($id)
+    {
+        return view("dashboard.users.edit")->with([
+            "user" => User::findOrFail($id),
+            "roles" => Role::all(),
+        ]);
+    }
+
+    public function edit(UpdateUserRequest $request, $id)
+    {
+        $user = User::findOrFail($id);
+        $user->name = $request->name;
+        $user->surname = $request->surname;
+        $user->username = $request->username;
+        $user->email = $request->email;
+        $user->mobile_number = $request->mobile_number;
+        $user->role_id = $request->userRole;
+        if($user->isDirty('email')) {
+            $user->notify(new VerifyNewEmail($user));
+        }
+        $user->save();
+
+        Alert::flash("User updated successfully");
+
+        return redirect()->route("dashboard.users.index");
+    }
+
+    public function editUserData(UpdateUserRequest $request, $id)
+    {
+        $user = User::findOrFail($id);
+        $user->name = $request->name;
+        $user->surname = $request->surname;
+        $user->mobile_number = $request->mobile_number;
+
+        $user->save();
+
+        Alert::flash("User data updated successfully");
+
+        return redirect()->route("dashboard.settings.index");
+    }
+
+    public function block(Request $request, $id)
+    {
+        $user = User::find($id);
+        $user->is_active = false;
+        $user->save();
+        Alert::flash($user->name . " User blocked successfully");
+        return redirect()->route("dashboard.users.index");
+    }
+
+    public function unblock(Request $request, $id)
+    {
+        $user = User::find($id);
+        $user->is_active = true;
+        $user->save();
+        Alert::flash($user->name . " User unblocked successfully");
+        return redirect()->route("dashboard.users.index");
+    }
+
+    public function destroy(Request $request, $id)
+    {
+        $user = User::find($id);
+
+        $user->userProfile->delete();
+        $user->delete();
+
+        Alert::flash($user->name . " deleted successfully");
+
+        return redirect()->route("dashboard.users.index");
+    }
+
+    public function getUserRoles()
+    {
+      $roles = Role::get();
+      return $roles;
+    }
+}
