Depending on the name of the date field you are displaying, you will need to adjust as required - I will use date as a generic example:
class Casos extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'casos';
public $timestamps = false;
protected $dates = ['date'];
}
This will cast the property named date to a Carbon instance, so you can use the format method in the view.
Another option is to format the date in the model for presentation:
class Casos extends Model
{
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'casos';
public $timestamps = false;
public function getFormattedDateAttribute()
{
return Carbon::parse($this->date)->format('d/m/Y');
}
}
This will make available a property called formatted_date on the model, which you can use in your view. Many would frown at incorporating presentation logic into your model; but, if it is used sparingly and you are conscious not to over-use this technique, then it is okay.