51 lines
966 B
PHP
51 lines
966 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use App\Enums\EventHistoryType;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Historique extends Model
|
|
{
|
|
/**
|
|
* Indicates if the model should be timestamped.
|
|
*
|
|
* @var boolean
|
|
*/
|
|
public $timestamps = false;
|
|
|
|
/**
|
|
* The attributes that should be cast.
|
|
*
|
|
* @var array
|
|
*/
|
|
public $casts = [
|
|
'type' => EventHistoryType::class
|
|
];
|
|
|
|
// * RELATIONSHIPS
|
|
|
|
/**
|
|
* BelongsTo user relation
|
|
*
|
|
* Get the user that owns the historique.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function user()
|
|
{
|
|
return $this->belongsTo(User::class);
|
|
}
|
|
|
|
/**
|
|
* BelongsTo media relation
|
|
*
|
|
* Get the media that owns the historique.
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function media()
|
|
{
|
|
return $this->belongsTo(Media::class);
|
|
}
|
|
}
|