ldc-boutique-cnc/app/Models/CollectionException.php
2022-11-08 15:41:10 +01:00

51 lines
946 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use DateTimeInterface;
class CollectionException extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'date', 'shop_id'
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'date' => 'date',
];
/**
* Format a date
*
* @param DateTimeInterface $date
* @return string
*/
protected function serializeDate(DateTimeInterface $date)
{
return $date->format('Y-m-d');
}
/**
* BelongsTo shop relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function shop()
{
return $this->belongsTo(Shop::class);
}
}