Skip to main content

Black Friday 2025! Only until December 1st: coupon FRIDAY25 for 40% off Yearly/Lifetime membership!

Read more here

LaraBug/larabug-app

218 stars
3 code files
View LaraBug/larabug-app on GitHub

app/Models/Exception.php

Open in GitHub
use Illuminate\Database\Eloquent\Model;
 
class Exception extends Model
{
public function getHumanDateAttribute()
{
return $this->created_at->diffForHumans();
}
}

resources/views/home.blade.php

Open in GitHub
<div class="block-content block-content-full block-content-sm bg-body-light">
<span class="font-size-sm text-muted">Project <strong>{{ $exception->project->title }}</strong> at <strong>{{ $exception->created_at }}
({{ $exception->human_date }})</strong></span>
</div>

app/Http/Resources/Api/ExceptionResource.php

Open in GitHub
use Illuminate\Http\Resources\Json\JsonResource;
 
class ExceptionResource extends JsonResource
{
public function toArray($request)
{
return [
'id' => $this->id,
'human_date' => $this->human_date,
];
}
}

We'd Love Your Feedback

Tell us what you like or what we can improve

Feel free to share anything you like or dislike about this page or the platform in general.