I am using laravel created event. I want to use newly created id in another table. But when i print created object, i don't get the id property. How can i get newly created id in created event.
This is my code.
public static function booted()
{
static::created(function ($agentTask)
{
echo $agentTask->id;
print_r($agentTask);
});
}
echo statement printing null. and when i print $agentTask object, i don't find id anywhere.