初始化项目
This commit is contained in:
23
app/Models/ProductModel.php
Normal file
23
app/Models/ProductModel.php
Normal file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\BaseApp\BaseModel;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
|
||||
class ProductModel extends BaseModel
|
||||
{
|
||||
|
||||
protected $table = 'product';
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var list<string>
|
||||
*/
|
||||
protected $guarded = [];
|
||||
|
||||
public function images(): HasMany
|
||||
{
|
||||
return $this->hasMany(ProductImageModel::class, 'product_id', 'id');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user