ldc-bogt/app/Models/Eleveur.php
2022-03-08 11:40:52 +01:00

80 lines
1.6 KiB
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class Eleveur extends Model
{
use SoftDeletes;
/**
* Indicates if the model should be timestamped.
*
* @var boolean
*/
public $timestamps = false;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'code_cafel',
'code_ede',
'civilite',
'nom',
'prenom',
'naissance',
'cp',
'ville',
'elv_date_debut',
'code_inuav',
'exploitation',
'aboutyou',
'vocation',
'likeinjob',
'loue_means',
'path_photo1',
'path_photo2',
'marquage_oeuf',
'marquage_b1',
'marquage_b2'
];
/**
* @var string
*/
protected $table = 'eleveurs';
/**
* The accessors to append to the model's array form.
*
* @var array
*/
protected $appends = ['questions'];
/**
* Questions attribute accessor
*
* @return boolean
*/
public function getQuestionsAttribute(): bool
{
if ($this->aboutyou != null && $this->aboutyou != '') {
return true;
}
if ($this->vocation != null && $this->vocation != '') {
return true;
}
if ($this->likeinjob != null && $this->likeinjob != '') {
return true;
}
if ($this->loue_means != null && $this->loue_means != '') {
return true;
}
return false;
}
}