mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-14 23:22:52 +01:00
request for confirmation connect
This commit is contained in:
parent
2447ef9d7d
commit
f1ac41a5c4
46
app/Http/Requests/GoCardless/OAuthConnectRequest.php
Normal file
46
app/Http/Requests/GoCardless/OAuthConnectRequest.php
Normal file
@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Invoice Ninja (https://invoiceninja.com).
|
||||
*
|
||||
* @link https://github.com/invoiceninja/invoiceninja source repository
|
||||
*
|
||||
* @copyright Copyright (c) 2024. Invoice Ninja LLC (https://invoiceninja.com)
|
||||
*
|
||||
* @license https://www.elastic.co/licensing/elastic-license
|
||||
*/
|
||||
|
||||
namespace App\Http\Requests\GoCardless;
|
||||
|
||||
use App\Libraries\MultiDB;
|
||||
use App\Models\Company;
|
||||
use Illuminate\Foundation\Http\FormRequest;
|
||||
|
||||
class OAuthConnectRequest extends FormRequest
|
||||
{
|
||||
public function authorize(): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array<string, \Illuminate\Contracts\Validation\ValidationRule|array<mixed>|string>
|
||||
*/
|
||||
public function rules(): array
|
||||
{
|
||||
return [
|
||||
//
|
||||
];
|
||||
}
|
||||
|
||||
public function getCompany(): \Illuminate\Database\Eloquent\Model|\Illuminate\Database\Eloquent\Builder|\App\Models\BaseModel
|
||||
{
|
||||
MultiDB::findAndSetDbByCompanyKey(
|
||||
$this->company_key,
|
||||
);
|
||||
|
||||
return Company::query()
|
||||
->where('company_key', $this->company_key)
|
||||
->firstOrFail();
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user