protected function getModel($request, $model)
    {
        if ($this->isClassName($model)) {
            return trim($model);
        } else {
            return $request->route($model, null) ?:
                ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
        }
    }
protected function getModel($request, $model)
    {
        if ($this->isClassName($model)) {
            return trim($model);
        } else {
            return $request->route($model, null) ?:
                ((preg_match("/^['\"](.*)['\"]$/", trim($model), $matches)) ? $matches[1] : null);
        }
    }
protected function getModel ( $ request , $ model ) { if ( $ this -> isClassName ( $ model ) ) { return trim ( $ model ) ; } else { return $ request -> route ( $ model , null ) ? : ( ( preg_match ( "/^['\"](.*)['\"]$/" , trim ( $ model ) , $ matches ) ) ? $ matches [ 1 ] : null ) ; } }
Get the model to authorize.

@param  \Illuminate\Http\Request  $request
@param  string  $model
@return \Illuminate\Database\Eloquent\Model|string
Get the model to authorize .