protected function getModelFromRequest(Request $request)
{
if (!isset($request['model_name'])) {
throw new Exception('No model name provided');
}
if (!isset($request['model_id'])) {
throw new Exception('No model id provided');
}
return call_user_func($request['model_name'] . '::findOrFail', $request['model_id']);
}