1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

Updates for account controller

This commit is contained in:
David Bomba 2023-05-03 14:05:29 +10:00
parent 7c6f11f7e2
commit b5344906cd
6 changed files with 89 additions and 7 deletions

View File

@ -81,8 +81,6 @@ class CreateAccount
$sp794f3f->account_sms_verified = false;
}
// $sp794f3f->trial_started = now();
// $sp794f3f->trial_plan = 'pro';
}
$sp794f3f->save();

View File

@ -310,7 +310,24 @@ class MultiDB
self::setDB($current_db);
return false;
return null;
}
public static function findAndSetDbByShopifyName($shopify_name) :?Company
{
$current_db = config('database.default');
foreach (self::$dbs as $db) {
if ($company = Company::on($db)->with('tokens')->where('shopify_name', $shopify_name)->first()) {
self::setDb($db);
return $company;
}
}
self::setDB($current_db);
return null;
}
public static function findAndSetDbByAccountKey($account_key) :bool
@ -413,7 +430,7 @@ class MultiDB
self::setDB($current_db);
return false;
return null;
}
public static function findAndSetDbByDomain($query_array)

View File

@ -203,6 +203,7 @@ class User extends Authenticatable implements MustVerifyEmail
'custom_value3',
'custom_value4',
'is_deleted',
'shopify_user_id',
// 'oauth_user_token',
// 'oauth_user_refresh_token',
];

View File

@ -81,6 +81,7 @@
"sentry/sentry-laravel": "^3",
"setasign/fpdf": "^1.8",
"setasign/fpdi": "^2.3",
"shopify/shopify-api": "^4.3",
"socialiteproviders/apple": "^5.2",
"socialiteproviders/microsoft": "^4.1",
"sprain/swiss-qr-bill": "^3.2",

65
composer.lock generated
View File

@ -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": "8c21eb3ea2c2baeecb223d5fdbc8423c",
"content-hash": "c5abc776f4fd59ba436de99f6c401429",
"packages": [
{
"name": "adrienrn/php-mimetyper",
@ -9342,6 +9342,69 @@
],
"time": "2023-02-09T10:38:43+00:00"
},
{
"name": "shopify/shopify-api",
"version": "v4.3.0",
"source": {
"type": "git",
"url": "https://github.com/Shopify/shopify-api-php.git",
"reference": "80cde593a69acb9b9095235fa8f7748e9389294c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Shopify/shopify-api-php/zipball/80cde593a69acb9b9095235fa8f7748e9389294c",
"reference": "80cde593a69acb9b9095235fa8f7748e9389294c",
"shasum": ""
},
"require": {
"doctrine/inflector": "^2.0",
"ext-json": "*",
"firebase/php-jwt": "^5.2 || ^6.2",
"guzzlehttp/guzzle": "^7.0",
"php": "^7.4 || ^8.0 || ^8.1",
"psr/http-client": "^1.0",
"psr/log": "^1.1 || ^2.0 || ^3.0",
"ramsey/uuid": "^4.1"
},
"require-dev": {
"mikey179/vfsstream": "^1.6",
"phpunit/phpunit": "^9",
"squizlabs/php_codesniffer": "^3.6"
},
"type": "library",
"autoload": {
"psr-4": {
"Shopify\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Shopify Inc.",
"email": "dev-tools-education@shopify.com"
}
],
"description": "Shopify API Library for PHP",
"keywords": [
"Storefront API",
"admin api",
"app",
"graphql",
"jwt",
"node",
"rest",
"shopify",
"webhook"
],
"support": {
"issues": "https://github.com/Shopify/shopify-api-php/issues",
"source": "https://github.com/Shopify/shopify-api-php/tree/v4.3.0"
},
"time": "2023-04-12T15:42:26+00:00"
},
{
"name": "smalot/pdfparser",
"version": "v0.19.0",

View File

@ -27,13 +27,15 @@ return new class extends Migration
});
Schema::table('users', function (Blueprint $table) {
Schema::table('users', function (Illuminate\Database\Schema\Blueprint $table) {
$table->unsignedInteger('shopify_user_id')->index()->nullable();
});
Schema::table('companies', function(Illuminate\Database\Schema\Blueprint $table){
$table->string('shopify_name')->index()->nullable();
});
//902541635
}
/**