Index: app/Models/User.php
===================================================================
--- app/Models/User.php	(revision 7ed1069f6039a50afc7a9220886408a347ce4ffd)
+++ app/Models/User.php	(revision 0924b6c75483e6a4ae83e08487635bdc25436fed)
@@ -9,162 +9,141 @@
 class User extends Authenticatable
 {
-    use Notifiable;
+	use Notifiable;
 
-    protected $table = "users";
+	protected $table = "users";
 
-    /**
-     * The attributes that are mass assignable.
-     *
-     * @var array
-     */
-    protected $fillable = [
-        "name",
-        "surname",
-        "username",
-        "password",
-        "email",
+	/**
+	 * The attributes that are mass assignable.
+	 *
+	 * @var array
+	 */
+	protected $fillable = [
+		"name",
+		"surname",
+		"username",
+		"password",
+		"email",
         "country_code",
         "mobile_number",
-        "role_id"
-    ];
+		"role_id"
+	];
 
-    /**
-     * The attributes that should be hidden for arrays.
-     *
-     * @var array
-     */
-    protected $hidden = [
-        "password",
-        "remember_token",
-        "is_active"
-    ];
+	/**
+	 * The attributes that should be hidden for arrays.
+	 *
+	 * @var array
+	 */
+	protected $hidden = [
+		"password",
+		"remember_token",
+		"is_active"
+	];
 
-    /**
-     * The attributes that should be cast to native types.
-     *
-     * @var array
-     */
-    protected $casts = [];
+	/**
+	 * The attributes that should be cast to native types.
+	 *
+	 * @var array
+	 */
+	protected $casts = [];
 
 
-    public function role()
-    {
-        return $this->belongsTo(Role::class);
-    }
+	public function role() {
+		return $this->belongsTo(Role::class);
+	}
 
-    public function company()
-    {
-        return $this->belongsTo(Company::class);
-    }
-
-    public function userProfile()
-    {
+	public function userProfile() {
         return $this->hasOne(UserProfile::class);
     }
 
-    public function post()
-    {
-        return $this->hasMany(Post::class);
-    }
+	public function post() {
+		return $this->hasMany(Post::class);
+	}
 
-    public function comments()
-    {
-        return $this->hasManyThrough(Comment::class, Post::class);
-    }
+	public function comments()
+	{
+		return $this->hasManyThrough(Comment::class, Post::class);
+	}
 
-    public function hasPermission($permission, $id = null, $any = false)
-    {
+	public function hasPermission($permission, $id = null, $any = false) {
 
-        $userPermissions = null;
-        $flag = null;
+		$userPermissions = null;
+		$flag = null;
 
-        if ($id != null) $userPermissions = User::find($id)->role->permission->pluck("name");
-        else $userPermissions = $this->role->permission->pluck("name");
+		if($id != null) $userPermissions = User::find($id)->role->permission->pluck("name");
+		else $userPermissions = $this->role->permission->pluck("name");
 
-        if ($any) {
-            foreach ($permission as $p) {
-                if ($this->hasPermission($p)) {
-                    return true;
-                }
-            }
-            return false;
-        }
+		if($any) {
+			foreach($permission as $p) {
+				if($this->hasPermission($p)) {
+					return true;
+				}
+			}
+			return false;
+		}
 
-        if (is_string($permission)) {
-            return $userPermissions->contains($permission);
-        }
+		if(is_string($permission)) {
+			return $userPermissions->contains($permission);
+		}
 
-        if (is_array($permission)) {
-            foreach ($permission as $p) {
-                if ($this->hasPermission($p)) {
-                    $flag = true;
-                } else {
-                    $flag = false;
-                    break;
-                }
-            }
-        }
+		if(is_array($permission)) {
+			foreach($permission as $p) {
+				if($this->hasPermission($p)) {
+					$flag = true;
+				} else {
+					$flag = false; break;
+				}
+			}
+		}
 
-        return $flag;
-    }
+		return $flag;
+	}
 
-    public function hasAllPermissions(array $permissions = array(), $id = null, $any = false)
-    {
-        return $this->hasPermission($permissions, $id, $any);
-    }
+	public function hasAllPermissions(array $permissions = array(), $id = null, $any = false) {
+		return $this->hasPermission($permissions, $id, $any);
+	}
 
-    public function hasAnyPermission(array $permissions = array(), $id = null, $any = true)
-    {
-        return $this->hasPermission($permissions, $id, $any);
-    }
+	public function hasAnyPermission(array $permissions = array(), $id = null, $any = true) {
+		return $this->hasPermission($permissions, $id, $any);
+	}
 
-    public function hasRole($role)
-    {
-        return $role === $this->role->name;
-    }
+	public function hasRole($role) {
+		return $role === $this->role->name;
+	}
 
-    public function isAdmin()
-    {
-        return $this->hasRole("admin");
-    }
+	public function isAdmin() {
+		return $this->hasRole("admin");
+	}
 
-    public function isAdminOrEditor()
-    {
-        return $this->hasRole("admin") || $this->hasRole("editor");
-    }
+	public function isAdminOrEditor() {
+		return $this->hasRole("admin") || $this->hasRole("editor");
+	}
 
-    public function getFullName($id = null)
-    {
+	public function getFullName($id = null) {
 
-        if ($id != null) {
-            $user = User::find($id);
-            return $user->name . " " . $user->surname;
-        }
+		if($id != null) {
+			$user = User::find($id);
+			return $user->name . " " . $user->surname;
+		}
 
-        return $this->name . " " . $this->surname;
-    }
+		return $this->name . " " . $this->surname;
+	}
 
-    public function getPostsCount($id)
-    {
-        return Post::where("user_id", $id)->count();
-    }
+	public function getPostsCount($id) {
+		return Post::where("user_id", $id)->count();
+	}
 
-    public function generateTemporaryPassword($length = 20)
-    {
-        return bcrypt(Str::random($length));
-    }
+	public function generateTemporaryPassword($length = 20) {
+		return bcrypt(Str::random($length));
+	}
 
-    public function generateSecurityCode($min = 10000, $max = 99999)
-    {
-        return rand($min, $max);
-    }
+	public function generateSecurityCode($min = 10000, $max = 99999) {
+		return rand($min, $max);
+	}
 
-    public function generateVerifyToken($length = 32)
-    {
-        return Str::random($length);
-    }
+	public function generateVerifyToken($length = 32) {
+		return Str::random($length);
+	}
 
-    public function generateProfileLink($name, $surname)
-    {
+    public function generateProfileLink($name, $surname) {
 
         $profileLinks = UserProfile::pluck("profile_link")->toArray();
@@ -172,5 +151,5 @@
 
         foreach ($profileLinks as $profileLink) {
-            if ($profileLink == $link) {
+            if($profileLink == $link) {
                 $link .= "-" . strtolower(Str::random(10));
                 break;
@@ -181,6 +160,5 @@
     }
 
-    public function generateTechnoblogEmail($name, $surname)
-    {
+    public function generateTechnoblogEmail($name, $surname) {
 
         $emails = UserProfile::pluck("technoblog_email")->toArray();
@@ -188,5 +166,5 @@
 
         foreach ($emails as $email) {
-            if ($email == $newEmail) {
+            if($email == $newEmail) {
                 $position = strlen($name) + strlen($surname) + 1;
                 $id = UserProfile::latest("id")->first()->id + 1;
