ldc-boutique-cnc/app/Models/Shop/Timeslot.php
Jérémy Munsch b757d7df9d
Payment system PART2 : Stripe OK SYNC 46
- changed order pk column to id
- refactored and fixed inShop
- using php Money for transaction
2023-03-09 12:07:40 +01:00

51 lines
946 B
PHP

<?php
namespace App\Models\Shop;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Timeslot extends Model
{
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'order_id', 'shop_id', 'slot'
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'slot' => 'datetime'
];
// * RELATIONSHIPS
/**
* BelongsTo order relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function order()
{
return $this->belongsTo(Order::class);
}
/**
* BelongsTo shop relation
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
*/
public function shop()
{
return $this->belongsTo(Shop::class);
}
}