Thursday 18 July 2019

Laravel now() && carbon

now()

The now function creates a new Illuminate\Support\Carbon instance for the current time:
$now = now();
https://laravel.com/docs/5.8/helpers
convert string to carbon
public function getLicenseExpireAttribute($date)
{
    return Carbon::parse($date);
}
convert carbon to string
now()->addMinutes(43200)->toDateString()
https://stackoverflow.com/questions/50692147/how-to-convert-a-carbon-into-string
https://stackoverflow.com/questions/50692147/how-to-convert-a-carbon-into-string

No comments:

Post a Comment