New-OMIS/app/Models/Country.php
2024-04-07 17:59:05 +05:45

29 lines
574 B
PHP

<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class Country extends Model
{
use HasFactory;
protected $table = 'tbl_countries';
protected $fillable = [
'country_name',
'phone_code',
'country_code',
'status',
];
public function provinces()
{
return $this->hasMany(Province::class);
}
public static function getCountries()
{
return self::select('id', 'country_name')->where('status', 'Active')->get();
}
}