[WIP] Refactor models to better lisibility and speed
This commit is contained in:
30
app/Models/Shop/PriceGeneric.php
Normal file
30
app/Models/Shop/PriceGeneric.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Znck\Eloquent\Traits\BelongsToThrough;
|
||||
|
||||
class PriceGeneric extends Model
|
||||
{
|
||||
use BelongsToThrough;
|
||||
|
||||
protected $guarded = ['id'];
|
||||
protected $table = 'shop_price_generics';
|
||||
|
||||
public function prices()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Price');
|
||||
}
|
||||
|
||||
public function values()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\PriceGenericValue');
|
||||
}
|
||||
|
||||
public function articles()
|
||||
{
|
||||
return $this->hasManyThrough('App\Models\Shop\Article','App\Models\Shop\Price');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user