Added item and plant models #67
@@ -3,15 +3,15 @@
|
|||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use Illuminate\Database\Eloquent\Model;
|
use Illuminate\Database\Eloquent\Model;
|
||||||
use Illuminate\Database\Eloquent\SoftDeletes;
|
|
||||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||||
|
use Illuminate\Database\Eloquent\SoftDeletes;
|
||||||
|
|
||||||
class Item extends Model
|
class Item extends Model
|
||||||
{
|
{
|
||||||
use SoftDeletes;
|
use SoftDeletes;
|
||||||
|
|
||||||
protected $fillable = [
|
protected $fillable = [
|
||||||
"plant_id",
|
'plant_id',
|
||||||
'category',
|
'category',
|
||||||
'code',
|
'code',
|
||||||
'description',
|
'description',
|
||||||
@@ -43,4 +43,9 @@ class Item extends Model
|
|||||||
{
|
{
|
||||||
return $this->hasMany(TestingPanelReading::class);
|
return $this->hasMany(TestingPanelReading::class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function itemCharacteristics()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ItemCharacteristic::class, 'item_id', 'id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -102,4 +102,9 @@ class Plant extends Model
|
|||||||
{
|
{
|
||||||
return $this->hasMany(User::class, 'plant_id', 'id');
|
return $this->hasMany(User::class, 'plant_id', 'id');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function itemCharacteristics()
|
||||||
|
{
|
||||||
|
return $this->hasMany(ItemCharacteristic::class, 'plant_id', 'id');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user