Skip to content
Advertisement

Laravel 9 with argument 2 must be of type ?callable, string given

I’m following a tutorial. In the controller I’m using with to send a success message.

JavaScript

I’m getting an error message once the form is submitted and I’m redirected to the index page the code there looks like this.

JavaScript

This is the error message: with(): Argument #2 ($callback) must be of type ?callable, string given, called in C:laragonwwwrecipe_projectappHttpControllersRecipeController.php on line 49

Advertisement

Answer

You missed arrow:

JavaScript

Should be:

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