how to alias table name in laravel model

Solutions on MaxInterview for how to alias table name in laravel model by the best coders in the world

showing results for - "how to alias table name in laravel model"
Stanislas
03 Jun 2020
1Item
2    ::from( 'items as items_alias' )
3    ->join( 'attachments as att', DB::raw( 'att.item_id' ), '=', DB::raw( 'items_alias.id' ) )
4    ->select( DB::raw( 'items_alias.*' ) )
5    ->get();