app/Http/Controllers/PurchaseRequestController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create()
    {	
    	$newArray = [];
		$count = 0;
		$virtualID = Item::pluck('virtualItemID')->toArray();  
    	$unit = Item::orderBy("virtualItemID")->pluck('unitOfMeasurement')->toArray();
    	$virtualItemID = Item::pluck('name','virtualItemID')->toArray();
    	foreach($virtualItemID as $key => $value) {
    		$value = $virtualID[$count]." : ".$value." --- ".$unit[$count] ;
    		$newArray[$key] = $value;
    		$count++;
    	}
    	$latestRequestID = PurchaseRequest::orderby('requestID','desc')->first()->requestID;
		return View::make('purchaseRequest.create')->with('latestRequestID',$latestRequestID)->with('virtualItemID',$newArray);
    }
public function create ( ) { $ newArray = [ ] ; $ count = 0 ; $ virtualID = Item :: pluck ( 'virtualItemID' ) -> toArray ( ) ; $ unit = Item :: orderBy ( " virtualItemID " ) -> pluck ( 'unitOfMeasurement' ) -> toArray ( ) ; $ virtualItemID = Item :: pluck ( 'name' , 'virtualItemID' ) -> toArray ( ) ; foreach ( $ virtualItemID as $ key => $ value ) { $ value = $ virtualID [ $ count ] . "  :  " . $ value . "  ---  " . $ unit [ $ count ] ; $ newArray [ $ key ] = $ value ; $ count ++ ; } $ latestRequestID = PurchaseRequest :: orderby ( 'requestID' , 'desc' ) -> first ( ) -> requestID ; return View :: make ( 'purchaseRequest.create' ) -> with ( 'latestRequestID' , $ latestRequestID ) -> with ( 'virtualItemID' , $ newArray ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
//orderBy("virtualItemID")->  <<deleted!