class DownloadsController < ApplicationController
before_action :authenticate_user!, only: :create
skip_before_action :verify_authenticity_token, only: :show
def create
document = current_user.documents.find(params[:document_id])
class DownloadsController < ApplicationController
before_action :authenticate_user!
def show
report = current_account.reports.find(params[:report_id])
authorize! :download, report
<?php
namespace App\Models;
use App\Support\TransientUrl;
use Illuminate\Database\Eloquent\Model;