'required|string|max:255', 'email' => 'required|string|email|max:255|unique:school_users', 'url' => 'required|string|regex:/^https?:\/\/.*teacharabia\.com\/api$/i|unique:school_users', 'password' => 'required|string|min:6|confirmed', 'super_password' => 'required|string' ]; } public function run() { if (env('APP_SUPER_PASSWORD') != $this->super_password) { $this->failedAuthorization(); } else{ $hashPassword['password'] = Hash::make($this->password); $this->merge($hashPassword); $user = new SchoolUser(); $user->fill($this->only($user->getFillable())); $user->save(); $token = JWTAuth::fromUser($user); return ['token' => $token]; } } }