skip to Main Content

This is where Toastr is being called on my payment.view.blad.php file

<script src="{{asset('assets/admin')}}/js/custom.js"></script>
<script src="{{asset('assets/admin')}}/js/vendor.min.js"></script>
<script src="{{asset('assets/admin')}}/js/theme.min.js"></script>
<script src="{{asset('assets/admin')}}/js/sweet_alert.js"></script>
<script src="{{asset('assets/admin')}}/js/toastr.js"></script>
<script src="{{asset('assets/admin')}}/js/bootstrap.min.js"></script>
{!! Toastr::message() !!}

The error sends me to a Facade.php under vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php:261

public static function setFacadeApplication($app)
    {
        static::$app = $app;
    }

    /**
     * Handle dynamic, static calls to the object.
     *
     * @param  string  $method
     * @param  array  $args
     * @return mixed
     *
     * @throws RuntimeException
     */
    public static function __callStatic($method, $args)
    {
        $instance = static::getFacadeRoot();

        if (! $instance) {
            throw new RuntimeException('A facade root has not been set.');
        }


        return $instance->$method(...$args);
    }
}

the error is pointing to

return $instance->$method(...$args);

If more details is needed, I will provide

I’ve tried commenting out the error to no avail

2

Answers


  1. Some where in your files you added a message() method/function which is not recognized in Laravel.

    Best if you put out more of your code to see where the error is originating from.

    Login or Signup to reply.
  2. I’m the maintainer of the yoeunes/toastr Laravel package.

    There is no message() method in the Toastr, this is why you get this error.

    Just remove the {!! Toastr::message() !!} from your blade views, as the toastr scripts will be added automatically for you.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search