app/Http/Controllers/AgreementLineController.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;
    	$unit = Item::pluck('unitOfMeasurement')->toArray();
    	$itemName = Item::orderBy('name', 'asc')->pluck('name','itemID')->toArray();
    	foreach($itemName as $key => $value) {
    		$value = $value." --- ".$unit[$count] ;
    		$newArray[$key] = $value;
    		$count++;
    	}
		$latestAgreementIDAndRevision=AgreementHeader::orderBy('agreementID', 'desc')->first();
		return View::make('agreementLine.create')->with('itemName',$newArray)
												 ->with('latestAgreementIDAndRevision',$latestAgreementIDAndRevision);
    }
public function create ( ) { $ newArray = [ ] ; $ count = 0 ; $ unit = Item :: pluck ( 'unitOfMeasurement' ) -> toArray ( ) ; $ itemName = Item :: orderBy ( 'name' , 'asc' ) -> pluck ( 'name' , 'itemID' ) -> toArray ( ) ; foreach ( $ itemName as $ key => $ value ) { $ value = $ value . "  ---  " . $ unit [ $ count ] ; $ newArray [ $ key ] = $ value ; $ count ++ ; } $ latestAgreementIDAndRevision = AgreementHeader :: orderBy ( 'agreementID' , 'desc' ) -> first ( ) ; return View :: make ( 'agreementLine.create' ) -> with ( 'itemName' , $ newArray ) -> with ( 'latestAgreementIDAndRevision' , $ latestAgreementIDAndRevision ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .