/**
  * Show the form for creating a new resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function create()
 {
     $account = ['' => 'Choose an Account'] + Bankncash::DefaultApartment()->lists('account', 'id')->toArray();
     $payment = ['0' => 'Select Payment Method'] + PMethod::lists('name', 'id')->toArray();
     $category = Sys_cat::where('type', '=', 'Income')->lists('name', 'id')->toArray();
     $tag = Sys_tag::where('type', '=', 'Income')->lists('text', 'id');
     $disable = null;
     return view('transfer.create', compact('account', 'payment', 'category', 'tag', 'disable'));
 }
Example #2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function edit($id)
 {
     try {
         $list = Transaction::find($id);
         $account = ['' => 'Choose an Account'] + Bankncash::DefaultApartment()->lists('account', 'id')->toArray();
         $payeeid = ['0' => 'Select Payee'] + Crm_account::lists('account', 'id')->toArray();
         $payment = ['0' => 'Select Payment Method'] + PMethod::lists('name', 'id')->toArray();
         $category = Sys_cat::where('type', '=', 'Income')->lists('name', 'id')->toArray();
         $tag = Sys_tag::where('type', '=', 'Income')->lists('text', 'id');
         $disable = 1;
     } catch (Exception $e) {
         return redirect()->back()->withMessage('Error Editing Expense, Possibly it is already Deleted')->withStatus('error');
     }
     return view('expense.edit', compact('list', 'account', 'payeeid', 'payment', 'category', 'tag', 'disable'));
 }