Check marking before create user

This commit is contained in:
Too
2018-06-20 15:43:04 +08:00
parent b1843c0b9b
commit a2dad37758
3 changed files with 31 additions and 1 deletions
@@ -4,6 +4,7 @@ namespace App\Http\Controllers\Auth;
use App\User;
use App\Role;
use App\Marking;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Validator;
@@ -58,6 +59,11 @@ class RegisterController extends Controller
*/
protected function create(array $data)
{
$marking = Marking::Where('email',$data['email'])->first();
if($marking->marking = $data['marking']){
redirect('/');
}
$role = Role::where('name','=','member')->first();
$user = new User();
$user->name = $data['name'];