app/Http/Controllers/ProposalController.php
/**
	 * create new proposal
	 * @param Request $request
	 */
create new proposal
@param Request $request
create new proposal @param Request $request
public function newAdd(Request $request) {
		$proposal = new Proposal;
		$sales = Employee::find($request->sales);
		$service = Service::find($request->service);
		$source = Source::find($request->source);
		$client = Client::find($request->client);
		$proposal->code = $this->generateCode($sales, $service, $source, $client);
		$proposal->sales_id = $sales->id;  
		$proposal->service_id = $service->id;
		$proposal->source_id = $source->id;
		$proposal->client_id = $client->id;
		$proposal->date = date('Y-m-d');
		$proposal->save();
		return redirect()->route('list');
	}
public function newAdd ( Request $ request ) { $ proposal = new Proposal ; $ sales = Employee :: find ( $ request -> sales ) ; $ service = Service :: find ( $ request -> service ) ; $ source = Source :: find ( $ request -> source ) ; $ client = Client :: find ( $ request -> client ) ; $ proposal -> code = $ this -> generateCode ( $ sales , $ service , $ source , $ client ) ; $ proposal -> sales_id = $ sales -> id ; $ proposal -> service_id = $ service -> id ; $ proposal -> source_id = $ source -> id ; $ proposal -> client_id = $ client -> id ; $ proposal -> date = date ( 'Y-m-d' ) ; $ proposal -> save ( ) ; return redirect ( ) -> route ( 'list' ) ; }
create new proposal
 @param Request $request
create new proposal @param Request $request