i creating backend interface site made in joomla. using laravel create backend. joomla has table prefixes , tend have long table names there of around 25 characters.
my issue is, have looked around see if can alias table names (so don't have type table name time in join statement) don't seem able find method in query object.
modelname::gettable(); // happens static method.
any helper appreciated.
as answered in stackoverflow question:
how alias table in laravel eloquent queries (or using query builder)?
you can either use aliases while building query
$users = db::table('really_long_table_name t') ->select('t.id uid') ->get(); or define alias in eloquent model
protected $table = 'really_long_table_name short_name';
Comments
Post a Comment