/**
  * @param TransactionRequest $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function store(TransactionRequest $request)
 {
     $lastTransaction = Transaction::findLatest($request->equipment_id);
     if ($lastTransaction->get()->isEmpty() || $lastTransaction->in_or_out == 'IN') {
         $transaction = new Transaction();
         $transaction->fill($request->all());
         $transaction->username = Auth::id();
         $transaction->in_or_out = 'OUT';
         $transaction->transaction_id = $this->generateTransactionId('OUT');
         $transaction->save();
         $this->generateReceiptEmail($transaction);
     }
     return redirect()->route('inventory.index');
 }
 public function store(TransactionRequest $request, CreateTransactionService $createTransactionService)
 {
     $createTransactionService->createTransaction($request->all());
     return redirect('/');
 }
 public function save(TransactionRequest $request)
 {
     $transaction = new Transaction($request->all());
     $transaction->status = true;
     $this->user->transaction()->save($transaction);
 }