How to make time ago in Laravel Project
When we are building a blog post or we create an item in our project we might need to let people the post was created by when and it has been how long time ago in your Laravel Project.
5 min readMay 17, 2022
So today, I gonna show you step by step to do it.
Step
- Step 1 — Install Laravel
- Step 2 — Setting up a MySQL Database
- Step 3 — Create a Database Migration
- Step 4 — Add a Resource Route
- Step 5 — Add a Controller and Model
- Step 6 — Add Blade View
- Step 7 — Run Development Server
- Step 8 — Test This App
Step 1 — Installing Laravel
Let’s get started by installing Laravel using Composer.
Open a new command-line interface and run the following command:
$ composer create-project laravel/laravel=8.0 testapp --prefer-dist
Step 2 — Setting up a MySQL Database
Let’s now create a MySQL database that we’ll use to persist data in our Laravel application. In your…