File: /home/imensosw/www/ezwork/app/Models/Client.php
<?php
/**
* ClientModel class file
*
* PHP Version 7.2
*
* @category Model
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
namespace App\Models;
use DB;
use Illuminate\Database\Eloquent\Model;
/**
* ClientModel class
*
* The class manage Client related queries
*
* @category ClientModel
* @package Ez
* @author Imenso Software <admin@imensosoftware.com>
* @license http://imensosoftware/license.php GNU Public License
* @link http://imensosoftware.com/recipes
*/
class Client extends Model
{
public $table = 'clients';
public $fillable = ['name','code'];
public $timestamps = false;
/**
* getClients function gets list of clients
* and return it.
*
* @param array request
* @return \App\Models\Client
*/
public static function getClients()
{
$clientIndexs = self::select(
'clients.*',
DB::raw("CONCAT(clients.name,' [',clients.code,']') as name")
);
$clientIndexs = $clientIndexs->get();
return $clientIndexs;
}
// end getClients()
}
// end class