2019-07-22 14:54:42 +02:00
|
|
|
<?php
|
|
|
|
|
|
2019-09-12 11:08:25 +02:00
|
|
|
namespace App\Models;
|
2019-07-22 14:54:42 +02:00
|
|
|
|
2022-07-25 11:37:01 +02:00
|
|
|
use App\Enums\EventHistoryType;
|
2019-07-22 14:54:42 +02:00
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
|
|
|
|
|
|
class Historique extends Model
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
/**
|
|
|
|
|
* Indicates if the model should be timestamped.
|
|
|
|
|
*
|
|
|
|
|
* @var boolean
|
|
|
|
|
*/
|
2019-07-22 14:54:42 +02:00
|
|
|
public $timestamps = false;
|
|
|
|
|
|
2022-07-25 11:37:01 +02:00
|
|
|
/**
|
|
|
|
|
* The attributes that should be cast.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
public $casts = [
|
|
|
|
|
'type' => EventHistoryType::class
|
|
|
|
|
];
|
|
|
|
|
|
2022-06-20 14:57:58 +02:00
|
|
|
// * RELATIONSHIPS
|
|
|
|
|
|
2022-04-19 16:07:27 +02:00
|
|
|
/**
|
2022-06-20 14:57:58 +02:00
|
|
|
* BelongsTo user relation
|
|
|
|
|
*
|
2022-04-19 16:07:27 +02:00
|
|
|
* Get the user that owns the historique.
|
2022-06-20 14:57:58 +02:00
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2022-04-19 16:07:27 +02:00
|
|
|
*/
|
|
|
|
|
public function user()
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
return $this->belongsTo(User::class);
|
2022-04-19 16:07:27 +02:00
|
|
|
}
|
2019-07-22 14:54:42 +02:00
|
|
|
|
2022-04-19 16:07:27 +02:00
|
|
|
/**
|
2022-06-20 14:57:58 +02:00
|
|
|
* BelongsTo media relation
|
|
|
|
|
*
|
2022-04-19 16:07:27 +02:00
|
|
|
* Get the media that owns the historique.
|
2022-06-20 14:57:58 +02:00
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2022-04-19 16:07:27 +02:00
|
|
|
*/
|
|
|
|
|
public function media()
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
return $this->belongsTo(Media::class);
|
2022-04-19 16:07:27 +02:00
|
|
|
}
|
2019-07-22 14:54:42 +02:00
|
|
|
}
|