2019-07-25 09:43:06 +02:00
|
|
|
<?php
|
|
|
|
|
|
2019-09-12 11:08:25 +02:00
|
|
|
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
|
|
|
/**
|
2022-06-20 14:57:58 +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.
|
2022-06-20 14:57:58 +02:00
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
2022-04-19 16:07:27 +02:00
|
|
|
*/
|
|
|
|
|
public function sujet()
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
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
|
|
|
/**
|
2022-06-20 14:57:58 +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()
|
|
|
|
|
{
|
2022-06-20 14:57:58 +02:00
|
|
|
return $this->belongsTo(User::class, 'user_id');
|
2022-04-19 16:07:27 +02:00
|
|
|
}
|
2019-07-25 09:43:06 +02:00
|
|
|
}
|