43 lines
788 B
PHP
Executable File
43 lines
788 B
PHP
Executable File
<?php
|
|
|
|
namespace App;
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
class CodeVehicleOwn extends Model
|
|
{
|
|
/**
|
|
* Table name of model
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $table = 'code_vehicle_own';
|
|
|
|
/**
|
|
* Primary key field name of table
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $primaryKey = 'vo_id';
|
|
|
|
/**
|
|
* Additional fields from other connected tables
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $appends = [];
|
|
|
|
/**
|
|
* The attributes that should be hidden for arrays.
|
|
*
|
|
* @var array
|
|
*/
|
|
protected $hidden = ['vo_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);
|
|
}
|
|
}
|