44 lines
892 B
PHP
44 lines
892 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use App\Models\Customers;
|
|
|
|
class Salarie extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
/**
|
|
* The attributes that are mass assignable.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $fillable = [
|
|
'matricule',
|
|
'nom', 'prenom',
|
|
'code',
|
|
'start_date', 'end_date', 'etablissement', 'site', 'service'
|
|
];
|
|
|
|
/**
|
|
* BelongsTo customer relation
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
*/
|
|
public function customer()
|
|
{
|
|
return $this->belongsTo(Customers::class);
|
|
}
|
|
|
|
/**
|
|
* belongsTo magasin relation
|
|
*
|
|
* @return \Illuminate\Database\Eloquent\Relations\belongsTo
|
|
*/
|
|
public function magasin()
|
|
{
|
|
return $this->belongsTo(Magasin::class);
|
|
}
|
|
}
|