Skip to content
Advertisement

Missing argument 1 for IlluminateSupportMessageBag::has()

When i access my Laravel Project. It Returns Following Errors. How to Solve It.

JavaScript

In my Blade Code :

JavaScript

Advertisement

Answer

Check this line:

JavaScript

has() is used to filter the selecting model based on a relationship. So it acts very similarly to a normal WHERE condition. If you just use has('relation') that means you only want to get the models that have at least one related model in this relation.

has() must have a string index as its parameter to check whether it exist or not. But in your case it is blank.

Replace the following line:

JavaScript

with

JavaScript

and try again.

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement