unioil-loyalty-app/app/CodeGender.php

44 lines
791 B
PHP
Executable File

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