mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 08:17:32 -05:00 
			
		
		
		
	Sort response in alphabetical order by key
This commit is contained in:
		
							parent
							
								
									1e1be26980
								
							
						
					
					
						commit
						3ad0a3ff9a
					
				@ -20,20 +20,21 @@ use App\Models\Company;
 | 
				
			|||||||
class CompanySettings extends BaseSettings
 | 
					class CompanySettings extends BaseSettings
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						public $start_of_week = '';
 | 
				
			||||||
 | 
						public $financial_year_start = '';
 | 
				
			||||||
 | 
						public $enable_modules = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public $timezone_id = '';
 | 
						public $timezone_id = '';
 | 
				
			||||||
	public $date_format_id = '';
 | 
						public $date_format_id = '';
 | 
				
			||||||
	public $datetime_format_id = '';
 | 
						public $datetime_format_id = '';
 | 
				
			||||||
	public $military_time = false;
 | 
						public $military_time = false;
 | 
				
			||||||
	public $start_of_week = '';
 | 
					 | 
				
			||||||
	public $financial_year_start = '';
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public $language_id = '';
 | 
						public $language_id = '';
 | 
				
			||||||
 | 
					 | 
				
			||||||
	public $precision = 2;
 | 
						public $precision = 2;
 | 
				
			||||||
	public $show_currency_symbol = true;
 | 
						public $show_currency_symbol = true;
 | 
				
			||||||
	public $show_currency_code = false;
 | 
						public $show_currency_code = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public $payment_terms; 
 | 
						public $payment_terms_id = 1; 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public $custom_label1 = '';
 | 
						public $custom_label1 = '';
 | 
				
			||||||
	public $custom_value1 = '';
 | 
						public $custom_value1 = '';
 | 
				
			||||||
@ -127,11 +128,10 @@ class CompanySettings extends BaseSettings
 | 
				
			|||||||
	public $show_item_taxes = false;
 | 
						public $show_item_taxes = false;
 | 
				
			||||||
	public $fill_products = false;
 | 
						public $fill_products = false;
 | 
				
			||||||
	public $tax_name1 = '';
 | 
						public $tax_name1 = '';
 | 
				
			||||||
	public $tax_rate1 = '';
 | 
						public $tax_rate1 = 0;
 | 
				
			||||||
	public $tax_name2 = '';
 | 
						public $tax_name2 = '';
 | 
				
			||||||
	public $tax_rate2 = '';
 | 
						public $tax_rate2 = 0;
 | 
				
			||||||
	public $enable_second_tax_rate = false;
 | 
						public $enable_second_tax_rate = false;
 | 
				
			||||||
	public $enable_modules = false;
 | 
					 | 
				
			||||||
	public $payment_type_id = '';
 | 
						public $payment_type_id = '';
 | 
				
			||||||
	public $convert_products = false;
 | 
						public $convert_products = false;
 | 
				
			||||||
	public $custom_fields = '';
 | 
						public $custom_fields = '';
 | 
				
			||||||
@ -149,9 +149,9 @@ class CompanySettings extends BaseSettings
 | 
				
			|||||||
	public $email_template_reminder1 = '';
 | 
						public $email_template_reminder1 = '';
 | 
				
			||||||
	public $email_template_reminder2 = '';
 | 
						public $email_template_reminder2 = '';
 | 
				
			||||||
	public $email_template_reminder3 = '';
 | 
						public $email_template_reminder3 = '';
 | 
				
			||||||
	public $has_custom_design1 = '';
 | 
						public $has_custom_design1 = false;
 | 
				
			||||||
	public $has_custom_design2 = '';
 | 
						public $has_custom_design2 = false;
 | 
				
			||||||
	public $has_custom_design3 = '';
 | 
						public $has_custom_design3 = false;
 | 
				
			||||||
	public $enable_portal_password = false;
 | 
						public $enable_portal_password = false;
 | 
				
			||||||
	public $show_accept_invoice_terms = false;
 | 
						public $show_accept_invoice_terms = false;
 | 
				
			||||||
	public $show_accept_quote_terms = false;
 | 
						public $show_accept_quote_terms = false;
 | 
				
			||||||
@ -159,10 +159,15 @@ class CompanySettings extends BaseSettings
 | 
				
			|||||||
	public $require_quote_signature = false;
 | 
						public $require_quote_signature = false;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	public static $casts = [
 | 
						public static $casts = [
 | 
				
			||||||
		'require_invoice_signature' => 'false',
 | 
							'has_custom_design1' => 'bool',
 | 
				
			||||||
		'require_quote_signature' => 'false',
 | 
							'has_custom_design2' => 'bool',
 | 
				
			||||||
		'show_accept_quote_terms' => 'false',
 | 
							'has_custom_design3' => 'bool',
 | 
				
			||||||
		'show_accept_invoice_terms' => 'false',
 | 
							'tax_rate1' => 'float',
 | 
				
			||||||
 | 
							'tax_rate2' => 'float',
 | 
				
			||||||
 | 
							'require_invoice_signature' => 'bool',
 | 
				
			||||||
 | 
							'require_quote_signature' => 'bool',
 | 
				
			||||||
 | 
							'show_accept_quote_terms' => 'bool',
 | 
				
			||||||
 | 
							'show_accept_invoice_terms' => 'bool',
 | 
				
			||||||
		'timezone_id' => 'string',
 | 
							'timezone_id' => 'string',
 | 
				
			||||||
		'date_format_id' => 'string',
 | 
							'date_format_id' => 'string',
 | 
				
			||||||
		'datetime_format_id' => 'string',
 | 
							'datetime_format_id' => 'string',
 | 
				
			||||||
@ -173,7 +178,7 @@ class CompanySettings extends BaseSettings
 | 
				
			|||||||
		'precision' => 'int',
 | 
							'precision' => 'int',
 | 
				
			||||||
		'show_currency_symbol' => 'bool',
 | 
							'show_currency_symbol' => 'bool',
 | 
				
			||||||
		'show_currency_code' => 'bool',
 | 
							'show_currency_code' => 'bool',
 | 
				
			||||||
		'payment_terms' => 'int', 
 | 
							'payment_terms_id' => 'string', 
 | 
				
			||||||
		'custom_label1' => 'string',
 | 
							'custom_label1' => 'string',
 | 
				
			||||||
		'custom_value1' => 'string',
 | 
							'custom_value1' => 'string',
 | 
				
			||||||
		'custom_label2' => 'string',
 | 
							'custom_label2' => 'string',
 | 
				
			||||||
 | 
				
			|||||||
@ -197,9 +197,12 @@ class BaseController extends Controller
 | 
				
			|||||||
                $response['static'] = Statics::company(auth()->user()->getCompany()->getLocale());
 | 
					                $response['static'] = Statics::company(auth()->user()->getCompany()->getLocale());
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					        ksort($response);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $response = json_encode($response, JSON_PRETTY_PRINT);
 | 
					        $response = json_encode($response, JSON_PRETTY_PRINT);
 | 
				
			||||||
        $headers = self::getApiHeaders();
 | 
					        $headers = self::getApiHeaders();
 | 
				
			||||||
 | 
					        
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        return response()->make($response, 200, $headers);
 | 
					        return response()->make($response, 200, $headers);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -71,7 +71,7 @@ class Kernel extends HttpKernel
 | 
				
			|||||||
            \App\Http\Middleware\StartupCheck::class,
 | 
					            \App\Http\Middleware\StartupCheck::class,
 | 
				
			||||||
            \App\Http\Middleware\QueryLogging::class,
 | 
					            \App\Http\Middleware\QueryLogging::class,
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        'db' => [
 | 
					        'api_db' => [
 | 
				
			||||||
            \App\Http\Middleware\SetDb::class,
 | 
					            \App\Http\Middleware\SetDb::class,
 | 
				
			||||||
        ],
 | 
					        ],
 | 
				
			||||||
        'web_db' => [
 | 
					        'web_db' => [
 | 
				
			||||||
 | 
				
			|||||||
@ -64,22 +64,22 @@ return [
 | 
				
			|||||||
        'from_name' => env('MAIL_FROM_NAME'),
 | 
					        'from_name' => env('MAIL_FROM_NAME'),
 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    'cached_tables' => [
 | 
					    'cached_tables' => [
 | 
				
			||||||
 | 
					        'banks' => 'App\Models\Bank',
 | 
				
			||||||
 | 
					        'countries' => 'App\Models\Country',
 | 
				
			||||||
        'currencies' => 'App\Models\Currency',
 | 
					        'currencies' => 'App\Models\Currency',
 | 
				
			||||||
        'sizes' => 'App\Models\Size',
 | 
					 | 
				
			||||||
        'industries' => 'App\Models\Industry',
 | 
					 | 
				
			||||||
        'timezones' => 'App\Models\Timezone',
 | 
					 | 
				
			||||||
        'date_formats' => 'App\Models\DateFormat',
 | 
					        'date_formats' => 'App\Models\DateFormat',
 | 
				
			||||||
        'datetime_formats' => 'App\Models\DatetimeFormat',
 | 
					        'datetime_formats' => 'App\Models\DatetimeFormat',
 | 
				
			||||||
 | 
					        'gateways' => 'App\Models\Gateway',
 | 
				
			||||||
 | 
					        'gateway_types' => 'App\Models\GatewayType',
 | 
				
			||||||
 | 
					        'industries' => 'App\Models\Industry',
 | 
				
			||||||
        'languages' => 'App\Models\Language',
 | 
					        'languages' => 'App\Models\Language',
 | 
				
			||||||
        'payment_types' => 'App\Models\PaymentType',
 | 
					        'payment_types' => 'App\Models\PaymentType',
 | 
				
			||||||
        'countries' => 'App\Models\Country',
 | 
					        'sizes' => 'App\Models\Size',
 | 
				
			||||||
 | 
					        'timezones' => 'App\Models\Timezone',
 | 
				
			||||||
        //'invoiceDesigns' => 'App\Models\InvoiceDesign',
 | 
					        //'invoiceDesigns' => 'App\Models\InvoiceDesign',
 | 
				
			||||||
        //'invoiceStatus' => 'App\Models\InvoiceStatus',
 | 
					        //'invoiceStatus' => 'App\Models\InvoiceStatus',
 | 
				
			||||||
        //'frequencies' => 'App\Models\Frequency',
 | 
					        //'frequencies' => 'App\Models\Frequency',
 | 
				
			||||||
        'gateways' => 'App\Models\Gateway',
 | 
					 | 
				
			||||||
        'gateway_types' => 'App\Models\GatewayType',
 | 
					 | 
				
			||||||
        //'fonts' => 'App\Models\Font',
 | 
					        //'fonts' => 'App\Models\Font',
 | 
				
			||||||
        'banks' => 'App\Models\Bank',
 | 
					 | 
				
			||||||
    ],
 | 
					    ],
 | 
				
			||||||
    'payment_terms' => [
 | 
					    'payment_terms' => [
 | 
				
			||||||
        [
 | 
					        [
 | 
				
			||||||
 | 
				
			|||||||
@ -39,7 +39,7 @@ class RandomDataSeeder extends Seeder
 | 
				
			|||||||
        $account = factory(\App\Models\Account::class)->create();
 | 
					        $account = factory(\App\Models\Account::class)->create();
 | 
				
			||||||
        $company = factory(\App\Models\Company::class)->create([
 | 
					        $company = factory(\App\Models\Company::class)->create([
 | 
				
			||||||
            'account_id' => $account->id,
 | 
					            'account_id' => $account->id,
 | 
				
			||||||
            'domain' => 'ninja.test:8000',
 | 
					            'domain' => config('ninja.site_url'),
 | 
				
			||||||
        ]);
 | 
					        ]);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        $account->default_company_id = $company->id;
 | 
					        $account->default_company_id = $company->id;
 | 
				
			||||||
 | 
				
			|||||||
@ -29,9 +29,10 @@ Route::group(['api_secret_check','domain_db'], function () {
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
  Route::post('api/v1/login', 'Auth\LoginController@apiLogin')->name('login.submit');
 | 
					  Route::post('api/v1/login', 'Auth\LoginController@apiLogin')->name('login.submit');
 | 
				
			||||||
  Route::post('api/v1/reset_password', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.reset');
 | 
					  Route::post('api/v1/reset_password', 'Auth\ForgotPasswordController@sendResetLinkEmail')->name('password.reset');
 | 
				
			||||||
 | 
					  
 | 
				
			||||||
});
 | 
					});
 | 
				
			||||||
 | 
					
 | 
				
			||||||
Route::group(['middleware' => ['db','api_secret_check','token_auth'], 'prefix' =>'api/v1', 'as' => 'api.'], function () {
 | 
					Route::group(['middleware' => ['api_db','api_secret_check','token_auth'], 'prefix' =>'api/v1', 'as' => 'api.'], function () {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  Route::resource('clients', 'ClientController'); // name = (clients. index / create / show / update / destroy / edit
 | 
					  Route::resource('clients', 'ClientController'); // name = (clients. index / create / show / update / destroy / edit
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user