ldc-dam/app/Models/Recherche.php

44 lines
817 B
PHP
Raw Permalink Normal View History

2019-07-25 09:43:06 +02:00
<?php
namespace App\Models;
2019-07-25 09:43:06 +02:00
use Illuminate\Database\Eloquent\Model;
class Recherche extends Model
{
2022-04-19 16:07:27 +02:00
/**
* The attributes that should be cast.
*
* @var array
*/
protected $casts = [
'filters' => 'object'
];
// * RELATIONSHIPS
/**
* BelongsTo sujet relation
*
2022-04-19 16:07:27 +02:00
* Get the sujet that owns the recherche.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
2022-04-19 16:07:27 +02:00
*/
public function sujet()
{
return $this->belongsTo(Sujet::class, 'sujet_id');
2022-04-19 16:07:27 +02:00
}
2019-07-25 09:43:06 +02:00
2022-04-19 16:07:27 +02:00
/**
* BelongsTo user relation
*
* Get the user that owns the recherche.
*
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
2022-04-19 16:07:27 +02:00
*/
public function user()
{
return $this->belongsTo(User::class, 'user_id');
2022-04-19 16:07:27 +02:00
}
2019-07-25 09:43:06 +02:00
}