lepikhinb / momentum-modal

MIT License
442 stars 26 forks source link

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

Open towoju5 opened 1 year ago

towoju5 commented 1 year ago

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 commented 1 year ago

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