use Carbon\Carbon; $now = Carbon::now(); $timestamp = $now->getTimestamp(); echo $timestamp; // Returns Unix timestamp of current timeIn this example, we're creating a new Carbon instance using the now() method, which returns the current date and time. We then call the getTimestamp() method on this instance to get the Unix timestamp. Finally, we echo the result to the screen. The package library for this example is Carbon.