Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

how to alias table name in laravel model

Item
    ::from( 'items as items_alias' )
    ->join( 'attachments as att', DB::raw( 'att.item_id' ), '=', DB::raw( 'items_alias.id' ) )
    ->select( DB::raw( 'items_alias.*' ) )
    ->get();
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #alias #table #laravel #model
ADD COMMENT
Topic
Name
3+9 =