app/Api/V1/Controllers/WarehouseController.php
/**
     * Display a numbered list of the latest warehouses.
     *
     * @return Response
     *
     * @SWG\Get(
     *   path="/warehouses/latest/{amount}",
     *   tags={"Warehouses"},
     *   summary="Get a number of latest warehouses",
     *   description="",
     *   produces={"application/json"},
     *   security={
     *         {
     *             "Bearer": {}
     *         }
     *     },
     *   @SWG\Response(response=200, description="successful operation",
     *     @SWG\Property(
     *          property="data", type="array", description="Data",
     *          @SWG\Items(
     *              @SWG\Schema(ref="#/definitions/Warehouse")
     *          )
     *     ),
     *   ),
     * )
     */
Display a numbered list of the latest warehouses.
@return Response


Display a numbered list of the latest warehouses . @return Response
public function latest($amount = 5) {
        $warehouse = Warehouse::owned()
            ->with('vendor')
            ->with('address.city', 'address.state')
            ->latest()
            ->take($amount)
            ->get();
        return $warehouse;
    }
public function latest ( $ amount = 5 ) { $ warehouse = Warehouse :: owned ( ) -> with ( 'vendor' ) -> with ( 'address.city' , 'address.state' ) -> latest ( ) -> take ( $ amount ) -> get ( ) ; return $ warehouse ; }
Display a numbered list of the latest warehouses.
Display a numbered list of the latest warehouses .
//->orderBy("created_by", "desc")