mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
3b0cda1502
* Fixes for tests * fixes for permissions * Set default company on account creation * Ensure default company ID is registered in session variables * Implement a generic resolver to harvest an entity from encoded value * Laravel Telescope
38 lines
661 B
PHP
38 lines
661 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests;
|
|
|
|
use App\Utils\Traits\MakesHash;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class Request extends FormRequest
|
|
{
|
|
use MakesHash;
|
|
|
|
public function entity($class, $encoded_primary_key)
|
|
{
|
|
return $class::findOrFail($this->decodePrimaryKey($encoded_primary_key));
|
|
}
|
|
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [];
|
|
}
|
|
|
|
}
|