mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-24 02:14:21 -04:00
* Scaffold test case * Import.php tests: - Basic test scaffold - Test if exception is thrown when unknown resource - Company update test * Migration importer & exception classes * Company migration test - Added 3rd parameter for accepting custom resources - Wip tax_rates migration * Tax rate migration * Tax rate update - Added company_id & user_id property modifiers * Users migration * Save IDs for users importing * Add 'transformIds' method * Importing clients - An exception for resource not migration - Dependency logic - Removing id on insert * Exception for unresolved dependency * Import clients * Method for inspecting user_id * Importing invoices * Importing quotes * Fix tests & wrap with try-catch * Fix tax_rates user_id transform * Working on migration * Tests for migration * fixes for test * Tests for Import.php - Added ext-json to composer.json * Tests for Import.php - Added ext-json to composer.json * Change migration exceptions to MigrationValidatorFailed * Fixes for tests and counters * Unzipping the migration archive - Changed .gitignore to ignore all local migrations * Comparing local data with inserted * Ignore verification - wip * Fix formatting for api.php * Uploading file test (wip) * Fix typo Co-authored-by: David Bomba <turbo124@gmail.com>
31 lines
569 B
PHP
31 lines
569 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\Migration;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UploadMigrationFileRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function authorize()
|
|
{
|
|
return auth()->user()->isAdmin();
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*
|
|
* @return array
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
'migration' => ['required', 'mimes:zip'],
|
|
];
|
|
}
|
|
}
|