ispt4.0_laravel/app/Models/Unit.php
ygbanzato 3db065ae53 updating best practices in project models and controllers, and linking tables.
- Creation of controller : CreateProject, for creation of the company works.
- Controller : ProjectDatacontroller to manage data of the equipments and installations in general.
2023-06-03 19:01:17 +01:00

20 lines
368 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Unit extends Model
{
use HasFactory;
protected $table = 'units';
protected $primaryKey = 'unit_id';
public function equipments(){
return $this->hasMany(Equipment::class, 'unit_id', 'unit_id');
}
}