I
I
Ivan Ivanov2020-04-23 22:05:02
Laravel
Ivan Ivanov, 2020-04-23 22:05:02

Why does the page redirect to itself?

I write tests. Here is the test itself:

$response = $this->get('fillProfile');
        $response->assertStatus(200);

Writes that the code is 302, that is, the page is reloading, looked where - on itself
Here is web.php:
Route::get('fillProfile', '[email protected]')->name('fillProfile');

Controller method:
$user = User::findOrFail(Auth::id());
        if($user->status == User::USER_IS_PROFILED) {
            return abort(404, 'Страница не найдена');
        }
        return view('profile.fillProfile', [
            'title' => 'Заполнение профиля'
        ]);

I would like to remove this redirect to itself

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question