parsaaghayi-backend/app/Models/Website/Project.php
2024-11-03 16:01:47 +03:30

25 lines
557 B
PHP

<?php
namespace App\Models\Website;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Project extends Model
{
use HasFactory;
protected $table = 'website_projects'; // نام صحیح جدول
protected $fillable = ['category_id', 'image1', 'image2'];
public function translations()
{
return $this->hasMany(ProjectTranslation::class, 'project_id');
}
public function category()
{
return $this->belongsTo(ProjectCategory::class, 'category_id');
}
}