Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call to a member function with() on null #57

Open
towoju5 opened this issue Apr 21, 2023 · 1 comment
Open

Call to a member function with() on null #57

towoju5 opened this issue Apr 21, 2023 · 1 comment

Comments

@towoju5
Copy link

towoju5 commented Apr 21, 2023

I have this in my controller but i keep getting

Call to a member function with() on null

Here's what i have in my controller

class ShowTweet extends Controller
{
    public function __invoke(User $user, Transactions $tweet)
    {
        return Inertia::modal('Users/Details')
            ->with([
                'user' => auth()->user(),
                'tweet' => [
                    'user' => 'John doe',
                    'tweet' => 'Oge has a big head'
                ],
            ])
            ->baseRoute('get.users', $user);
    }
}
@towoju5
Copy link
Author

towoju5 commented Apr 21, 2023

also when i tried

return Inertia::modal('Users/Details')->baseRoute('get.users', $user);

it returns a similar error

Call to a member function baseRoute() on null

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant