Index: app/Http/Controllers/Auth/CreatePasswordController.php
===================================================================
--- app/Http/Controllers/Auth/CreatePasswordController.php	(revision c433da6c016aaef7f6c2e4c328cda1a31412b885)
+++ app/Http/Controllers/Auth/CreatePasswordController.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -36,4 +36,6 @@
         $user->save();
 
+        session()->flash("password_created", "You have created a password successfully!");
+
         return redirect()->route("auth.loginShow");
     }
Index: app/Http/Controllers/Dashboard/PostsController.php
===================================================================
--- app/Http/Controllers/Dashboard/PostsController.php	(revision c433da6c016aaef7f6c2e4c328cda1a31412b885)
+++ app/Http/Controllers/Dashboard/PostsController.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -5,8 +5,10 @@
 use App\Helpers\Alert;
 use App\Http\Requests\Dashboard\PostRequest;
+use App\Models\Review;
 use App\Models\Tag;
 use App\Models\Post;
 use App\Models\User;
 use App\Models\Category;
+use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Str;
 use Illuminate\Http\Request;
@@ -91,39 +93,61 @@
     public function store(PostRequest $request)
     {
-        $post = new Post();
-        $user = auth()->user();
-        $category = Category::find($request->category);
-
-        $post->user()->associate($user);
-        $post->category()->associate($category);
-
-        $post->title = $request->title;
-
-        $image = $request->file("image");
-        $extension = $image->getClientOriginalExtension();
-        $imageName = $this->createImageName($extension);
-        Storage::disk('uploads')->put($imageName, File::get($image));
-
-        $post->image_link = $imageName;
-        $post->content = Purifier::clean($request->post_content, 'youtube');
-
-        $post->slug = $post->createSlug();
-
-        if ($post->user->hasPermission("publish_post")) {
-            $post->confirmed_by = $post->user->id;
-            $post->is_active = 1;
-            $post->is_confirmed = true;
-        }
-
-        $post->save();
-        $this->checkNewAndSaveTags($post, $request->tags);
-
-        if ($post->user->hasPermission("publish_post")) {
-            Alert::flash("New posts published successfully");
-        } else {
-            Alert::flash("New posts submitted for review successfully");
-            $adminsAndEditors = User::where("role_id", 1)->orWhere("role_id", 2)->get();
-            Notification::send($adminsAndEditors, new NewPostCreated("Have new post for review"));
-        }
+        DB::transaction(function () use ($request) {
+            $post = new Post();
+            $user = auth()->user();
+            $category = Category::find($request->category);
+
+            $post->user()->associate($user);
+            $post->category()->associate($category);
+
+            $post->title = $request->title;
+
+            $image = $request->file("image");
+            $extension = $image->getClientOriginalExtension();
+            $imageName = $this->createImageName($extension);
+            Storage::disk('uploads')->put($imageName, File::get($image));
+
+            $post->image_link = $imageName;
+            $post->content = Purifier::clean($request->post_content, 'youtube');
+
+            $post->slug = $post->createSlug();
+
+            $needReview = $post->needReview();
+
+            if (is_null($needReview)) {
+                $post->confirmed_by = $post->user->id;
+                $post->is_active = 1;
+                $post->is_confirmed = true;
+            }
+
+            $post->save();
+            $this->checkNewAndSaveTags($post, $request->tags);
+
+            if ($needReview) {
+
+                $review = new Review();
+                $review->post()->associate($post);
+                $review->postSecurity()->associate($needReview);
+                $review->current_phase = $review->postSecurity->phases()->first()->id;
+                $review->save();
+
+                Alert::flash("New posts submitted for review successfully");
+
+                Notification::send(
+                    User::whereRoleId($review->postSecurity->role->id)->get(),
+                    new NewPostCreated("Have new post for review")
+                );
+            } else {
+                Alert::flash("New posts published successfully");
+            }
+        });
+
+//        if ($post->user->hasPermission("publish_post")) {
+//            Alert::flash("New posts published successfully");
+//        } else {
+//            Alert::flash("New posts submitted for review successfully");
+//            $adminsAndEditors = User::where("role_id", 1)->orWhere("role_id", 2)->get();
+//            Notification::send($adminsAndEditors, new NewPostCreated("Have new post for review"));
+//        }
 
         return redirect()->route("dashboard.posts.create");
@@ -135,19 +159,31 @@
         $flag = false;
 
-        if (auth()->user()->hasPermission("confirm_post")) {
-            $flag = true;
-        }
-
-        if ($flag) {
-
-            $post->is_confirmed = true;
-            $post->confirmed_by = auth()->user()->id;
-
-            $post->save();
-
-            Alert::flash("Post confirmed successfully");
-
-            $post->user->notify(new PostConfirmed("Your post has been confirmed"));
-        }
+//        if (auth()->user()->hasPermission("confirm_post")) {
+//            $flag = true;
+//        }
+
+        if (!$post->review->canReview()) {
+            Alert::flash("Post need to be confirmed by " . $post->review->getCurrentReviewer()->name, "error");
+            return redirect()->back();
+        }
+
+        DB::transaction(function () use ($post) {
+
+            $post->review->increment("current_phase");
+            $post->review->save();
+
+            if (is_null($post->review->getPhase())) {
+
+                $post->review->is_passed_all_phases = true;
+                $post->review->save();
+
+                $post->is_confirmed = true;
+                $post->confirmed_by = auth()->user()->id;
+                $post->save();
+                $post->user->notify(new PostConfirmed("Your post has been confirmed"));
+            }
+        });
+
+        Alert::flash("Post confirmed successfully");
 
         return redirect()->route("dashboard.posts.index");
Index: app/Http/Controllers/Dashboard/SettingsController.php
===================================================================
--- app/Http/Controllers/Dashboard/SettingsController.php	(revision c433da6c016aaef7f6c2e4c328cda1a31412b885)
+++ app/Http/Controllers/Dashboard/SettingsController.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -6,9 +6,14 @@
 use App\Http\Requests\Dashboard\EmailSettingsRequest;
 use App\Http\Requests\Dashboard\PasswordSettingsRequest;
+use App\Http\Requests\Dashboard\PhaseRequest;
 use App\Http\Requests\Dashboard\PhotosSettingsRequest;
+use App\Http\Requests\Dashboard\PostSecurityRequest;
 use App\Http\Requests\Dashboard\SocialLinksSettingsRequest;
 use App\Http\Requests\Dashboard\UsernameSettingsRequest;
 use App\Http\Requests\Dashboard\UserProfileSettingsRequest;
+use App\Models\Phase;
 use App\Models\Post;
+use App\Models\PostSecurity;
+use App\Models\Role;
 use App\Models\User;
 use App\Models\UserProfile;
@@ -30,5 +35,8 @@
             "userProfile" => auth()->user()->userProfile,
             "countries" => Country::all(),
-            "adminAndEditors" => User::where("role_id", 1)->orWhere("role_id", 2)->get()
+            "adminAndEditors" => User::where("role_id", 1)->orWhere("role_id", 2)->get(),
+            "userRoles" => Role::all(),
+            "phases" => Phase::all(),
+            "postSecurities" => PostSecurity::all()
         ]);
     }
@@ -179,4 +187,66 @@
     }
 
+    public function phaseStore(PhaseRequest $request)
+    {
+        if ($request->has("phase_id") && !is_null($request->phase_id)) {
+            $phase = Phase::findOrFail($request->phase_id);
+        } else {
+            $phase = new Phase();
+        }
+
+        $phase->name = $request->name;
+        $phase->reviewer()->associate(Role::find($request->reviewer_role_id));
+        $phase->user()->associate(auth()->user());
+        $phase->save();
+
+        if ($request->has("phase_id") && !is_null($request->phase_id)) {
+            Alert::flash($phase->name . " updated successfully");
+        } else {
+            Alert::flash($phase->name . " created successfully");
+        }
+
+        return redirect()->route("dashboard.settings.index");
+    }
+
+    public function phaseDestroy($id)
+    {
+        $phase = Phase::findOrFail($id);
+        $phaseName = $phase->name;
+        $phase->delete();
+
+        Alert::flash($phaseName . " deleted successfully");
+
+        return redirect()->route("dashboard.settings.index");
+    }
+
+    public function postSecurityStore(PostSecurityRequest $request)
+    {
+        if ($request->has("post_security_id") && !is_null($request->post_security_id)) {
+            $postSecurity = PostSecurity::findOrFail($request->post_security_id);
+        } else {
+            $postSecurity = new PostSecurity();
+        }
+
+        $postSecurity->role()->associate(Role::find($request->role_id_to_be_reviewed));
+        $postSecurity->phase_ids = $request->phase_ids;
+
+        $postSecurity->save();
+
+        if ($request->has("post_security_id") && !is_null($request->post_security_id)) {
+            Alert::flash("Post security updated successfully");
+        } else {
+            Alert::flash("Post security created successfully");
+        }
+
+        return redirect()->route("dashboard.settings.index");
+    }
+
+    public function postSecurityDestroy($id)
+    {
+        PostSecurity::findOrFail($id)->delete();
+        Alert::flash("Post security deleted successfully");
+        return redirect()->route("dashboard.settings.index");
+    }
+
     private function updatePhotosHelper(Request $request, UserProfile $userProfile)
     {
Index: app/Http/Controllers/Dashboard/UsersController.php
===================================================================
--- app/Http/Controllers/Dashboard/UsersController.php	(revision c433da6c016aaef7f6c2e4c328cda1a31412b885)
+++ app/Http/Controllers/Dashboard/UsersController.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -10,4 +10,5 @@
 use App\Notifications\WelcomeUser;
 use App\Http\Controllers\Controller;
+use Illuminate\Support\Facades\DB;
 use Illuminate\Support\Facades\Storage;
 use Propaganistas\LaravelPhone\PhoneNumber;
@@ -32,28 +33,32 @@
     public function store(NewUserRequest $request)
     {
-        $user = new User();
+        DB::transaction(function () use ($request) {
 
-        $user->name = $request->name;
-        $user->surname = $request->surname;
-        $user->email = $request->email;
-        $user->country_code = $request->mobile_number_country;
-        $user->mobile_number = PhoneNumber::make($request->mobile_number, $request->mobile_number_country)->formatInternational();
-        $user->username = $request->username;
-        $user->password = $user->generateTemporaryPassword();
-        $user->security_code = $user->generateSecurityCode();
-        $user->verify_token = $user->generateVerifyToken();
+            $user = new User();
 
-        $user->role_id = $request->userRole;
+            $user->name = $request->name;
+            $user->surname = $request->surname;
+            $user->email = $request->email;
+            $user->country_code = $request->mobile_number_country;
+            $user->mobile_number = PhoneNumber::make($request->mobile_number, $request->mobile_number_country)->formatInternational();
+            $user->username = $request->username;
+            $user->password = $user->generateTemporaryPassword();
+            $user->security_code = $user->generateSecurityCode();
+            $user->verify_token = $user->generateVerifyToken();
 
-        $user->save();
+            $user->role_id = $request->userRole;
 
-        $user->userProfile()->create([
-            "profile_link" => $user->generateProfileLink($request->name, $request->surname),
-            "technoblog_email" => $user->generateTechnoblogEmail($request->name, $request->surname)
-        ]);
+            $user->save();
 
-        $user->notify(new WelcomeUser($user));
+            $user->userProfile()->create([
+                "profile_link" => $user->generateProfileLink($request->name, $request->surname),
+                "technoblog_email" => $user->generateTechnoblogEmail($request->name, $request->surname)
+            ]);
 
-        Alert::flash("New user added successfully");
+            $user->notify(new WelcomeUser($user));
+
+            Alert::flash("New user added successfully");
+
+        });
 
         return redirect()->route("dashboard.users.create");
Index: app/Http/Requests/Dashboard/NewUserRequest.php
===================================================================
--- app/Http/Requests/Dashboard/NewUserRequest.php	(revision c433da6c016aaef7f6c2e4c328cda1a31412b885)
+++ app/Http/Requests/Dashboard/NewUserRequest.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -38,10 +38,12 @@
     protected function getValidatorInstance()
     {
-        if($this->request->has("mobile_number") && $this->request->has("mobile_number_country")) {
-            $this->request->set("mobile_number", PhoneNumber::make(
-                $this->request->get("mobile_number"),
-                $this->request->get("mobile_number_country")
-            )->formatInternational());
-        }
+        try {
+            if($this->request->has("mobile_number") && $this->request->has("mobile_number_country")) {
+                $this->request->set("mobile_number", PhoneNumber::make(
+                    $this->request->get("mobile_number"),
+                    $this->request->get("mobile_number_country")
+                )->formatInternational());
+            }
+        } catch (\Exception $e) {}
 
         return parent::getValidatorInstance();
Index: app/Http/Requests/Dashboard/PhaseRequest.php
===================================================================
--- app/Http/Requests/Dashboard/PhaseRequest.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
+++ app/Http/Requests/Dashboard/PhaseRequest.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -0,0 +1,42 @@
+<?php
+
+namespace App\Http\Requests\Dashboard;
+
+use Illuminate\Foundation\Http\FormRequest;
+
+class PhaseRequest extends FormRequest
+{
+    /**
+     * Determine if the user is authorized to make this request.
+     *
+     * @return bool
+     */
+    public function authorize()
+    {
+        if ($this->has("phase_id") && !is_null($this->request->get("phase_id"))) {
+            return auth()->user()->hasPermission("edit_phase");
+        }
+
+        return auth()->user()->hasPermission("create_phase");
+    }
+
+    /**
+     * Get the validation rules that apply to the request.
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        $rules = [
+            "name" => "required|min:2|unique:phases",
+            "reviewer_role_id" => "required|exists:roles,id",
+        ];
+
+        if ($this->has("phase_id") && !is_null($this->request->get("phase_id"))) {
+            $rules["name"] = "required|min:2|unique:phases,name," . $this->request->get("phase_id");
+            $rules["phase_id"] = "required|exists:phases,id";
+        }
+
+        return $rules;
+    }
+}
Index: app/Http/Requests/Dashboard/PostSecurityRequest.php
===================================================================
--- app/Http/Requests/Dashboard/PostSecurityRequest.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
+++ app/Http/Requests/Dashboard/PostSecurityRequest.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -0,0 +1,53 @@
+<?php
+
+namespace App\Http\Requests\Dashboard;
+
+use App\Models\Phase;
+use Illuminate\Foundation\Http\FormRequest;
+
+class PostSecurityRequest extends FormRequest
+{
+    /**
+     * Determine if the user is authorized to make this request.
+     *
+     * @return bool
+     */
+    public function authorize()
+    {
+        if ($this->has("post_security_id") && !is_null($this->request->get("post_security_id"))) {
+            return auth()->user()->hasPermission("edit_post_securities");
+        }
+
+        return auth()->user()->hasPermission("create_post_securities");
+    }
+
+    /**
+     * Get the validation rules that apply to the request.
+     *
+     * @return array
+     */
+    public function rules()
+    {
+        return [
+            "role_id_to_be_reviewed" => "required|exists:roles,id",
+            "phase_ids" => [
+                "required",
+                function($attribute, $value, $fail) {
+                    $phases = explode(",", $value);
+                    foreach ($phases as $phase) {
+                        if(is_null(Phase::find($phase))) {
+                            $fail("Error occurred. Please try again!");
+                        }
+                    }
+                }
+            ],
+        ];
+    }
+
+    public function attributes()
+    {
+        return [
+            "phase_ids" => "phases"
+        ];
+    }
+}
Index: app/Models/Phase.php
===================================================================
--- app/Models/Phase.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
+++ app/Models/Phase.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -0,0 +1,23 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Phase extends Model
+{
+    protected $table = "phases";
+    protected $fillable = [
+        "name", "reviewer_role_id"
+    ];
+
+    public function user()
+    {
+        return $this->belongsTo(User::class);
+    }
+
+    public function reviewer()
+    {
+        return $this->belongsTo(Role::class, "reviewer_role_id");
+    }
+}
Index: app/Models/Post.php
===================================================================
--- app/Models/Post.php	(revision c433da6c016aaef7f6c2e4c328cda1a31412b885)
+++ app/Models/Post.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -16,4 +16,13 @@
 		return $this->belongsTo(User::class);
 	}
+
+	public function review() {
+		return $this->hasOne(Review::class);
+	}
+
+	public function needReview()
+    {
+        return PostSecurity::whereRoleId($this->user->role->id)->first();
+    }
 
 	public function category() {
Index: app/Models/PostSecurity.php
===================================================================
--- app/Models/PostSecurity.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
+++ app/Models/PostSecurity.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -0,0 +1,51 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class PostSecurity extends Model
+{
+    protected $table = "post_securities";
+
+    protected $fillable = [
+        "role_id", "phases_id"
+    ];
+
+    public function role()
+    {
+        return $this->belongsTo(Role::class);
+    }
+
+    public function phases($onlyNames = false)
+    {
+        $collection = collect();
+        $names = [];
+        $phase_ids = explode(",", $this->phase_ids);
+
+        foreach ($phase_ids as $phase_id) {
+            $phase = Phase::findOrFail($phase_id);
+            array_push($names, $phase->name);
+            $collection->push($phase);
+        }
+
+        if ($onlyNames) return implode(", ", $names);
+
+        return $collection;
+    }
+
+    public function getPhasesAttribute()
+    {
+        return $this->phases();
+    }
+
+    public function getPhaseNamesAttribute()
+    {
+        return $this->phases(true);
+    }
+
+    public function hasNextPhase($id)
+    {
+        return in_array($id + 1, explode(",", $this->phases_id));
+    }
+}
Index: app/Models/Review.php
===================================================================
--- app/Models/Review.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
+++ app/Models/Review.php	(revision 0c07a90e366407811902a5052f42e01d20bafe25)
@@ -0,0 +1,35 @@
+<?php
+
+namespace App\Models;
+
+use Illuminate\Database\Eloquent\Model;
+
+class Review extends Model
+{
+    protected $table = "post_reviews";
+
+    public function post()
+    {
+        return $this->belongsTo(Post::class);
+    }
+
+    public function postSecurity()
+    {
+        return $this->belongsTo(PostSecurity::class, "post_security_id");
+    }
+
+    public function getPhase()
+    {
+        return $this->postSecurity->phases()->where("id", $this->current_phase)->first();
+    }
+
+    public function canReview()
+    {
+        return $this->getPhase()->reviewer_role_id == auth()->user()->role->id;
+    }
+
+    public function getCurrentReviewer()
+    {
+        return $this->getPhase()->reviewer;
+    }
+}
