Unverified Commit 700bf9c3 authored by Viral Solani's avatar Viral Solani Committed by GitHub

Merge pull request #93 from viralsolani/analysis-qJ77eE

Apply fixes from StyleCI
parents e8205936 be0ebd29
......@@ -97,7 +97,6 @@ class UserController extends Controller
$permissions = Permission::getSelectData('display_name');
$userPermissions = $user->permissions()->get()->pluck('id')->toArray();
return view('backend.access.users.edit')->with([
'user' => $user,
'userRoles' => $user->roles->pluck('id')->all(),
......
......@@ -28,12 +28,12 @@ class StoreUserRequest extends Request
public function rules()
{
return [
'first_name' => 'required|max:255',
'last_name' => 'required|max:255',
'email' => ['required', 'email', 'max:255', Rule::unique('users')],
'password' => 'required|min:6|confirmed',
'first_name' => 'required|max:255',
'last_name' => 'required|max:255',
'email' => ['required', 'email', 'max:255', Rule::unique('users')],
'password' => 'required|min:6|confirmed',
'assignees_roles' => 'required',
'permissions'=> 'required',
'permissions' => 'required',
];
}
......@@ -45,7 +45,7 @@ class StoreUserRequest extends Request
public function messages()
{
return [
'assignees_roles' => 'Please Select Role'
'assignees_roles' => 'Please Select Role',
];
}
}
......@@ -27,10 +27,10 @@ class UpdateUserRequest extends Request
public function rules()
{
return [
'email' => 'required|email',
'first_name' => 'required',
'last_name' => 'required',
'permissions'=> 'required',
'email' => 'required|email',
'first_name' => 'required',
'last_name' => 'required',
'permissions' => 'required',
'assignees_roles' => 'required',
];
}
......@@ -43,7 +43,7 @@ class UpdateUserRequest extends Request
public function messages()
{
return [
'assignees_roles' => 'Please Select Role'
'assignees_roles' => 'Please Select Role',
];
}
}
......@@ -2,21 +2,21 @@
namespace App\Repositories\Backend\Access\User;
use App\Models\Access\User\User;
use Illuminate\Support\Facades\DB;
use App\Exceptions\GeneralException;
use App\Repositories\BaseRepository;
use Illuminate\Support\Facades\Hash;
use App\Events\Backend\Access\User\UserCreated;
use App\Events\Backend\Access\User\UserDeleted;
use App\Events\Backend\Access\User\UserUpdated;
use App\Events\Backend\Access\User\UserRestored;
use App\Events\Backend\Access\User\UserDeactivated;
use App\Events\Backend\Access\User\UserReactivated;
use App\Events\Backend\Access\User\UserDeleted;
use App\Events\Backend\Access\User\UserPasswordChanged;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Events\Backend\Access\User\UserPermanentlyDeleted;
use App\Events\Backend\Access\User\UserReactivated;
use App\Events\Backend\Access\User\UserRestored;
use App\Events\Backend\Access\User\UserUpdated;
use App\Exceptions\GeneralException;
use App\Models\Access\User\User;
use App\Notifications\Frontend\Auth\UserNeedsConfirmation;
use App\Repositories\Backend\Access\Role\RoleRepository;
use App\Repositories\BaseRepository;
use Illuminate\Support\Facades\DB;
use Illuminate\Support\Facades\Hash;
/**
* Class UserRepository.
......@@ -110,10 +110,9 @@ class UserRepository extends BaseRepository
//Attach new roles
$user->attachRoles($roles);
// Attach New Permissions
// Attach New Permissions
$user->attachPermissions($permissions);
//Send confirmation email if requested and account approval is off
if (isset($data['confirmation_email']) && $user->confirmed == 0) {
$user->notify(new UserNeedsConfirmation($user->confirmation_code));
......@@ -125,13 +124,11 @@ class UserRepository extends BaseRepository
$email_type = 1;
}*/
// Send email to the user
/* $options = [
'data' => $user->toArray(),
'email_template_type' => $email_type,
];*/
/* $options = [
'data' => $user->toArray(),
'email_template_type' => $email_type,
];*/
//createNotification('', 1, 2, $options);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment