1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 21:22:58 +01:00
invoiceninja/app/Http/Requests/Request.php
David Bomba 3b0cda1502
Set default company on account creation (#2487)
* 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
2018-11-03 12:01:40 +11:00

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 [];
}
}