0

Out the test it works, I can visit the page and the controller wroks fine. I wrote the following test:

public function test_logged_user_is_not_redirected()
{
    PartnerFactory::new()->create();

    $request = $this->actingAs(UserFactory::new()->create())
        ->get('partners')
        ->assertRedirect('partners');

    dd($request->inertiaProps());
}

I get error code 500. This is the controller:

public function index()
{
    return Inertia::render('Partners/Index', [
        'filters' => \Illuminate\Support\Facades\Request::all($this->getFilters()),
        'contacts' => function() {
            return $this->getAllContacts();
        }
    ]);
}

This is the route in web.php

Route::get('partners', [PartnersController::class, 'index'])
->name('partners')
->middleware('auth');

Using refresh database, tried url with a '/' before, I still get 500.

edit: without exception handling i get: Trying to get property 'id' of non-object

1
  • I’m voting to close this question because it was based on a configuration mistake Commented Feb 26, 2022 at 9:17

1 Answer 1

0

Found the solution: The user in jetstream MUST have the personal team!

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.