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');
 
PREVIOUS NEXT
Tagged: #laravel #date #format
ADD COMMENT
Topic
Name
6+5 =