/** @test */ public function it_casts_moderated_at_attribute_as_a_date() { $post = $this->createPost(); Post::approve($post->id); //reload the instance $post = Post::find($post->id); $this->assertInstanceOf(\Carbon\Carbon::class, $post->{$this->moderated_at_column}); }