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
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.
I’m the maintainer of the
yoeunes/toastr
Laravel package.There is no
message()
method in theToastr
, this is why you get this error.Just remove the
{!! Toastr::message() !!}
from your blade views, as thetoastr
scripts will be added automatically for you.