<?php

namespace App\Models;

use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;

class Admin extends Authenticatable
{
    use HasFactory, Notifiable;

    protected $table = "admin";

    protected $fillable = [
        'name', 'email', 'password','type'
    ];

    public static function fetchSubAdminData()
    {
        $query = Admin::where('type','sub-admin')->orderBy('id','desc');
        return $query;
    }
}
