ldc-jeusselin/app/Models/Objectives.php
Jérémy Munsch de4dcfb283
Closes #2 and #4
- Add status checker + admin secure packages + upgrade enum + add sentry + upgrade to sitemap generator + bump to CRMV2
- Set customer role enum and user role enum
- Update customer migration to set roles
- phpcbf
- faker local to fr
- update lang
- composer update
- bump laravel ui
- Redo all user crud
- npm bump
- Create admin command
- rearrange views
- redo all auth system
- redo customer pro bo
2023-08-21 15:43:33 +02:00

51 lines
961 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Objectives extends Model
{
protected $table = 'objectives';
use HasFactory;
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'produit',
'qualite',
'campagne',
'quantite',
'prix',
'echeance',
'volume_restant',
'observations',
'customer_id',
'status_id',
'goal_at',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'goal_at' => 'datetime',
];
public function customer()
{
return $this->hasOne(Customer::class, 'id', 'customer_id');
}
public function status()
{
return $this->belongsTo(ObjectiveStatus::class, 'status_id');
}
}