ldc-cocotte/app/Models/Timeslot.php

50 lines
917 B
PHP
Raw Normal View History

2021-03-29 15:10:07 +02:00
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Timeslot extends Model
{
use HasFactory;
2022-09-08 13:02:16 +02:00
/**
* The attributes that are mass assignable.
*
* @var array
*/
2021-03-29 15:10:07 +02:00
protected $fillable = [
'order_id', 'magasin_id'
2021-03-29 15:10:07 +02:00
];
2023-08-30 08:03:04 +00:00
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'day' => 'date',
];
2022-09-08 13:02:16 +02:00
/**
* BelongsTo order relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
2021-03-29 15:10:07 +02:00
public function order()
{
return $this->belongsTo(Order::class);
}
2022-09-08 13:02:16 +02:00
/**
* BelongsTo magasin relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function magasin()
{
return $this->belongsTo(Magasin::class);
}
2021-03-29 15:10:07 +02:00
}