[WIP] Setup of skeleton
This commit is contained in:
34
app/Models/Shop/Customer.php
Normal file
34
app/Models/Shop/Customer.php
Normal file
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Customer extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Invoices()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Invoice');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Orders()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Order');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function User()
|
||||
{
|
||||
return $this->belongsTo('App\User');
|
||||
}
|
||||
}
|
||||
18
app/Models/Shop/Inventory.php
Normal file
18
app/Models/Shop/Inventory.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Inventory extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function InventoryPlace()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\InventoryPlace');
|
||||
}
|
||||
}
|
||||
18
app/Models/Shop/InventoryPlace.php
Normal file
18
app/Models/Shop/InventoryPlace.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class InventoryPlace extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Inventories()
|
||||
{
|
||||
return $this->hasMany('App\Models\Inventory');
|
||||
}
|
||||
}
|
||||
26
app/Models/Shop/Invoice.php
Normal file
26
app/Models/Shop/Invoice.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Invoice extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function InvoiceItems()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\InvoiceItem');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Customer()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Customer');
|
||||
}
|
||||
}
|
||||
26
app/Models/Shop/InvoiceItem.php
Normal file
26
app/Models/Shop/InvoiceItem.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class InvoiceItem extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Product()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Invoice()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Invoice');
|
||||
}
|
||||
}
|
||||
26
app/Models/Shop/Order.php
Normal file
26
app/Models/Shop/Order.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Order extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Customer()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Customer');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Payments()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\OrderPayment');
|
||||
}
|
||||
}
|
||||
20
app/Models/Shop/OrderPayment.php
Normal file
20
app/Models/Shop/OrderPayment.php
Normal file
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class OrderPayment extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Order()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Order');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
50
app/Models/Shop/Product.php
Normal file
50
app/Models/Shop/Product.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Product extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Inventories()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Inventory');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Prices()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ProductPrice');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function ProductAttributes()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\ProductAttribute');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Categories()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\CategoryProduct');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function InvoiceItems()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\InvoiceItem');
|
||||
}
|
||||
}
|
||||
18
app/Models/Shop/ProductAttribute.php
Normal file
18
app/Models/Shop/ProductAttribute.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductAttribute extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Product()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
}
|
||||
}
|
||||
26
app/Models/Shop/ProductPrice.php
Normal file
26
app/Models/Shop/ProductPrice.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ProductPrice extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function Product()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\Product');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
||||
*/
|
||||
public function ProductAttribute()
|
||||
{
|
||||
return $this->belongsTo('App\Models\Shop\ProductAttribute');
|
||||
}
|
||||
}
|
||||
19
app/Models/Shop/Section.php
Normal file
19
app/Models/Shop/Section.php
Normal file
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models\Shop;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Section extends Model
|
||||
{
|
||||
protected $guarded = ['id'];
|
||||
|
||||
/**
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function Products()
|
||||
{
|
||||
return $this->hasMany('App\Models\Shop\Product');
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user