<?php

namespace App\Models;

use Dcat\Admin\Traits\HasDateTimeFormatter;

use Dcat\Admin\Traits\ModelTree;
use Illuminate\Database\Eloquent\Model;

class SiteAlbumFolder extends Model
{
	use HasDateTimeFormatter;
    protected $table = 'site_album_folder';

    use HasDateTimeFormatter,
        ModelTree {
        ModelTree::boot as treeBoot;
    }

    public function allNodes()
    {
        $result =  $this->callQueryCallbacks(new static())
            ->where('enabled',1)
            ->orderBy($this->getOrderColumn(), 'desc')
            ->get();

        return $result;
    }

}
