|FinancialPlanAccount newModelQuery() * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount newQuery() * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount query() * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereChartType($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereCode($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereCreatedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereDeletedAt($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereDescription($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereId($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereOrder($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereUnitId($value) * @method static \Illuminate\Database\Eloquent\Builder|FinancialPlanAccount whereUpdatedAt($value) * @mixin \Eloquent */ class FinancialPlanAccount extends Model { use HasFactory; protected $table = 'financial_plan_accounts'; protected $guarded = [ 'id', // Add more fields that shouldn't be edited here ]; protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; // Relationships public function parent(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(self::class, 'parent_id'); } public function children(): \Illuminate\Database\Eloquent\Relations\HasMany { return $this->hasMany(self::class, 'parent_id'); } // Business Logic Methods /** Conta raiz (sem pai). */ public function isRoot(): bool { return $this->parent_id === null; } // Custom Finders // Query Scopes }