44 lines
800 B
PHP
44 lines
800 B
PHP
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CodeFuelType extends Model
|
|
{
|
|
|
|
/**
|
|
* Table name of model
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'code_fuel_type';
|
|
|
|
/**
|
|
* Primary key field name of table
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $primaryKey = 'fueltype_id';
|
|
|
|
/**
|
|
* Additional fields from other connected tables
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $appends = [];
|
|
|
|
/**
|
|
* The attributes that should be hidden for arrays.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $hidden = ['fueltype_id','created_at','updated_at','created_by','updated_by','is_active'];
|
|
|
|
public function scopeCode($query,$code)
|
|
{
|
|
$query->where('is_active',1);
|
|
$query->where('code',$code);
|
|
}
|
|
}
|