本文整理汇总了PHP中Payment::scope方法的典型用法代码示例。如果您正苦于以下问题:PHP Payment::scope方法的具体用法?PHP Payment::scope怎么用?PHP Payment::scope使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Payment
的用法示例。
在下文中一共展示了Payment::scope方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: edit
public function edit($publicId)
{
$payment = Payment::scope($publicId)->firstOrFail();
$payment->payment_date = Utils::fromSqlDate($payment->payment_date);
$data = array('client' => null, 'invoice' => null, 'invoices' => Invoice::scope()->where('is_recurring', '=', false)->where('is_quote', '=', false)->with('client', 'invoice_status')->orderBy('invoice_number')->get(), 'payment' => $payment, 'method' => 'PUT', 'url' => 'payments/' . $publicId, 'title' => 'Edit Payment', 'paymentTypes' => PaymentType::remember(DEFAULT_QUERY_CACHE)->orderBy('id')->get(), 'clients' => Client::scope()->with('contacts')->orderBy('name')->get());
return View::make('payments.edit', $data);
}
示例2: bulk
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function bulk()
{
$public_id = Input::get('public_id');
$payment = Payment::scope($public_id)->first();
$payment->delete();
$message = "Pago eliminado con éxito";
Session::flash('message', $message);
return Redirect::to('pagos');
}
示例3: index
public function index()
{
if (!Utils::isPro()) {
return Redirect::to('/');
}
$payments = Payment::scope()->orderBy('created_at', 'desc')->get();
$payments = Utils::remapPublicIds($payments->toArray());
$response = json_encode($payments, JSON_PRETTY_PRINT);
$headers = Utils::getApiHeaders(count($payments));
return Response::make($response, 200, $headers);
}
示例4: export
private function export()
{
$output = fopen('php://output', 'w') or Utils::fatalError();
header('Content-Type:application/csv');
header('Content-Disposition:attachment;filename=export.csv');
$clients = Client::scope()->get();
AccountController::exportData($output, $clients->toArray());
$contacts = Contact::scope()->get();
AccountController::exportData($output, $contacts->toArray());
$invoices = Invoice::scope()->get();
AccountController::exportData($output, $invoices->toArray());
$invoiceItems = InvoiceItem::scope()->get();
AccountController::exportData($output, $invoiceItems->toArray());
$payments = Payment::scope()->get();
AccountController::exportData($output, $payments->toArray());
$credits = Credit::scope()->get();
AccountController::exportData($output, $credits->toArray());
fclose($output);
exit;
}