Initial commit: Import existing Laravel project
This commit is contained in:
38
app/Models/OrderStatusLog.php
Normal file
38
app/Models/OrderStatusLog.php
Normal file
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrderStatusLog extends Model
|
||||
{
|
||||
public $timestamps = false;
|
||||
|
||||
protected $fillable = [
|
||||
'order_id',
|
||||
'user_id',
|
||||
'old_status',
|
||||
'new_status',
|
||||
'changed_at',
|
||||
];
|
||||
|
||||
protected $casts = [
|
||||
'changed_at' => 'datetime',
|
||||
];
|
||||
|
||||
/**
|
||||
* Relation avec la commande.
|
||||
*/
|
||||
public function order()
|
||||
{
|
||||
return $this->belongsTo(Order::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Relation avec l'utilisateur qui a fait la transition.
|
||||
*/
|
||||
public function user()
|
||||
{
|
||||
return $this->belongsTo(User::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user