- Creation of controller : CreateProject, for creation of the company works. - Controller : ProjectDatacontroller to manage data of the equipments and installations in general.
42 lines
851 B
PHP
42 lines
851 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use APP\Models\equipament_type;
|
|
use App\Models\factorie;
|
|
use App\Models\specific_Attributes_Equipament_Type;
|
|
use App\Models\installation;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Equipment extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
public $timestamps = false;
|
|
|
|
protected $table = 'equipments';
|
|
|
|
protected $primaryKey = 'equipment_id';
|
|
|
|
public function unit()
|
|
{
|
|
return $this->belongsTo(Unit::class, 'unit_id', 'unit_id');
|
|
}
|
|
|
|
public function equipmentType()
|
|
{
|
|
return $this->belongsTo(EquipmentType::class, 'equipment_type_id', 'equipment_type_id');
|
|
}
|
|
|
|
public function specificAttributes()
|
|
{
|
|
return $this->hasMany(SpecificAttributesEquipmentType::class, 'equipment_id', 'equipment_id');
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|