63 lines
1.8 KiB
PHP
63 lines
1.8 KiB
PHP
<?php
|
|
|
|
namespace App\Models;
|
|
|
|
use Backpack\CRUD\app\Models\Traits\CrudTrait;
|
|
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
use Backpack\CRUD\app\Models\Traits\SpatieTranslatable\HasTranslations;
|
|
|
|
class ProductApplication extends Model
|
|
{
|
|
use CrudTrait;
|
|
use HasFactory;
|
|
use HasTranslations;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| GLOBAL VARIABLES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
protected $table = 'product_applications';
|
|
// protected $primaryKey = 'id';
|
|
// public $timestamps = false;
|
|
protected $guarded = ['id'];
|
|
// protected $fillable = [];
|
|
// protected $hidden = [];
|
|
public $translatable = ['name'];
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| FUNCTIONS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| RELATIONS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
public function products()
|
|
{
|
|
return $this->belongsToMany(Product::class, 'product_product_application');
|
|
}
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| SCOPES
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| ACCESSORS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| MUTATORS
|
|
|--------------------------------------------------------------------------
|
|
*/
|
|
}
|