Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Author.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@ class Author extends Model

public function setDobAttribute($dob)
{
$this->attributes['dob'] = Carbon::parse($dob);
$this->attributes['dob'] = Carbon::createFromFormat('m/d/Y', $dob);
}
}
2 changes: 1 addition & 1 deletion app/Http/Controllers/AuthorsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ protected function validateRequest()
{
return request()->validate([
'name' => 'required',
'dob' => 'required',
'dob' => 'required|date_format:m/d/Y',
]);
}
}
2 changes: 2 additions & 0 deletions tests/Feature/AuthorManagementTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ class AuthorManagementTest extends TestCase
/** @test */
public function an_author_can_be_created()
{
$this->withoutExceptionHandling();

$this->post('/authors', $this->data());

$author = Author::all();
Expand Down