app/Http/Controllers/AccountController.php
/**
     * Show the form for editing the specified resource.
     *
     * @param  \App\Models\Account  $account
     * @return \Illuminate\Http\Response
     */
Show the form for editing the specified resource.
Show the form for editing the specified resource .
public function edit($id)
    {
        $customer = DB::select("SELECT customers.id, CONCAT(customers.firstname,' ',customers.lastname) as name FROM `customers`");
        $account = Account::find($id);
        $accountType = AccountType::all(['id','name']);
        $currency = Currency::all(['id','name']);
        $branches = Branches::all(['id','name']);
        return view('accounts.edit',
        [
            'account' => $account,
            'customer' => $customer,
            'accountType' => $accountType,
            'currency' => $currency,
            'branches' => $branches,
        ]);
    }
public function edit ( $ id ) { $ customer = DB :: select ( " SELECT customers.id, CONCAT(customers.firstname,' ',customers.lastname) as name FROM `customers` " ) ; $ account = Account :: find ( $ id ) ; $ accountType = AccountType :: all ( [ 'id' , 'name' ] ) ; $ currency = Currency :: all ( [ 'id' , 'name' ] ) ; $ branches = Branches :: all ( [ 'id' , 'name' ] ) ; return view ( 'accounts.edit' , [ 'account' => $ account , 'customer' => $ customer , 'accountType' => $ accountType , 'currency' => $ currency , 'branches' => $ branches , ] ) ; }
Show the form for editing the specified resource.
Show the form for editing the specified resource .