2021-07-20 16:34:27 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Models;
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
2021-07-21 15:03:37 +02:00
|
|
|
use App\Models\Customers;
|
2021-07-20 16:34:27 +02:00
|
|
|
|
|
|
|
|
class Salarie extends Model
|
|
|
|
|
{
|
|
|
|
|
use HasFactory;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* The attributes that are mass assignable.
|
|
|
|
|
*
|
|
|
|
|
* @var array
|
|
|
|
|
*/
|
|
|
|
|
protected $fillable = [
|
|
|
|
|
'matricule',
|
2022-09-21 16:12:03 +02:00
|
|
|
'nom', 'prenom',
|
|
|
|
|
'code',
|
|
|
|
|
'start_date', 'end_date', 'etablissement', 'site', 'service'
|
2021-07-20 16:34:27 +02:00
|
|
|
];
|
2021-07-21 15:03:37 +02:00
|
|
|
|
2022-09-08 13:02:16 +02:00
|
|
|
/**
|
|
|
|
|
* BelongsTo customer relation
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
|
*/
|
2022-09-08 11:29:39 +02:00
|
|
|
public function customer()
|
|
|
|
|
{
|
2021-07-21 15:03:37 +02:00
|
|
|
return $this->belongsTo(Customers::class);
|
|
|
|
|
}
|
2022-09-21 16:12:03 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* belongsTo magasin relation
|
|
|
|
|
*
|
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\belongsTo
|
|
|
|
|
*/
|
|
|
|
|
public function magasin()
|
|
|
|
|
{
|
|
|
|
|
return $this->belongsTo(Magasin::class);
|
|
|
|
|
}
|
2021-07-20 16:34:27 +02:00
|
|
|
}
|