working on omis setup
This commit is contained in:
28
app/Models/Country.php
Normal file
28
app/Models/Country.php
Normal file
@ -0,0 +1,28 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user