1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Update client.statement route

This commit is contained in:
Benjamin Beganović 2021-08-24 13:18:32 +02:00
parent 792eb003e3
commit c6bc102c6d
3 changed files with 35 additions and 2 deletions

View File

@ -11,6 +11,8 @@
namespace App\Http\Controllers;
use App\Http\Requests\Statements\CreateStatementRequest;
class ClientStatementController extends BaseController
{
public function __construct()
@ -18,7 +20,7 @@ class ClientStatementController extends BaseController
parent::__construct();
}
public function statement()
public function statement(CreateStatementRequest $request)
{
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests\Statements;
use Illuminate\Foundation\Http\FormRequest;
class CreateStatementRequest extends FormRequest
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return auth()->user()->isAdmin();
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'start_date' => ['required'],
'end_date' => ['required'],
];
}
}

View File

@ -43,7 +43,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::post('connected_account', 'ConnectedAccountController@index');
Route::post('connected_account/gmail', 'ConnectedAccountController@handleGmailOauth');
Route::resource('client_statement', 'ClientStatementController@statement'); // name = (client_statement. index / create / show / update / destroy / edit
Route::post('client_statement', 'ClientStatementController@statement')->name('client.statement');
Route::post('companies/purge/{company}', 'MigrationController@purgeCompany')->middleware('password_protected');
Route::post('companies/purge_save_settings/{company}', 'MigrationController@purgeCompanySaveSettings')->middleware('password_protected');