'boolean', 'is_active' => 'boolean', 'sort_order' => 'integer', ]; public function createdBy(): BelongsTo { return $this->belongsTo(User::class, 'created_by'); } // ─── Scopes ─────────────────────────────────────── public function scopeActive($query) { return $query->where('is_active', true); } /** * قالب‌هایی که به جهت مشخص (export/import/both) اعمال می‌شوند. */ public function scopeForDirection($query, string $direction) { return $query->where(function ($q) use ($direction) { $q->where('direction', 'both')->orWhere('direction', $direction); }); } }