1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-22 01:11:34 +02:00
invoiceninja/app/Http/Requests/ClientPortal/Documents/ShowDocumentRequest.php
Benjamin Beganović 4e9bc0552d Rename "Downloads" to "Documents":
- Remove Livewire auto-publish from composer.json
- Replace old DocumentController with DownloadsController
- Rename DownloadsTable & downloads-table to DocumentsTable & documents-table
- New ShowDocumentRequest for displaying documents
- Change authorize() with DownloadMultipleDocumentsRequest
- Change route in PortalComposer
- Update Livewire assets
- Remove old documents routes
2020-09-28 12:04:34 +02:00

45 lines
923 B
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Requests\ClientPortal\Documents;
use App\Models\Document;
use App\Utils\Traits\MakesHash;
use Illuminate\Foundation\Http\FormRequest;
class ShowDocumentRequest extends FormRequest
{
use MakesHash;
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return auth()->user('contact')->client->id === $this->document->documentable->id;
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}