You can just use dd
dd($client);
Summer Sale! All accounts are 50% off this week.
I have test
$this->withoutExceptionHandling();
$user = User::factory()->create();
$this->actingAs($user);
$client = Clients::factory()->create();
$response = $this->json('PUT', "/clients/$client->id", [
'name' => 'Jan',
'surname' => 'Kowalski',
'NIP' => '5019281771',
'company_name' => 'Firma A',
'phone' => '123456789',
'email' => '[email protected]',
'user_id' => $user->id
]);
$response->assertStatus(302);
This is my route:
Route::resource('clients', ClientsController::class);
I have @method('PUT') in form. Why im getting error The PUT method is not supported for this route. Supported methods: GET, HEAD, POST while running tests? I was trying to dump $client but i don't know how to dump something in tests.
@raloseq You are telling it to not add an ID ? And the factory does not add one either
Please or to participate in this conversation.