classify admin
This commit is contained in:
27
app/Models/CustomFieldCategory.php
Normal file
27
app/Models/CustomFieldCategory.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
/**
|
||||
* @method static upsert(null[] $array, array $customFieldCategory)
|
||||
*/
|
||||
class CustomFieldCategory extends Model {
|
||||
use HasFactory;
|
||||
|
||||
protected $hidden = ['created_at', 'updated_at'];
|
||||
protected $fillable = [
|
||||
'category_id',
|
||||
'custom_field_id'
|
||||
];
|
||||
|
||||
public function custom_fields() {
|
||||
return $this->hasOne(CustomField::class, 'id', 'custom_field_id');
|
||||
}
|
||||
|
||||
public function category() {
|
||||
return $this->hasOne(Category::class);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user