本文整理汇总了PHP中Laravel\Spark\Spark::generateInvoicesWith方法的典型用法代码示例。如果您正苦于以下问题:PHP Spark::generateInvoicesWith方法的具体用法?PHP Spark::generateInvoicesWith怎么用?PHP Spark::generateInvoicesWith使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Laravel\Spark\Spark
的用法示例。
在下文中一共展示了Spark::generateInvoicesWith方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: boot
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
if (method_exists($this, 'customizeSpark')) {
$this->customizeSpark();
}
if (method_exists($this, 'customizeRegistration')) {
$this->customizeRegistration();
}
if (method_exists($this, 'customizeRoles')) {
$this->customizeRoles();
}
if (method_exists($this, 'customizeProfileUpdates')) {
$this->customizeProfileUpdates();
}
if (method_exists($this, 'customizeSubscriptionPlans')) {
$this->customizeSubscriptionPlans();
}
if (method_exists($this, 'customizeSettingsTabs')) {
$this->customizeSettingsTabs();
}
if ($this->twoFactorAuth) {
Spark::withTwoFactorAuth();
}
Spark::generateInvoicesWith($this->invoiceWith);
}
示例2: notify
/**
* Notify the given user about a new invoice.
*
* @param \Illuminate\Contracts\Auth\Authenticatable $user
* @param \Laravel\Cashier\Invoice $invoice
* @return void
*/
public function notify(Authenticatable $user, Invoice $invoice)
{
$invoiceData = array_merge(['vendor' => 'Vendor', 'product' => 'Product', 'vat' => new ViewExpression(nl2br(e($user->extra_billing_info)))], Spark::generateInvoicesWith());
$data = compact('user', 'invoice', 'invoiceData');
Mail::send('spark::emails.billing.invoice', $data, function ($message) use($user, $invoice, $invoiceData) {
$message->to($user->email, $user->name)->subject('Your ' . $invoiceData['product'] . ' Invoice')->attachData($invoice->pdf($invoiceData), 'invoice.pdf');
});
}
示例3: downloadInvoice
/**
* Download the given invoice for the user.
*
* @param string $invoiceId
* @return \Illuminate\Http\Response
*/
public function downloadInvoice(Request $request, $invoiceId)
{
$data = array_merge(['vendor' => 'Vendor', 'product' => 'Product', 'vat' => new ViewExpression(nl2br(e($request->user()->extra_billing_info)))], Spark::generateInvoicesWith());
return Auth::user()->downloadInvoice($invoiceId, $data);
}