public function postCreate()
    {
        try {
            $validator = new PermissionValidator(Input::all());
            if(!$validator->passes()) {
                return Response::json(array('permissionCreated' => false, 'errorMessages' => $validator->getErrors()));
            }

            // create permission
            $permission = PermissionProvider::createPermission(Input::all());
        } catch (\MrJuliuss\Syntara\Models\Permissions\NameRequiredException $e) {} catch (\MrJuliuss\Syntara\Models\Permissions\ValueRequiredException $e) {} catch (\MrJuliuss\Syntara\Models\Permissions\PermissionExistsException $e) {
            return json_encode(array('permissionCreated' => false, 'message' => trans('syntara::permissions.messages.exists'), 'messageType' => 'danger'));
        }

        return json_encode(array('permissionCreated' => true, 'redirectUrl' => URL::route('listPermissions')));
    }
public function postCreate()
    {
        try {
            $validator = new PermissionValidator(Input::all());
            if(!$validator->passes()) {
                return Response::json(array('permissionCreated' => false, 'errorMessages' => $validator->getErrors()));
            }

            // create permission
            $permission = PermissionProvider::createPermission(Input::all());
        } catch (\MrJuliuss\Syntara\Models\Permissions\NameRequiredException $e) {} catch (\MrJuliuss\Syntara\Models\Permissions\ValueRequiredException $e) {} catch (\MrJuliuss\Syntara\Models\Permissions\PermissionExistsException $e) {
            return json_encode(array('permissionCreated' => false, 'message' => trans('syntara::permissions.messages.exists'), 'messageType' => 'danger'));
        }

        return json_encode(array('permissionCreated' => true, 'redirectUrl' => URL::route('listPermissions')));
    }
public function postCreate ( ) { try { $ validator = new PermissionValidator ( Input :: all ( ) ) ; if ( ! $ validator -> passes ( ) ) { return Response :: json ( array ( 'permissionCreated' => false , 'errorMessages' => $ validator -> getErrors ( ) ) ) ; } // create permission $ permission = PermissionProvider :: createPermission ( Input :: all ( ) ) ; } catch ( \ MrJuliuss \ Syntara \ Models \ Permissions \ NameRequiredException $ e ) { } catch ( \ MrJuliuss \ Syntara \ Models \ Permissions \ ValueRequiredException $ e ) { } catch ( \ MrJuliuss \ Syntara \ Models \ Permissions \ PermissionExistsException $ e ) { return json_encode ( array ( 'permissionCreated' => false , 'message' => trans ( 'syntara::permissions.messages.exists' ) , 'messageType' => 'danger' ) ) ; } return json_encode ( array ( 'permissionCreated' => true , 'redirectUrl' => URL :: route ( 'listPermissions' ) ) ) ; }
Create new permission
Create new permission