Merge branch 'user_management' into authentication

This commit is contained in:
Michal Kváček
2016-01-22 17:27:36 +01:00
37 changed files with 3476 additions and 108 deletions
@@ -0,0 +1,34 @@
<?php
namespace App\Http\Requests;
use App\Http\Requests\Request;
use App\Models\User;
class CreateNewUserRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return \Auth::check() && \Auth::$user->role == User::ROLE_ADMIN;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'role' => 'required',
'email' => 'required|email|max:128|unique:users',
'password' => 'required|min:6'
];
}
}