From 302c98e08bc7d08dabc036768e900f5ac8681f07 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 1 Jul 2020 21:33:42 +1000 Subject: [PATCH 01/11] Fixes for demo data --- app/Console/Commands/DemoMode.php | 14 +++++++++----- app/Http/Controllers/PreviewController.php | 4 ++-- app/Jobs/Util/Import.php | 4 ++-- app/Models/RecurringInvoice.php | 9 ++++++--- routes/api.php | 2 +- 5 files changed, 20 insertions(+), 13 deletions(-) diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index 202a5073ca30..918228914572 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -82,7 +82,7 @@ class DemoMode extends Command private function createSmallAccount() { - $this->count = 10; + $this->count = 100; $this->info('Creating Small Account and Company'); @@ -236,7 +236,7 @@ class DemoMode extends Command $client->id_number = $this->getNextClientNumber($client); $settings = $client->settings; - $settings->currency_id = (string)rand(1,79); + $settings->currency_id = (string)rand(1,3); $client->settings = $settings; $country = Country::all()->random(); @@ -326,8 +326,8 @@ class DemoMode extends Command $invoice->tax_rate3 = 5; } - $invoice->custom_value1 = $faker->date; - $invoice->custom_value2 = rand(0, 1) ? 'yes' : 'no'; + // $invoice->custom_value1 = $faker->date; + // $invoice->custom_value2 = rand(0, 1) ? 'yes' : 'no'; $invoice->save(); @@ -361,7 +361,11 @@ class DemoMode extends Command $credit = factory(\App\Models\Credit::class)->create(['user_id' => $client->user->id, 'company_id' => $client->company->id, 'client_id' => $client->id]); - $dateable = Carbon::now()->subDays(rand(0, 90)); + if((bool)rand(0,1)) + $dateable = Carbon::now()->subDays(rand(0, 90)); + else + $dateable = Carbon::now()->addDays(rand(0, 90)); + $credit->date = $dateable; $credit->line_items = $this->buildLineItems(rand(1, 10)); diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 555fc7e6a2f0..c800d3a02f84 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -89,8 +89,8 @@ class PreviewController extends BaseController { if (request()->has('entity') && request()->has('entity_id') && - strlen(request()->input('entity')) > 1 && - strlen(request()->input('entity_id')) > 1 && + !empty(request()->input('entity')) && + !empty(request()->input('entity_id')) && request()->has('body')) { $design_object = json_decode(json_encode(request()->input('design'))); diff --git a/app/Jobs/Util/Import.php b/app/Jobs/Util/Import.php index 3986ea1497e9..a0cb64afc84a 100644 --- a/app/Jobs/Util/Import.php +++ b/app/Jobs/Util/Import.php @@ -483,8 +483,8 @@ class Import implements ShouldQueue throw new ResourceDependencyMissing('Processing invoices failed, because of missing dependency - clients.'); } - $modified['client_id'] = $this->transformId('clients', $resource['client_id']); - $modified['user_id'] = $this->processUserId($resource); + $modified['client_id'] = $this->transformId('clients', $resource['client_id']); + $modified['user_id'] = $this->processUserId($resource); $modified['company_id'] = $this->company->id; $modified['line_items'] = $this->cleanItems($modified['line_items']); diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 89d89724d42d..ff816bfd1c19 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -286,12 +286,15 @@ class RecurringInvoice extends BaseModel case RecurringInvoice::FREQUENCY_TWO_YEARS: return ctrans('texts.freq_two_years'); break; - case RecurringInvoice::RECURS_INDEFINITELY: - return ctrans('texts.freq_indefinitely'); - break; default: # code... break; } } + + public function recurringDates() + { + //send back a list of the next send dates and due dates + } + } diff --git a/routes/api.php b/routes/api.php index 8c5cb8695ea9..e61a9ddad0e6 100644 --- a/routes/api.php +++ b/routes/api.php @@ -103,7 +103,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a Route::resource('companies', 'CompanyController');// name = (companies. index / create / show / update / destroy / edit - Route::resource('tokens', 'TokenController');// name = (tokens. index / create / show / update / destroy / edit + Route::resource('tokens', 'TokenController')->middleware('password_protected');// name = (tokens. index / create / show / update / destroy / edit Route::resource('company_gateways', 'CompanyGatewayController'); From 7a02938bd91fa2ca4c331bf019a3063aeae68d57 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 10:26:43 +1000 Subject: [PATCH 02/11] Route to check status of scheduler --- app/Http/Controllers/SchedulerController.php | 16 ++++++++++++++++ routes/api.php | 1 + 2 files changed, 17 insertions(+) create mode 100644 app/Http/Controllers/SchedulerController.php diff --git a/app/Http/Controllers/SchedulerController.php b/app/Http/Controllers/SchedulerController.php new file mode 100644 index 000000000000..0470913e9c7f --- /dev/null +++ b/app/Http/Controllers/SchedulerController.php @@ -0,0 +1,16 @@ +user()->company()->account->latest_version == '0.0.0') + return response()->json(['message' => 'Scheduler has never run'], 400); + else + return response()->json(['message' => 'Scheduler has run'], 200); + } +} diff --git a/routes/api.php b/routes/api.php index e61a9ddad0e6..aa8aa2294d3f 100644 --- a/routes/api.php +++ b/routes/api.php @@ -154,6 +154,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a Route::get('settings', 'SettingsController@index')->name('user.settings'); */ + Route::get('scheduler', 'SchedulerController@index'); Route::post('support/messages/send', 'Support\Messages\SendingController'); }); From 384fcd67b2e87e1f7941eb928fe86d1601bca6c5 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 10:36:04 +1000 Subject: [PATCH 03/11] Fixes for test data --- app/Console/Commands/DemoMode.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index 918228914572..cafec284f086 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -90,6 +90,7 @@ class DemoMode extends Command $company = factory(\App\Models\Company::class)->create([ 'account_id' => $account->id, 'slack_webhook_url' => config('ninja.notification.slack'), + 'enabled_modules' => 4095, ]); @@ -154,7 +155,6 @@ class DemoMode extends Command ]); } - factory(\App\Models\Product::class, 50)->create([ 'user_id' => $user->id, 'company_id' => $company->id, @@ -166,7 +166,10 @@ class DemoMode extends Command $z = $x+1; $this->info("Creating client # ".$z); - $this->createClient($company, $user); + if(rand(0,1)) + $this->createClient($company, $user); + else + $this->createClient($company, $u2); } for($x=0; $x<$this->count; $x++) From bd02554dd7dccf2094f5a87224fd21cfc8e61212 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 12:12:42 +1000 Subject: [PATCH 04/11] Fixes for tesytS --- tests/Feature/CompanyTokenApiTest.php | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) diff --git a/tests/Feature/CompanyTokenApiTest.php b/tests/Feature/CompanyTokenApiTest.php index e63fdc4c9a2c..b2ce142b1239 100644 --- a/tests/Feature/CompanyTokenApiTest.php +++ b/tests/Feature/CompanyTokenApiTest.php @@ -3,9 +3,10 @@ namespace Tests\Feature; use App\DataMapper\DefaultSettings; +use App\Http\Middleware\PasswordProtection; use App\Models\Account; -use App\Models\CompanyToken; use App\Models\Company; +use App\Models\CompanyToken; use App\Models\User; use App\Utils\Traits\MakesHash; use Faker\Factory; @@ -14,11 +15,11 @@ use Illuminate\Foundation\Testing\DatabaseTransactions; use Illuminate\Foundation\Testing\RefreshDatabase; use Illuminate\Foundation\Testing\WithFaker; use Illuminate\Http\Request; +use Illuminate\Routing\Middleware\ThrottleRequests; use Illuminate\Support\Facades\Log; use Illuminate\Support\Facades\Session; use Tests\MockAccountData; use Tests\TestCase; -use Illuminate\Routing\Middleware\ThrottleRequests; /** * @test @@ -43,15 +44,18 @@ class CompanyTokenApiTest extends TestCase Model::reguard(); $this->withoutMiddleware( - ThrottleRequests::class + ThrottleRequests::class, ); } public function testCompanyTokenList() { + $this->withoutMiddleware(PasswordProtection::class); + $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), - 'X-API-TOKEN' => $this->token + 'X-API-TOKEN' => $this->token, + 'X-API-PASSWORD' => 'ALongAndBriliantPassword', ])->get('/api/v1/tokens'); @@ -60,12 +64,15 @@ class CompanyTokenApiTest extends TestCase public function testCompanyTokenPost() { + $this->withoutMiddleware(PasswordProtection::class); + $data = [ 'name' => $this->faker->firstName, ]; $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-PASSWORD' => 'ALongAndBriliantPassword', 'X-API-TOKEN' => $this->token ])->post('/api/v1/tokens', $data); @@ -75,6 +82,8 @@ class CompanyTokenApiTest extends TestCase public function testCompanyTokenPut() { + $this->withoutMiddleware(PasswordProtection::class); + $company_token = CompanyToken::whereCompanyId($this->company->id)->first(); $data = [ @@ -84,6 +93,7 @@ class CompanyTokenApiTest extends TestCase $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-PASSWORD' => 'ALongAndBriliantPassword', 'X-API-TOKEN' => $this->token ])->put('/api/v1/tokens/'.$this->encodePrimaryKey($company_token->id), $data); @@ -96,11 +106,14 @@ class CompanyTokenApiTest extends TestCase public function testCompanyTokenGet() { + $this->withoutMiddleware(PasswordProtection::class); + $company_token = CompanyToken::whereCompanyId($this->company->id)->first(); $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-PASSWORD' => 'ALongAndBriliantPassword', 'X-API-TOKEN' => $this->token ])->get('/api/v1/tokens/'.$this->encodePrimaryKey($company_token->id)); @@ -110,10 +123,13 @@ class CompanyTokenApiTest extends TestCase public function testCompanyTokenNotArchived() { + $this->withoutMiddleware(PasswordProtection::class); + $company_token = CompanyToken::whereCompanyId($this->company->id)->first(); $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-PASSWORD' => 'ALongAndBriliantPassword', 'X-API-TOKEN' => $this->token ])->get('/api/v1/tokens/'.$this->encodePrimaryKey($company_token->id)); From bba660fe065988e5fd897932aa908da67cc47d8a Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 14:23:30 +1000 Subject: [PATCH 05/11] Working on check data script --- app/Console/Commands/CheckData.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index 2c420616667d..e7f84fabba25 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -81,6 +81,7 @@ class CheckData extends Command } $this->checkInvoiceBalances(); + $this->checkInvoicePayments(); $this->checkClientBalances(); $this->checkContacts(); $this->checkCompanyData(); @@ -314,7 +315,34 @@ class CheckData extends Command $this->logMessage("{$wrong_balances} clients with incorrect balances"); + } + private function checkInvoicePayments() + { + $wrong_balances = 0; + + Client::cursor()->each(function ($client) use($wrong_balances){ + + $client->invoices->where('is_deleted', false)->each(function ($invoice) use($wrong_balances){ + + $total_amount = $invoice->payments->sum('pivot.amount'); + $total_refund = $invoice->payments->sum('pivot.refunded'); + $total_paid = $total_amount - $total_refund; + + if($total_paid != ($invoice->amount - $invoice->balance)) { + $wrong_balances++; + + $this->logMessage($client->present()->name . " - " . $client->id . " - balances do not match Invoice Amount = {$invoice->amount} - Invoice Balance = {$invoice->balance} Total paid = {$total_paid}"); + + $this->isValid = false; + + } + + }); + + }); + + $this->logMessage("{$wrong_balances} clients with incorrect invoice balances"); } private function checkClientBalances() From b37c4754143476fe1d0165f127f9dbc8cd9f29d8 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 15:25:34 +1000 Subject: [PATCH 06/11] working on checkdata script --- app/Console/Commands/CheckData.php | 40 ++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/app/Console/Commands/CheckData.php b/app/Console/Commands/CheckData.php index e7f84fabba25..42f657fb415f 100644 --- a/app/Console/Commands/CheckData.php +++ b/app/Console/Commands/CheckData.php @@ -82,6 +82,7 @@ class CheckData extends Command $this->checkInvoiceBalances(); $this->checkInvoicePayments(); + $this->checkPaidToDates(); $this->checkClientBalances(); $this->checkContacts(); $this->checkCompanyData(); @@ -317,9 +318,48 @@ class CheckData extends Command } + private function checkPaidToDates() + { + + $wrong_paid_to_dates = 0; + + Client::withTrashed()->cursor()->each(function ($client) use($wrong_paid_to_dates){ + + $total_invoice_payments = 0; + + $client->invoices->where('is_deleted', false)->each(function ($invoice) use($total_invoice_payments, $wrong_paid_to_dates){ + + $total_amount = $invoice->payments->sum('pivot.amount'); + $total_refund = $invoice->payments->sum('pivot.refunded'); + + info("Pivot = " . $total_amount . " - " . $total_refund); + + $total_invoice_payments += ($total_amount - $total_refund); + + info($total_invoice_payments); + }); + + info($total_invoice_payments . " = ". $client->paid_to_date); + + if($total_invoice_payments != $client->paid_to_date) { + $wrong_paid_to_dates++; + + $this->logMessage($client->present()->name . " - " . $client->id . " - Paid to date does not match Client Paid To Date = {$client->paid_to_date} - Invoice Payments = {$total_invoice_payments}"); + + $this->isValid = false; + + } + + }); + + $this->logMessage("{$wrong_paid_to_dates} clients with incorrect paid to dates"); + + } + private function checkInvoicePayments() { $wrong_balances = 0; + $wrong_paid_to_dates = 0; Client::cursor()->each(function ($client) use($wrong_balances){ From d3775fd05996f63dc379bca57885ce59b9f4067f Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 20:14:19 +1000 Subject: [PATCH 07/11] Change PING route response --- app/Http/Controllers/PingController.php | 2 +- app/Models/RecurringInvoice.php | 2 +- app/Repositories/ClientContactRepository.php | 3 +- app/Transformers/InvoiceTransformer.php | 21 +- composer.json | 3 +- composer.lock | 432 +++++++++---------- routes/api.php | 4 +- 7 files changed, 219 insertions(+), 248 deletions(-) diff --git a/app/Http/Controllers/PingController.php b/app/Http/Controllers/PingController.php index c0b8b13f10ba..3257303bcdc4 100644 --- a/app/Http/Controllers/PingController.php +++ b/app/Http/Controllers/PingController.php @@ -23,6 +23,6 @@ class PingController extends BaseController */ public function index() { - return response()->json('success', 200); + return response()->json(['company_name' => auth()->user()->getCompany()->present()->name()], 200); } } diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index ff816bfd1c19..2a6c20621f22 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -294,7 +294,7 @@ class RecurringInvoice extends BaseModel public function recurringDates() { - //send back a list of the next send dates and due dates + //todo send back a list of the next send dates and due dates } } diff --git a/app/Repositories/ClientContactRepository.php b/app/Repositories/ClientContactRepository.php index 443f8cef56b8..0ef048db9468 100644 --- a/app/Repositories/ClientContactRepository.php +++ b/app/Repositories/ClientContactRepository.php @@ -73,13 +73,12 @@ class ClientContactRepository extends BaseRepository //always made sure we have one blank contact to maintain state if ($client->contacts->count() == 0) { - info("no contacts found"); - $new_contact = ClientContactFactory::create($client->company_id, $client->user_id); $new_contact->client_id = $client->id; $new_contact->contact_key = Str::random(40); $new_contact->is_primary = true; $new_contact->save(); + } } diff --git a/app/Transformers/InvoiceTransformer.php b/app/Transformers/InvoiceTransformer.php index e3c49eb70530..cd740cf44e2e 100644 --- a/app/Transformers/InvoiceTransformer.php +++ b/app/Transformers/InvoiceTransformer.php @@ -12,9 +12,11 @@ namespace App\Transformers; use App\Models\Backup; +use App\Models\Client; use App\Models\Document; use App\Models\Invoice; use App\Models\InvoiceInvitation; +use App\Transformers\ClientTransformer; use App\Transformers\DocumentTransformer; use App\Transformers\InvoiceHistoryTransformer; use App\Transformers\InvoiceInvitationTransformer; @@ -30,10 +32,10 @@ class InvoiceTransformer extends EntityTransformer ]; protected $availableIncludes = [ - 'invitations', - 'history' + // 'invitations', + 'history', // 'payments', - // 'client', + 'client', // 'documents', ]; @@ -51,6 +53,13 @@ class InvoiceTransformer extends EntityTransformer return $this->includeCollection($invoice->history, $transformer, Backup::class); } + public function includeClient(Invoice $invoice) + { + $transformer = new ClientTransformer($this->serializer); + + return $this->includeItem($invoice->client, $transformer, Client::class); + } + /* public function includePayments(Invoice $invoice) { @@ -59,12 +68,6 @@ class InvoiceTransformer extends EntityTransformer return $this->includeCollection($invoice->payments, $transformer, ENTITY_PAYMENT); } - public function includeClient(Invoice $invoice) - { - $transformer = new ClientTransformer($this->account, $this->serializer); - - return $this->includeItem($invoice->client, $transformer, ENTITY_CLIENT); - } public function includeExpenses(Invoice $invoice) { diff --git a/composer.json b/composer.json index 477d9edf7bd1..aa719713617a 100644 --- a/composer.json +++ b/composer.json @@ -55,8 +55,7 @@ "staudenmeir/eloquent-has-many-deep": "^1.11", "stripe/stripe-php": "^7.0", "turbo124/beacon": "^1", - "webpatser/laravel-countries": "dev-master#75992ad", - "yajra/laravel-datatables-oracle": "~9.0" + "webpatser/laravel-countries": "dev-master#75992ad" }, "require-dev": { "laravelcollective/html": "^6", diff --git a/composer.lock b/composer.lock index 9fe25b97549d..7e9a486b41a0 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5197c11f0679bd4daff4669e74c36f9d", + "content-hash": "b5bc7e52c66bdc139b03788a007dfbb5", "packages": [ { "name": "asgrim/ofxparser", @@ -107,16 +107,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.142.4", + "version": "3.144.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "1d55df0b6490f6a9d6ebfd3a73d297d299ff8802" + "reference": "0a0b9e4d485fe0cd53db2a4075eba9a416d8331c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/1d55df0b6490f6a9d6ebfd3a73d297d299ff8802", - "reference": "1d55df0b6490f6a9d6ebfd3a73d297d299ff8802", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/0a0b9e4d485fe0cd53db2a4075eba9a416d8331c", + "reference": "0a0b9e4d485fe0cd53db2a4075eba9a416d8331c", "shasum": "" }, "require": { @@ -188,7 +188,7 @@ "s3", "sdk" ], - "time": "2020-06-17T18:18:58+00:00" + "time": "2020-07-01T18:18:54+00:00" }, { "name": "checkout/checkout-sdk-php", @@ -420,16 +420,16 @@ }, { "name": "composer/composer", - "version": "1.10.7", + "version": "1.10.8", "source": { "type": "git", "url": "https://github.com/composer/composer.git", - "reference": "956608ea4f7de9e58c53dfb019d85ae62b193c39" + "reference": "56e0e094478f30935e9128552188355fa9712291" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/composer/zipball/956608ea4f7de9e58c53dfb019d85ae62b193c39", - "reference": "956608ea4f7de9e58c53dfb019d85ae62b193c39", + "url": "https://api.github.com/repos/composer/composer/zipball/56e0e094478f30935e9128552188355fa9712291", + "reference": "56e0e094478f30935e9128552188355fa9712291", "shasum": "" }, "require": { @@ -448,12 +448,11 @@ "symfony/process": "^2.7 || ^3.0 || ^4.0 || ^5.0" }, "conflict": { - "symfony/console": "2.8.38", - "symfony/phpunit-bridge": "3.4.40" + "symfony/console": "2.8.38" }, "require-dev": { "phpspec/prophecy": "^1.10", - "symfony/phpunit-bridge": "^3.4" + "symfony/phpunit-bridge": "^4.2" }, "suggest": { "ext-openssl": "Enabling the openssl extension allows you to access https URLs for repositories and packages", @@ -511,20 +510,20 @@ "type": "tidelift" } ], - "time": "2020-06-03T08:03:56+00:00" + "time": "2020-06-24T19:23:30+00:00" }, { "name": "composer/package-versions-deprecated", - "version": "1.8.0", + "version": "1.8.1", "source": { "type": "git", "url": "https://github.com/composer/package-versions-deprecated.git", - "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47" + "reference": "b9805885293f3957ee0dd42616ac6915c4ac9a4b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", - "reference": "98df7f1b293c0550bd5b1ce6b60b59bdda23aa47", + "url": "https://api.github.com/repos/composer/package-versions-deprecated/zipball/b9805885293f3957ee0dd42616ac6915c4ac9a4b", + "reference": "b9805885293f3957ee0dd42616ac6915c4ac9a4b", "shasum": "" }, "require": { @@ -532,7 +531,7 @@ "php": "^7" }, "replace": { - "ocramius/package-versions": "1.2 - 1.8.99" + "ocramius/package-versions": "1.8.99" }, "require-dev": { "composer/composer": "^1.9.3 || ^2.0@dev", @@ -571,12 +570,16 @@ "url": "https://packagist.com", "type": "custom" }, + { + "url": "https://github.com/composer", + "type": "github" + }, { "url": "https://tidelift.com/funding/github/packagist/composer/composer", "type": "tidelift" } ], - "time": "2020-04-23T11:49:37+00:00" + "time": "2020-06-19T07:59:31+00:00" }, { "name": "composer/semver", @@ -759,16 +762,16 @@ }, { "name": "czproject/git-php", - "version": "v3.17.1", + "version": "v3.18.0", "source": { "type": "git", "url": "https://github.com/czproject/git-php.git", - "reference": "b5e709f0e9c4e4e39b49d4e322f7fa73c1bb21dc" + "reference": "ed442216a2f981f894ac6ddb1a2091a826f809e6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/czproject/git-php/zipball/b5e709f0e9c4e4e39b49d4e322f7fa73c1bb21dc", - "reference": "b5e709f0e9c4e4e39b49d4e322f7fa73c1bb21dc", + "url": "https://api.github.com/repos/czproject/git-php/zipball/ed442216a2f981f894ac6ddb1a2091a826f809e6", + "reference": "ed442216a2f981f894ac6ddb1a2091a826f809e6", "shasum": "" }, "require": { @@ -797,7 +800,7 @@ "keywords": [ "git" ], - "time": "2019-12-03T02:28:45+00:00" + "time": "2020-06-30T14:58:07+00:00" }, { "name": "dacastro4/laravel-gmail", @@ -1500,16 +1503,16 @@ }, { "name": "fideloper/proxy", - "version": "4.3.0", + "version": "4.4.0", "source": { "type": "git", "url": "https://github.com/fideloper/TrustedProxy.git", - "reference": "ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a" + "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a", - "reference": "ec38ad69ee378a1eec04fb0e417a97cfaf7ed11a", + "url": "https://api.github.com/repos/fideloper/TrustedProxy/zipball/9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", + "reference": "9beebf48a1c344ed67c1d36bb1b8709db7c3c1a8", "shasum": "" }, "require": { @@ -1550,7 +1553,7 @@ "proxy", "trusted proxy" ], - "time": "2020-02-22T01:51:47+00:00" + "time": "2020-06-23T01:36:47+00:00" }, { "name": "firebase/php-jwt", @@ -2269,16 +2272,16 @@ }, { "name": "jean85/pretty-package-versions", - "version": "1.3.0", + "version": "1.5.0", "source": { "type": "git", "url": "https://github.com/Jean85/pretty-package-versions.git", - "reference": "e3517fb11b67e798239354fe8213927d012ad8f9" + "reference": "e9f4324e88b8664be386d90cf60fbc202e1f7fc9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/e3517fb11b67e798239354fe8213927d012ad8f9", - "reference": "e3517fb11b67e798239354fe8213927d012ad8f9", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/e9f4324e88b8664be386d90cf60fbc202e1f7fc9", + "reference": "e9f4324e88b8664be386d90cf60fbc202e1f7fc9", "shasum": "" }, "require": { @@ -2316,7 +2319,7 @@ "release", "versions" ], - "time": "2020-04-24T14:19:45+00:00" + "time": "2020-06-23T06:23:06+00:00" }, { "name": "justinrainbow/json-schema", @@ -2432,16 +2435,16 @@ }, { "name": "laravel/framework", - "version": "v6.18.20", + "version": "v6.18.23", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "2862a9857533853bb2851bac39d65e3bfb8ba6cd" + "reference": "c914a3ec0706c6973a39183f8bc45f3d9a099d90" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/2862a9857533853bb2851bac39d65e3bfb8ba6cd", - "reference": "2862a9857533853bb2851bac39d65e3bfb8ba6cd", + "url": "https://api.github.com/repos/laravel/framework/zipball/c914a3ec0706c6973a39183f8bc45f3d9a099d90", + "reference": "c914a3ec0706c6973a39183f8bc45f3d9a099d90", "shasum": "" }, "require": { @@ -2576,24 +2579,24 @@ "framework", "laravel" ], - "time": "2020-06-16T13:21:33+00:00" + "time": "2020-06-30T13:52:04+00:00" }, { "name": "laravel/slack-notification-channel", - "version": "v2.0.2", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/laravel/slack-notification-channel.git", - "reference": "ecc90a70791195d6f5e20b2732a5eb1eb9619d10" + "reference": "d0a7f53342a5daa74e43e1b08dc8a7e83db152d8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/ecc90a70791195d6f5e20b2732a5eb1eb9619d10", - "reference": "ecc90a70791195d6f5e20b2732a5eb1eb9619d10", + "url": "https://api.github.com/repos/laravel/slack-notification-channel/zipball/d0a7f53342a5daa74e43e1b08dc8a7e83db152d8", + "reference": "d0a7f53342a5daa74e43e1b08dc8a7e83db152d8", "shasum": "" }, "require": { - "guzzlehttp/guzzle": "^6.0", + "guzzlehttp/guzzle": "^6.0|^7.0", "illuminate/notifications": "~5.8.0|^6.0|^7.0", "php": "^7.1.3" }, @@ -2604,7 +2607,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.x-dev" }, "laravel": { "providers": [ @@ -2633,7 +2636,7 @@ "notifications", "slack" ], - "time": "2019-08-27T14:40:26+00:00" + "time": "2020-06-30T20:34:53+00:00" }, { "name": "laravel/socialite", @@ -2765,21 +2768,21 @@ }, { "name": "league/commonmark", - "version": "1.4.3", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/thephpleague/commonmark.git", - "reference": "412639f7cfbc0b31ad2455b2fe965095f66ae505" + "reference": "6d74caf6abeed5fd85d6ec20da23d7269cd0b46f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/412639f7cfbc0b31ad2455b2fe965095f66ae505", - "reference": "412639f7cfbc0b31ad2455b2fe965095f66ae505", + "url": "https://api.github.com/repos/thephpleague/commonmark/zipball/6d74caf6abeed5fd85d6ec20da23d7269cd0b46f", + "reference": "6d74caf6abeed5fd85d6ec20da23d7269cd0b46f", "shasum": "" }, "require": { "ext-mbstring": "*", - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "conflict": { "scrutinizer/ocular": "1.7.*" @@ -2801,11 +2804,6 @@ "bin/commonmark" ], "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, "autoload": { "psr-4": { "League\\CommonMark\\": "src" @@ -2861,7 +2859,7 @@ "type": "tidelift" } ], - "time": "2020-05-04T22:15:21+00:00" + "time": "2020-06-27T12:50:08+00:00" }, { "name": "league/flysystem", @@ -3689,16 +3687,16 @@ }, { "name": "nesbot/carbon", - "version": "2.35.0", + "version": "2.36.0", "source": { "type": "git", "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "4b9bd835261ef23d36397a46a76b496a458305e5" + "reference": "d0b65958d9942fd1b501fdb0800c67e8323aa08d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/4b9bd835261ef23d36397a46a76b496a458305e5", - "reference": "4b9bd835261ef23d36397a46a76b496a458305e5", + "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/d0b65958d9942fd1b501fdb0800c67e8323aa08d", + "reference": "d0b65958d9942fd1b501fdb0800c67e8323aa08d", "shasum": "" }, "require": { @@ -3710,9 +3708,10 @@ "require-dev": { "doctrine/orm": "^2.7", "friendsofphp/php-cs-fixer": "^2.14 || ^3.0", - "kylekatarnls/multi-tester": "^1.1", + "kylekatarnls/multi-tester": "^2.0", "phpmd/phpmd": "^2.8", - "phpstan/phpstan": "^0.11", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^0.12.30", "phpunit/phpunit": "^7.5 || ^8.0", "squizlabs/php_codesniffer": "^3.4" }, @@ -3729,6 +3728,11 @@ "providers": [ "Carbon\\Laravel\\ServiceProvider" ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -3768,7 +3772,7 @@ "type": "tidelift" } ], - "time": "2020-05-24T18:27:52+00:00" + "time": "2020-06-25T20:20:01+00:00" }, { "name": "nikic/php-parser", @@ -4202,16 +4206,16 @@ }, { "name": "php-http/client-common", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/php-http/client-common.git", - "reference": "a8b29678d61556f45d6236b1667db16d998ceec5" + "reference": "f3985360f3d054292605e9ec7c4bc24ebcf249bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-http/client-common/zipball/a8b29678d61556f45d6236b1667db16d998ceec5", - "reference": "a8b29678d61556f45d6236b1667db16d998ceec5", + "url": "https://api.github.com/repos/php-http/client-common/zipball/f3985360f3d054292605e9ec7c4bc24ebcf249bb", + "reference": "f3985360f3d054292605e9ec7c4bc24ebcf249bb", "shasum": "" }, "require": { @@ -4219,13 +4223,19 @@ "php-http/httplug": "^2.0", "php-http/message": "^1.6", "php-http/message-factory": "^1.0", - "symfony/options-resolver": " ^3.4.20 || ~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0" + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0", + "symfony/options-resolver": "^2.6 || ^3.4.20 || ~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0", + "symfony/polyfill-php80": "^1.17" }, "require-dev": { "doctrine/instantiator": "^1.1", "guzzlehttp/psr7": "^1.4", - "phpspec/phpspec": "^5.1", + "nyholm/psr7": "^1.2", + "phpspec/phpspec": "^5.1 || ^6.0", "phpspec/prophecy": "^1.8", + "phpunit/phpunit": "^7.5", "sebastian/comparator": "^3.0" }, "suggest": { @@ -4238,7 +4248,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0.x-dev" + "dev-master": "2.2.x-dev" } }, "autoload": { @@ -4264,7 +4274,7 @@ "http", "httplug" ], - "time": "2019-11-18T08:58:18+00:00" + "time": "2020-07-02T06:51:04+00:00" }, { "name": "php-http/discovery", @@ -4941,20 +4951,20 @@ }, { "name": "psr/http-client", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/http-client.git", - "reference": "496a823ef742b632934724bf769560c2a5c7c44e" + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-client/zipball/496a823ef742b632934724bf769560c2a5c7c44e", - "reference": "496a823ef742b632934724bf769560c2a5c7c44e", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", + "reference": "2dfb5f6c5eff0e91e20e913f8c5452ed95b86621", "shasum": "" }, "require": { - "php": "^7.0", + "php": "^7.0 || ^8.0", "psr/http-message": "^1.0" }, "type": "library", @@ -4986,7 +4996,7 @@ "psr", "psr-18" ], - "time": "2018-10-30T23:29:13+00:00" + "time": "2020-06-29T06:28:15+00:00" }, { "name": "psr/http-factory", @@ -5814,16 +5824,16 @@ }, { "name": "spatie/browsershot", - "version": "3.36.0", + "version": "3.37.0", "source": { "type": "git", "url": "https://github.com/spatie/browsershot.git", - "reference": "5e5210438857148c126fa1867eb037e98b73ebc2" + "reference": "7ec2bcbd9cd998034943c52825895806c8f30698" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/spatie/browsershot/zipball/5e5210438857148c126fa1867eb037e98b73ebc2", - "reference": "5e5210438857148c126fa1867eb037e98b73ebc2", + "url": "https://api.github.com/repos/spatie/browsershot/zipball/7ec2bcbd9cd998034943c52825895806c8f30698", + "reference": "7ec2bcbd9cd998034943c52825895806c8f30698", "shasum": "" }, "require": { @@ -5866,7 +5876,13 @@ "screenshot", "webpage" ], - "time": "2020-04-20T10:33:41+00:00" + "funding": [ + { + "url": "https://www.patreon.com/spatie", + "type": "patreon" + } + ], + "time": "2020-06-18T10:36:21+00:00" }, { "name": "spatie/image", @@ -6063,16 +6079,16 @@ }, { "name": "stripe/stripe-php", - "version": "v7.37.1", + "version": "v7.39.0", "source": { "type": "git", "url": "https://github.com/stripe/stripe-php.git", - "reference": "e3e29131a131785c3d2f85556b0154e8170e9bba" + "reference": "350e4f4db026bd0627925885b30c09d054777b68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/stripe/stripe-php/zipball/e3e29131a131785c3d2f85556b0154e8170e9bba", - "reference": "e3e29131a131785c3d2f85556b0154e8170e9bba", + "url": "https://api.github.com/repos/stripe/stripe-php/zipball/350e4f4db026bd0627925885b30c09d054777b68", + "reference": "350e4f4db026bd0627925885b30c09d054777b68", "shasum": "" }, "require": { @@ -6116,7 +6132,7 @@ "payment processing", "stripe" ], - "time": "2020-06-11T16:27:35+00:00" + "time": "2020-06-25T23:56:19+00:00" }, { "name": "swiftmailer/swiftmailer", @@ -7132,16 +7148,16 @@ }, { "name": "symfony/polyfill-ctype", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9" + "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/e94c8b1bbe2bc77507a1056cdb06451c75b427f9", - "reference": "e94c8b1bbe2bc77507a1056cdb06451c75b427f9", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", + "reference": "2edd75b8b35d62fd3eeabba73b26b8f1f60ce13d", "shasum": "" }, "require": { @@ -7154,6 +7170,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7200,20 +7220,20 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:14:59+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-iconv", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-iconv.git", - "reference": "c4de7601eefbf25f9d47190abe07f79fe0a27424" + "reference": "ba6c9c18db36235b859cc29b8372d1c01298c035" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/c4de7601eefbf25f9d47190abe07f79fe0a27424", - "reference": "c4de7601eefbf25f9d47190abe07f79fe0a27424", + "url": "https://api.github.com/repos/symfony/polyfill-iconv/zipball/ba6c9c18db36235b859cc29b8372d1c01298c035", + "reference": "ba6c9c18db36235b859cc29b8372d1c01298c035", "shasum": "" }, "require": { @@ -7226,6 +7246,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7273,20 +7297,20 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-intl-idn", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a" + "reference": "a57f8161502549a742a63c09f0a604997bf47027" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/3bff59ea7047e925be6b7f2059d60af31bb46d6a", - "reference": "3bff59ea7047e925be6b7f2059d60af31bb46d6a", + "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/a57f8161502549a742a63c09f0a604997bf47027", + "reference": "a57f8161502549a742a63c09f0a604997bf47027", "shasum": "" }, "require": { @@ -7301,6 +7325,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7349,20 +7377,20 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c" + "reference": "7110338d81ce1cbc3e273136e4574663627037a7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fa79b11539418b02fc5e1897267673ba2c19419c", - "reference": "fa79b11539418b02fc5e1897267673ba2c19419c", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7110338d81ce1cbc3e273136e4574663627037a7", + "reference": "7110338d81ce1cbc3e273136e4574663627037a7", "shasum": "" }, "require": { @@ -7375,6 +7403,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7422,7 +7454,7 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-php72", @@ -7495,16 +7527,16 @@ }, { "name": "symfony/polyfill-php73", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc" + "reference": "fa0837fe02d617d31fbb25f990655861bb27bd1a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/a760d8964ff79ab9bf057613a5808284ec852ccc", - "reference": "a760d8964ff79ab9bf057613a5808284ec852ccc", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fa0837fe02d617d31fbb25f990655861bb27bd1a", + "reference": "fa0837fe02d617d31fbb25f990655861bb27bd1a", "shasum": "" }, "require": { @@ -7514,6 +7546,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7563,20 +7599,20 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd" + "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd", - "reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/4a5b6bba3259902e386eb80dd1956181ee90b5b2", + "reference": "4a5b6bba3259902e386eb80dd1956181ee90b5b2", "shasum": "" }, "require": { @@ -7586,6 +7622,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7639,20 +7679,20 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/polyfill-uuid", - "version": "v1.17.0", + "version": "v1.17.1", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-uuid.git", - "reference": "6dbf0269e8aeab8253a5059c51c1760fb4034e87" + "reference": "5db3e66818f1f768b585220438436ea6c1e0b874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/6dbf0269e8aeab8253a5059c51c1760fb4034e87", - "reference": "6dbf0269e8aeab8253a5059c51c1760fb4034e87", + "url": "https://api.github.com/repos/symfony/polyfill-uuid/zipball/5db3e66818f1f768b585220438436ea6c1e0b874", + "reference": "5db3e66818f1f768b585220438436ea6c1e0b874", "shasum": "" }, "require": { @@ -7666,6 +7706,10 @@ "extra": { "branch-alias": { "dev-master": "1.17-dev" + }, + "thanks": { + "name": "symfony/polyfill", + "url": "https://github.com/symfony/polyfill" } }, "autoload": { @@ -7712,7 +7756,7 @@ "type": "tidelift" } ], - "time": "2020-05-12T16:47:27+00:00" + "time": "2020-06-06T08:46:27+00:00" }, { "name": "symfony/process", @@ -8434,87 +8478,6 @@ "laravel" ], "time": "2019-07-12T14:06:05+00:00" - }, - { - "name": "yajra/laravel-datatables-oracle", - "version": "v9.10.2", - "source": { - "type": "git", - "url": "https://github.com/yajra/laravel-datatables.git", - "reference": "7ccbc890aa03d645bd509c03299234dc631240ee" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/yajra/laravel-datatables/zipball/7ccbc890aa03d645bd509c03299234dc631240ee", - "reference": "7ccbc890aa03d645bd509c03299234dc631240ee", - "shasum": "" - }, - "require": { - "illuminate/database": "5.8.*|^6|^7", - "illuminate/filesystem": "5.8.*|^6|^7", - "illuminate/http": "5.8.*|^6|^7", - "illuminate/support": "5.8.*|^6|^7", - "illuminate/view": "5.8.*|^6|^7", - "php": "^7.1.3" - }, - "require-dev": { - "orchestra/testbench": "^3.8" - }, - "suggest": { - "yajra/laravel-datatables-buttons": "Plugin for server-side exporting of dataTables.", - "yajra/laravel-datatables-editor": "Plugin to use DataTables Editor (requires a license).", - "yajra/laravel-datatables-fractal": "Plugin for server-side response using Fractal.", - "yajra/laravel-datatables-html": "Plugin for server-side HTML builder of dataTables." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "9.0-dev" - }, - "laravel": { - "providers": [ - "Yajra\\DataTables\\DataTablesServiceProvider" - ], - "aliases": { - "DataTables": "Yajra\\DataTables\\Facades\\DataTables" - } - } - }, - "autoload": { - "psr-4": { - "Yajra\\DataTables\\": "src/" - }, - "files": [ - "src/helper.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Arjay Angeles", - "email": "aqangeles@gmail.com" - } - ], - "description": "jQuery DataTables API for Laravel 4|5|6|7", - "keywords": [ - "datatables", - "jquery", - "laravel" - ], - "funding": [ - { - "url": "https://www.paypal.me/yajra", - "type": "custom" - }, - { - "url": "https://www.patreon.com/yajra", - "type": "patreon" - } - ], - "time": "2020-06-17T03:08:37+00:00" } ], "packages-dev": [ @@ -9350,20 +9313,20 @@ }, { "name": "myclabs/deep-copy", - "version": "1.9.5", + "version": "1.10.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef" + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/b2c28789e80a97badd14145fda39b545d83ca3ef", - "reference": "b2c28789e80a97badd14145fda39b545d83ca3ef", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", + "reference": "969b211f9a51aa1f6c01d1d2aef56d3bd91598e5", "shasum": "" }, "require": { - "php": "^7.1" + "php": "^7.1 || ^8.0" }, "replace": { "myclabs/deep-copy": "self.version" @@ -9394,7 +9357,13 @@ "object", "object graph" ], - "time": "2020-01-17T21:11:47+00:00" + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2020-06-29T13:22:24+00:00" }, { "name": "nunomaduro/collision", @@ -9629,25 +9598,25 @@ }, { "name": "phpdocumentor/reflection-common", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b" + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/6568f4687e5b41b054365f9ae03fcb1ed5f2069b", - "reference": "6568f4687e5b41b054365f9ae03fcb1ed5f2069b", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", "shasum": "" }, "require": { - "php": ">=7.1" + "php": "^7.2 || ^8.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.x-dev" + "dev-2.x": "2.x-dev" } }, "autoload": { @@ -9674,7 +9643,7 @@ "reflection", "static analysis" ], - "time": "2020-04-27T09:25:28+00:00" + "time": "2020-06-27T09:03:43+00:00" }, { "name": "phpdocumentor/reflection-docblock", @@ -9731,30 +9700,29 @@ }, { "name": "phpdocumentor/type-resolver", - "version": "1.1.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95" + "reference": "e878a14a65245fbe78f8080eba03b47c3b705651" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/7462d5f123dfc080dfdf26897032a6513644fc95", - "reference": "7462d5f123dfc080dfdf26897032a6513644fc95", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/e878a14a65245fbe78f8080eba03b47c3b705651", + "reference": "e878a14a65245fbe78f8080eba03b47c3b705651", "shasum": "" }, "require": { - "php": "^7.2", + "php": "^7.2 || ^8.0", "phpdocumentor/reflection-common": "^2.0" }, "require-dev": { - "ext-tokenizer": "^7.2", - "mockery/mockery": "~1" + "ext-tokenizer": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.x-dev" + "dev-1.x": "1.x-dev" } }, "autoload": { @@ -9773,7 +9741,7 @@ } ], "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", - "time": "2020-02-18T18:59:58+00:00" + "time": "2020-06-27T10:12:23+00:00" }, { "name": "phpspec/prophecy", @@ -10742,16 +10710,16 @@ }, { "name": "swagger-api/swagger-ui", - "version": "v3.26.2", + "version": "v3.28.0", "source": { "type": "git", "url": "https://github.com/swagger-api/swagger-ui.git", - "reference": "ae33deeaab47129844b89192d35762abf5cf80fb" + "reference": "3cef22736827b933b0f116e33847a47f7724bd16" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/ae33deeaab47129844b89192d35762abf5cf80fb", - "reference": "ae33deeaab47129844b89192d35762abf5cf80fb", + "url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/3cef22736827b933b0f116e33847a47f7724bd16", + "reference": "3cef22736827b933b0f116e33847a47f7724bd16", "shasum": "" }, "type": "library", @@ -10795,7 +10763,7 @@ "swagger", "ui" ], - "time": "2020-06-12T13:09:03+00:00" + "time": "2020-06-29T12:43:36+00:00" }, { "name": "symfony/yaml", diff --git a/routes/api.php b/routes/api.php index aa8aa2294d3f..ee263086ff99 100644 --- a/routes/api.php +++ b/routes/api.php @@ -10,7 +10,6 @@ | is assigned the "api" middleware group. Enjoy building your API! | */ -Route::get('/api/v1/ping', 'PingController@index')->name('ping'); Route::group(['middleware' => ['api_secret_check']], function () { Route::post('api/v1/signup', 'AccountController@store')->name('signup.submit'); @@ -23,6 +22,9 @@ Route::group(['api_secret_check', 'email_db'], function () { }); Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'api/v1', 'as' => 'api.'], function () { + + Route::get('ping', 'PingController@index')->name('ping'); + Route::resource('activities', 'ActivityController');// name = (clients. index / create / show / update / destroy / edit Route::resource('clients', 'ClientController');// name = (clients. index / create / show / update / destroy / edit From 696699b62cd8d0edf3847f9feb4b9e83b5c7a714 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 20:18:52 +1000 Subject: [PATCH 08/11] search parameters for clients and invoices --- app/Filters/ClientFilters.php | 10 ++++++++++ app/Filters/InvoiceFilters.php | 5 +++++ 2 files changed, 15 insertions(+) diff --git a/app/Filters/ClientFilters.php b/app/Filters/ClientFilters.php index 8d5261b8706d..8c04039feed4 100644 --- a/app/Filters/ClientFilters.php +++ b/app/Filters/ClientFilters.php @@ -49,6 +49,16 @@ class ClientFilters extends QueryFilters return $this->builder->whereBetween('balance', [$parts[0], $parts[1]]); } + public function email(string $email):Builder + { + return $this->builder->where('email', $email); + } + + public function id_number(string $id_number):Builder + { + return $this->builder->where('id_number', $id_number); + } + /** * Filter based on search text * diff --git a/app/Filters/InvoiceFilters.php b/app/Filters/InvoiceFilters.php index 47ff97554cf8..35766435dd64 100644 --- a/app/Filters/InvoiceFilters.php +++ b/app/Filters/InvoiceFilters.php @@ -70,6 +70,11 @@ class InvoiceFilters extends QueryFilters return $this->builder; } + public function invoice_number(string $invoice_number):Builder + { + return $this->builder->where('number', $invoice_number); + } + /** * Filter based on search text * From ef11b3eea1fc0824ec2edf1dfde041ad54f32f1e Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 20:22:40 +1000 Subject: [PATCH 09/11] Payment date is an optional --- app/Http/Requests/Payment/StorePaymentRequest.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/Http/Requests/Payment/StorePaymentRequest.php b/app/Http/Requests/Payment/StorePaymentRequest.php index f80e4ede8e29..f53da29920ed 100644 --- a/app/Http/Requests/Payment/StorePaymentRequest.php +++ b/app/Http/Requests/Payment/StorePaymentRequest.php @@ -80,7 +80,9 @@ class StorePaymentRequest extends Request $input['is_manual'] = true; - info(print_r($input,1)); + if(!isset($input['date'])) { + $input['date'] = now()->format('Y-m-d'); + } $this->replace($input); } @@ -90,7 +92,7 @@ class StorePaymentRequest extends Request $rules = [ 'amount' => 'numeric|required', 'amount' => [new PaymentAmountsBalanceRule(),new ValidCreditsPresentRule()], - 'date' => 'required', + //'date' => 'required', 'client_id' => 'bail|required|exists:clients,id', 'invoices.*.invoice_id' => 'required|distinct|exists:invoices,id', 'invoices.*.invoice_id' => new ValidInvoicesRules($this->all()), From bd0c523b5940372864c4da727b757dc35a3971c7 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 20:55:31 +1000 Subject: [PATCH 10/11] Add ability to set country_id by country code and currency_id by currency code --- .../Requests/Client/StoreClientRequest.php | 33 +++++++- tests/Feature/ClientTest.php | 82 +++++++++++++------ 2 files changed, 90 insertions(+), 25 deletions(-) diff --git a/app/Http/Requests/Client/StoreClientRequest.php b/app/Http/Requests/Client/StoreClientRequest.php index 3f09fc3df173..cea5c9ee22eb 100644 --- a/app/Http/Requests/Client/StoreClientRequest.php +++ b/app/Http/Requests/Client/StoreClientRequest.php @@ -19,6 +19,7 @@ use App\Models\Client; use App\Models\GroupSetting; use App\Utils\Traits\MakesHash; use Illuminate\Validation\Rule; +use Illuminate\Support\Facades\Cache; class StoreClientRequest extends Request { @@ -101,8 +102,11 @@ class StoreClientRequest extends Request } } elseif (!property_exists($settings, 'currency_id')) { $settings->currency_id = (string)auth()->user()->company()->settings->currency_id; - } + } + if (isset($input['currency_code'])) { + $settings->currency_id = $this->getCurrencyCode($input['currency_code']); + } $input['settings'] = $settings; @@ -130,6 +134,10 @@ class StoreClientRequest extends Request } } + if(isset($input['country_code'])) { + $input['country_id'] = $this->getCountryCode($input['country_code']); + } + $this->replace($input); } @@ -141,4 +149,27 @@ class StoreClientRequest extends Request 'contacts.*.email.required' => ctrans('validation.email', ['attribute' => 'email']), ]; } + + private function getCountryCode($country_code) + { + $countries = Cache::get('countries'); + + $country = $countries->filter(function ($item) use($country_code) { + return $item->iso_3166_2 == $country_code || $item->iso_3166_3 == $country_code; + })->first(); + + return (string) $country->id; + } + + private function getCurrencyCode($code) + { + $currencies = Cache::get('currencies'); + + $currency = $currencies->filter(function ($item) use($code){ + return $item->code == $code; + })->first(); + + return (string) $currency->id; + } + } diff --git a/tests/Feature/ClientTest.php b/tests/Feature/ClientTest.php index 95612ce11906..04483bcfa817 100644 --- a/tests/Feature/ClientTest.php +++ b/tests/Feature/ClientTest.php @@ -58,32 +58,66 @@ class ClientTest extends TestCase } + public function testStoreClientUsingCountryCode() + { + $data = [ + 'name' => 'Country Code Name', + 'country_code' => 'US', + 'currency_code' => 'USD', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/', $data); + + + $arr = $response->json(); + $client = Client::find($this->decodePrimaryKey($arr['data']['id'])); + + $this->assertEquals(840, $client->country_id); + $this->assertEquals(1, $client->settings->currency_id); + + $data = [ + 'name' => 'Country Code Name', + 'country_code' => 'USA', + 'currency_code' => 'USD', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/', $data); + + + $arr = $response->json(); + $client = Client::find($this->decodePrimaryKey($arr['data']['id'])); + + $this->assertEquals(840, $client->country_id); + $this->assertEquals(1, $client->settings->currency_id); + + + $data = [ + 'name' => 'Country Code Name', + 'country_code' => 'AU', + 'currency_code' => 'AUD', + ]; + + $response = $this->withHeaders([ + 'X-API-SECRET' => config('ninja.api_secret'), + 'X-API-TOKEN' => $this->token, + ])->post('/api/v1/clients/', $data); + + + $arr = $response->json(); + $client = Client::find($this->decodePrimaryKey($arr['data']['id'])); + + $this->assertEquals(36, $client->country_id); + $this->assertEquals(12, $client->settings->currency_id); + } + public function testClientList() { - // $data = [ - // 'first_name' => $this->faker->firstName, - // 'last_name' => $this->faker->lastName, - // 'name' => $this->faker->company, - // 'email' => $this->faker->unique()->safeEmail, - // 'password' => 'ALongAndBrilliantPassword123', - // '_token' => csrf_token(), - // 'privacy_policy' => 1, - // 'terms_of_service' => 1 - // ]; - - - // $response = $this->withHeaders([ - // 'X-API-SECRET' => config('ninja.api_secret'), - // ])->post('/api/v1/signup?include=account', $data); - - - // $response->assertStatus(200); - - // $acc = $response->json(); - - // $account = Account::find($this->decodePrimaryKey($acc['data'][0]['account']['id'])); - - // $this->token = $account->default_company->tokens->first()->token; $response = $this->withHeaders([ 'X-API-SECRET' => config('ninja.api_secret'), From 20078c6e3132579339411b7f81cdb374c1dab2f1 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 2 Jul 2020 20:56:10 +1000 Subject: [PATCH 11/11] Add ability to set country_id by country code and currency_id by currency code --- app/Http/Requests/Client/StoreClientRequest.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/Http/Requests/Client/StoreClientRequest.php b/app/Http/Requests/Client/StoreClientRequest.php index cea5c9ee22eb..3bda4d98fb38 100644 --- a/app/Http/Requests/Client/StoreClientRequest.php +++ b/app/Http/Requests/Client/StoreClientRequest.php @@ -138,6 +138,10 @@ class StoreClientRequest extends Request $input['country_id'] = $this->getCountryCode($input['country_code']); } + if(isset($input['shipping_country_code'])) { + $input['shipping_country_id'] = $this->getCountryCode($input['shipping_country_code']); + } + $this->replace($input); }