TypeVehicle.php 486B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace App\Models;
  3. use Carbon\Carbon;
  4. use Illuminate\Database\Eloquent\Casts\Attribute;
  5. use Illuminate\Database\Eloquent\Factories\HasFactory;
  6. use Illuminate\Database\Eloquent\Model;
  7. class TypeVehicle extends Model
  8. {
  9. use HasFactory;
  10. protected $fillable = [
  11. 'type',
  12. ];
  13. protected function updatedAt(): Attribute
  14. {
  15. return Attribute::make(
  16. get:fn($value) => Carbon::parse($value)->translatedFormat('l d/m/Y')
  17. );
  18. }
  19. }