Work on registration of existing systems to users
This commit is contained in:
@@ -21,7 +21,7 @@ class SystemRegister extends FormRequest
|
||||
{
|
||||
$this->so = System::findOrNew($request->system_id);
|
||||
|
||||
return Gate::allows($this->so->exists ? 'update' : 'create',$this->so);
|
||||
return Gate::allows($this->so->users->count() ? 'update' : 'register',$this->so);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -31,7 +31,7 @@ class SystemRegister extends FormRequest
|
||||
*/
|
||||
public function rules(Request $request)
|
||||
{
|
||||
if (! $request->isMethod('post'))
|
||||
if ((! $request->isMethod('post')) || ($request->action == 'register'))
|
||||
return [];
|
||||
|
||||
if ((! $this->so->exists) && ($request->action == 'create')) {
|
||||
|
Reference in New Issue
Block a user