src/Repositories/Corporation/Assets.php
public function getCorporationAssetByLocation(int $corporation_id): Collection
    {

        return Locations::leftJoin('corporation_asset_lists',
            'corporation_locations.itemID', '=',
            'corporation_asset_lists.itemID')
            ->leftJoin(
                'invTypes',
                'corporation_asset_lists.typeID', '=',
                'invTypes.typeID')
            ->where('corporation_locations.corporationID', $corporation_id)
            ->get()
            ->groupBy('mapID'); // <--- :O That is so sexy <3
    }
public function getCorporationAssetByLocation(int $corporation_id): Collection
    {

        return Locations::leftJoin('corporation_asset_lists',
            'corporation_locations.itemID', '=',
            'corporation_asset_lists.itemID')
            ->leftJoin(
                'invTypes',
                'corporation_asset_lists.typeID', '=',
                'invTypes.typeID')
            ->where('corporation_locations.corporationID', $corporation_id)
            ->get()
            ->groupBy('mapID'); // <--- :O That is so sexy <3
    }
public function getCorporationAssetByLocation ( int $ corporation_id ) : Collection { return Locations :: leftJoin ( 'corporation_asset_lists' , 'corporation_locations.itemID' , '=' , 'corporation_asset_lists.itemID' ) -> leftJoin ( 'invTypes' , 'corporation_asset_lists.typeID' , '=' , 'invTypes.typeID' ) -> where ( 'corporation_locations.corporationID' , $ corporation_id ) -> get ( ) -> groupBy ( 'mapID' ) ; // <--- :O That is so sexy <3 }
Returns a corporation assets grouped by location.
Only assets in space will appear here as assets
that are in stations don't have 'locations' entries.

@param int $corporation_id

@return \Illuminate\Support\Collection
Returns a corporation assets grouped by location . Only assets in space will appear here as assets that are in stations don t have locations entries .