call_user_func

Supported Versions: PHP 4, PHP 5, PHP 7, PHP 8
Call the callback given by the first parameter
<?php call_user_func(callable $callback, mixed ...$args): mixed
<?php         $response = response(SupportPageComponents::renderContentsIntoLayout($html, $layoutConfig));



        if (is_callable($layoutConfig->response)) {

            call_user_func($layoutConfig->response, $response);

        }



        return $response;
<?php         $validator = Validator::make($data, $rules, $messages, $attributes);



        if ($this->withValidatorCallback) {

            call_user_func($this->withValidatorCallback, $validator);



            $this->withValidatorCallback = null;

        }
<?php         $validator = Validator::make($data, $rulesForField, $messages, $attributes);



        if ($this->withValidatorCallback) {

            call_user_func($this->withValidatorCallback, $validator);



            $this->withValidatorCallback = null;

        }
<?php     protected function guessPolicyName($class)

    {

        if ($this->guessPolicyNamesUsingCallback) {

            return Arr::wrap(call_user_func($this->guessPolicyNamesUsingCallback, $class));

        }



        $classDirname = str_replace('/', '\\', dirname(str_replace('\\', '/', $class)));
<?php     protected function resolveUser()

    {

        return call_user_func($this->userResolver);

    }
<?php         }



        if (static::$redirectToCallback) {

            return call_user_func(static::$redirectToCallback, $request);

        }

    }
<?php     protected function registerUserResolver()

    {

        $this->app->bind(AuthenticatableContract::class, fn ($app) => call_user_func($app['auth']->userResolver()));

    }
<?php     protected function registerAccessGate()

    {

        $this->app->singleton(GateContract::class, function ($app) {

            return new Gate($app, fn () => call_user_func($app['auth']->userResolver()));

        });

    }
<?php     {

        $this->app->rebinding('request', function ($app, $request) {

            $request->setUserResolver(function ($guard = null) use ($app) {

                return call_user_func($app['auth']->userResolver(), $guard);

            });

        });

    }
<?php         }



        if (isset($this->customProviderCreators[$driver = ($config['driver'] ?? null)])) {

            return call_user_func(

                $this->customProviderCreators[$driver], $this->app, $config

            );

        }



        return match ($driver) {
<?php     protected function redirectTo(Request $request)

    {

        if (static::$redirectToCallback) {

            return call_user_func(static::$redirectToCallback, $request);

        }

    }
<?php     protected function redirectTo(Request $request): ?string

    {

        return static::$redirectToCallback

            ? call_user_func(static::$redirectToCallback, $request)

            : $this->defaultRedirectUri();

    }
<?php     public function toMail($notifiable)

    {

        if (static::$toMailCallback) {

            return call_user_func(static::$toMailCallback, $notifiable, $this->token);

        }



        return $this->buildMailMessage($this->resetUrl($notifiable));
<?php     protected function resetUrl($notifiable)

    {

        if (static::$createUrlCallback) {

            return call_user_func(static::$createUrlCallback, $notifiable, $this->token);

        }



        return url(route('password.reset', [
<?php         $verificationUrl = $this->verificationUrl($notifiable);



        if (static::$toMailCallback) {

            return call_user_func(static::$toMailCallback, $notifiable, $verificationUrl);

        }



        return $this->buildMailMessage($verificationUrl);