Пример #1
0
 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function postContract(CreateContractRequest $request)
 {
     $input = Cookie::get('rate');
     $email = $request->input('email');
     $name = $request->input('first_name');
     $rate = Rate::find($input);
     $contract = new Contract($request->all());
     $contract->rate()->associate($rate);
     /* $contract->save(); */
     /* mail('*****@*****.**','Test','Hello,','') */
     /* email contract */
     /**    Mail::send('emails.contract', $data, function ($message)
      *    {
      *        $message->from('*****@*****.**', 'Laravel');
      *        $message->to('*****@*****.**');
      *        $message->subject($subject);
      *        $message->attach($pathToFile);
      *    });
      */
     return view('contracts.send')->with('email', $email);
 }
Пример #2
0
 /**
  * Store a newly created resource in storage.
  *
  * @param CreateContractRequest $request
  * @return Response
  */
 public function postContract(CreateContractRequest $request)
 {
     //$id = Cookie::get('rate');
     //Create contract
     $id = $request->input('id');
     $rate = Rate::find($id);
     $contract = new Contract($request->all());
     $contract->rate()->associate($rate);
     $contract->save();
     // Contract details
     $email = $request->input('email');
     //Create pdf attachement
     // Simple email
     /* mail('*****@*****.**','Test','Hello,','') */
     /*
     // Email contract
     Mail::send('emails.contract', $data, function ($message)
     {
          $message->from('*****@*****.**', 'Laravel');
          $message->to('*****@*****.**');
          $message->subject($subject);
          $message->attach($pathToFile);
     });
     */
     return view('electric.success')->with('email', $email);
 }