getLastNotification() public method

Get last notification of the current entity.
public getLastNotification ( $toId, $entity, Closur\Closure $filterScope = null ) : mixed
$toId
$entity
$filterScope Closur\Closure
return mixed
 /** @test */
 function it_get_the_last_notificiation_sent()
 {
     $category = $this->createCategory(['name' => 'test']);
     $this->createNotification(['category_id' => $category->id, 'url' => 'first', 'to_id' => 1, 'created_at' => Carbon\Carbon::now()->addDay(1)]);
     $this->createNotification(['category_id' => $category->id, 'url' => 'second', 'to_id' => 1, 'created_at' => Carbon\Carbon::now()->addDay(2)]);
     $notification = $this->notificationRepo->getLastNotification(1, null);
     $this->assertEquals('second', $notification->url);
 }