-
routes/signed.php
Open in GitHubuse Illuminate\Support\Facades\Route; // Route::get('payments/{payment}/print', 'Portal\Payments@printPayment')->name('signed.payments.print'); Route::get('payments/{payment}/pdf', 'Portal\Payments@pdfPayment')->name('signed.payments.pdf');
-
app/Http/Controllers/Portal/Payments.php
Open in GitHubuse App\Models\Banking\Transaction; use App\Utilities\Modules; use Illuminate\Support\Facades\URL; class Payments extends Controller { // public function signed(Transaction $payment) { if (empty($payment)) { return redirect()->route('login'); } $payment_methods = Modules::getPaymentMethods(); $print_action = URL::signedRoute('signed.payments.print', [$payment->id]); $pdf_action = URL::signedRoute('signed.payments.pdf', [$payment->id]); return view('portal.payments.signed', compact('payment', 'payment_methods', 'print_action', 'pdf_action')); } }
-
resources/views/portal/payments/signed.blade.php
Open in GitHub@extends('layouts.signed') @section('title', trans_choice('general.payments', 1) . ': ' . @date($payment->paid_at)) @section('new_button') @stack('button_print_start') <a href="{{ $print_action }}" target="_blank" class="btn btn-white btn-sm"> {{ trans('general.print') }} </a> @stack('button_print_end') @stack('button_pdf_start') <a href="{{ $pdf_action }}" class="btn btn-white btn-sm"> {{ trans('general.download') }} </a> @stack('button_pdf_end') @stack('button_dashboard_start') @if (!user()) <a href="{{ route('portal.dashboard') }}" class="btn btn-white btn-sm"> {{ trans('payments.all_payments') }} </a> @endif @stack('button_dashboard_end') @endsection //