- Creation of controller : CreateProject, for creation of the company works. - Controller : ProjectDatacontroller to manage data of the equipments and installations in general.
30 lines
615 B
PHP
30 lines
615 B
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class Plant extends Model
|
|
{
|
|
use HasFactory;
|
|
|
|
protected $table = 'plants';
|
|
|
|
protected $primaryKey = 'plant_id';
|
|
|
|
public $timestamps = false;
|
|
|
|
public function user(){
|
|
return $this->belongsTo(User::class, 'user_id', 'user_id');
|
|
}
|
|
|
|
public function companyProjects(){
|
|
return $this->hasMany(CompanyProject::class, 'plant_id', 'plant_id');
|
|
}
|
|
|
|
public function units(){
|
|
return $this->hasMany(Unit::class, 'plant_id', 'plant_id');
|
|
}
|
|
}
|