/** * Show the form for creating a new resource. * * @return Response */ public function create($clientPublicId = 0, $invoicePublicId = 0) { $data = ['clientPublicId' => Input::old('client') ? Input::old('client') : $clientPublicId, 'invoicePublicId' => Input::old('invoice') ? Input::old('invoice') : $invoicePublicId, 'invoices' => Invoice::scope()->where('is_recurring', '=', false)->where('is_quote', '=', false)->where('invoice_status_id', '<', '5')->where('balance', '>', 0)->with('client', 'invoice_status', 'branch')->orderBy('invoice_number')->get(), 'paymentTypes' => PaymentType::orderBy('id')->get(), 'clients' => Client::scope()->with('contacts')->orderBy('name')->get(), 'payment' => null, 'method' => 'POST', 'url' => 'pagos', 'title' => 'Nuevo pago']; return View::make('pagos.edit', $data); }