/** * Execute the Middleware * @param object $command * @param callable $next * @return mixed */ public function execute($command, callable $next) { $command->entity = EntityModel::findOrFail($command->entity); return $next($command); }