Answers for "how to alias table name in laravel model"

PHP
1

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();
Posted by: Guest on August-24-2021

Code answers related to "how to alias table name in laravel model"

Browse Popular Code Answers by Language