<?php
namespace Trash;
use Illuminate\Database\Eloquent\Model;
class Users extends Model
{
//
protected $table = 'user';
// public $timestamps = false;
public function user_camion(){
$sql = "SELECT u.id, u.user, c.id camion_id, c.placas
FROM user u
JOIN camion c ON u.id = c.user_id ";
$data = \DB::select( \DB::raw( $sql ) );
if(count($data) != null)
return $data;
return null;
}
}