File: /mnt/data/ghayatcom/ghayatcom-api/app/SubCategory.php
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Relations\BelongsTo;
class SubCategory extends Model
{
use SoftDeletes;
protected $fillable = ['id','category_id','name','created_at', 'created_by','updated_by','deleted_by'];
protected $hidden = ['created_by','updated_by','deleted_by','deleted_at','updated_at'];
public function category() : BelongsTo {
return $this->belongsTo(Category::class, 'category_id', 'id');
}
}