Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel 8 date format

// in model 
protected $casts = [
        'date_of_approval' => 'date:d-m-Y'
    ];

// if you want change format any where
$appointment->date_of_approval->format('Y-m-d');

// if you have not cast in model data format
CarbonCarbon::parse($appointment->date_of_approval)->format('Y-m-d');
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #laravel #date #format
ADD COMMENT
Topic
Name
7+1 =