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

Merge branch 'billing_subscriptions' into billing_subscription_scaffold

This commit is contained in:
David Bomba 2021-03-09 07:43:30 +11:00 committed by GitHub
commit 45104f6ae5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
50 changed files with 119344 additions and 118799 deletions

View File

@ -0,0 +1,55 @@
<?php
namespace App\Events\BillingSubscription;
use App\Models\BillingSubscription;
use App\Models\Company;
use Illuminate\Broadcasting\Channel;
use Illuminate\Broadcasting\InteractsWithSockets;
use Illuminate\Broadcasting\PresenceChannel;
use Illuminate\Broadcasting\PrivateChannel;
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
use Illuminate\Foundation\Events\Dispatchable;
use Illuminate\Queue\SerializesModels;
class BillingSubscriptionWasCreated
{
use Dispatchable, InteractsWithSockets, SerializesModels;
/**
* @var BillingSubscription
*/
public $billing_subscription;
/**
* @var Company
*/
public $company;
/**
* @var array
*/
public $event_vars;
/**
* Create a new event instance.
*
* @return void
*/
public function __construct(BillingSubscription $billing_subscription, Company $company, array $event_vars)
{
$this->billing_subscription = $billing_subscription;
$this->company = $company;
$this->event_vars = $event_vars;
}
/**
* Get the channels the event should broadcast on.
*
* @return \Illuminate\Broadcasting\Channel|array
*/
public function broadcastOn()
{
return new PrivateChannel('channel-name');
}
}

View File

@ -0,0 +1,17 @@
<?php
namespace App\Factory;
use App\Models\BillingSubscription;
class BillingSubscriptionFactory
{
public static function create(int $company_id, int $user_id): BillingSubscription
{
$billing_subscription = new BillingSubscription();
return $billing_subscription;
}
}

View File

@ -504,4 +504,18 @@ class BaseController extends Controller
return redirect('/setup');
}
public function checkFeature($feature)
{
if(auth()->user()->account->hasFeature($feature))
return true;
return false;
}
public function featureFailure()
{
return response()->json(['message' => 'Upgrade to a paid plan for this feature.'], 403);
}
}

View File

@ -0,0 +1,93 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Controllers;
use App\Events\BillingSubscription\BillingSubscriptionWasCreated;
use App\Factory\BillingSubscriptionFactory;
use App\Http\Requests\BillingSubscription\CreateBillingSubscriptionRequest;
use App\Http\Requests\BillingSubscription\DestroyBillingSubscriptionRequest;
use App\Http\Requests\BillingSubscription\EditBillingSubscriptionRequest;
use App\Http\Requests\BillingSubscription\ShowBillingSubscriptionRequest;
use App\Http\Requests\BillingSubscription\StoreBillingSubscriptionRequest;
use App\Http\Requests\BillingSubscription\UpdateBillingSubscriptionRequest;
use App\Models\BillingSubscription;
use App\Repositories\BillingSubscriptionRepository;
use App\Transformers\BillingSubscriptionTransformer;
use App\Utils\Ninja;
class BillingSubscriptionController extends BaseController
{
protected $entity_type = BillingSubscription::class;
protected $entity_transformer = BillingSubscriptionTransformer::class;
protected $billing_subscription_repo;
public function __construct(BillingSubscriptionRepository $billing_subscription_repo)
{
parent::__construct();
$this->billing_subscription_repo = $billing_subscription_repo;
}
public function index(): \Illuminate\Http\Response
{
$billing_subscriptions = BillingSubscription::query()->company();
return $this->listResponse($billing_subscriptions);
}
public function create(CreateBillingSubscriptionRequest $request): \Illuminate\Http\Response
{
$billing_subscription = BillingSubscriptionFactory::create(auth()->user()->company()->id, auth()->user()->id);
return $this->itemResponse($billing_subscription);
}
public function store(StoreBillingSubscriptionRequest $request): \Illuminate\Http\Response
{
$billing_subscription = $this->billing_subscription_repo->save($request->all(), BillingSubscriptionFactory::create(auth()->user()->company()->id, auth()->user()->id));
event(new BillingsubscriptionWasCreated($billing_subscription, $billing_subscription->company, Ninja::eventVars()));
return $this->itemResponse($billing_subscription);
}
public function show(ShowBillingSubscriptionRequest $request, BillingSubscription $billing_subscription): \Illuminate\Http\Response
{
return $this->itemResponse($billing_subscription);
}
public function edit(EditBillingSubscriptionRequest $request, BillingSubscription $billing_subscription): \Illuminate\Http\Response
{
return $this->itemResponse($billing_subscription);
}
public function update(UpdateBillingSubscriptionRequest $request, BillingSubscription $billing_subscription)
{
if ($request->entityIsDeleted($billing_subscription)) {
return $request->disallowUpdate();
}
$billing_subscription = $this->billing_subscription_repo->save($request->all(), $billing_subscription);
return $this->itemResponse($billing_subscription);
}
public function destroy(DestroyBillingSubscriptionRequest $request, BillingSubscription $billing_subscription): \Illuminate\Http\Response
{
$this->billing_subscription_repo->delete($billing_subscription);
return $this->listResponse($billing_subscription->fresh());
}
}

View File

@ -24,6 +24,7 @@ use App\Http\Requests\Client\UpdateClientRequest;
use App\Http\Requests\Client\UploadClientRequest;
use App\Jobs\Client\StoreClient;
use App\Jobs\Client\UpdateClient;
use App\Models\Account;
use App\Models\Client;
use App\Repositories\ClientRepository;
use App\Transformers\ClientTransformer;
@ -574,6 +575,9 @@ class ClientController extends BaseController
public function upload(UploadClientRequest $request, Client $client)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $client);

View File

@ -26,6 +26,7 @@ use App\Jobs\Company\CreateCompanyPaymentTerms;
use App\Jobs\Company\CreateCompanyTaskStatuses;
use App\Jobs\Company\CreateCompanyToken;
use App\Jobs\Ninja\RefundCancelledAccount;
use App\Models\Account;
use App\Models\Company;
use App\Models\CompanyUser;
use App\Repositories\CompanyRepository;
@ -559,6 +560,9 @@ class CompanyController extends BaseController
public function upload(UploadCompanyRequest $request, Company $company)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $company);

View File

@ -26,6 +26,7 @@ use App\Http\Requests\Credit\UpdateCreditRequest;
use App\Http\Requests\Credit\UploadCreditRequest;
use App\Jobs\Entity\EmailEntity;
use App\Jobs\Invoice\EmailCredit;
use App\Models\Account;
use App\Models\Client;
use App\Models\Credit;
use App\Models\Invoice;
@ -643,6 +644,9 @@ class CreditController extends BaseController
public function upload(UploadCreditRequest $request, Credit $credit)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $credit);

View File

@ -22,6 +22,7 @@ use App\Http\Requests\Expense\ShowExpenseRequest;
use App\Http\Requests\Expense\StoreExpenseRequest;
use App\Http\Requests\Expense\UpdateExpenseRequest;
use App\Http\Requests\Expense\UploadExpenseRequest;
use App\Models\Account;
use App\Models\Expense;
use App\Repositories\ExpenseRepository;
use App\Transformers\ExpenseTransformer;
@ -565,6 +566,9 @@ class ExpenseController extends BaseController
public function upload(UploadExpenseRequest $request, Expense $expense)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $expense);

View File

@ -30,6 +30,7 @@ use App\Jobs\Entity\EmailEntity;
use App\Jobs\Invoice\StoreInvoice;
use App\Jobs\Invoice\ZipInvoices;
use App\Jobs\Util\UnlinkFile;
use App\Models\Account;
use App\Models\Client;
use App\Models\Invoice;
use App\Models\Quote;
@ -906,7 +907,9 @@ class InvoiceController extends BaseController
*/
public function upload(UploadInvoiceRequest $request, Invoice $invoice)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $invoice);

View File

@ -23,6 +23,7 @@ use App\Http\Requests\Payment\ShowPaymentRequest;
use App\Http\Requests\Payment\StorePaymentRequest;
use App\Http\Requests\Payment\UpdatePaymentRequest;
use App\Http\Requests\Payment\UploadPaymentRequest;
use App\Models\Account;
use App\Models\Invoice;
use App\Models\Payment;
use App\Repositories\PaymentRepository;
@ -729,6 +730,9 @@ class PaymentController extends BaseController
public function upload(UploadPaymentRequest $request, Payment $payment)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $payment);

View File

@ -20,6 +20,7 @@ use App\Http\Requests\Product\ShowProductRequest;
use App\Http\Requests\Product\StoreProductRequest;
use App\Http\Requests\Product\UpdateProductRequest;
use App\Http\Requests\Product\UploadProductRequest;
use App\Models\Account;
use App\Models\Product;
use App\Repositories\ProductRepository;
use App\Transformers\ProductTransformer;
@ -534,6 +535,9 @@ class ProductController extends BaseController
public function upload(UploadProductRequest $request, Product $product)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $product);

View File

@ -20,6 +20,7 @@ use App\Http\Requests\Project\ShowProjectRequest;
use App\Http\Requests\Project\StoreProjectRequest;
use App\Http\Requests\Project\UpdateProjectRequest;
use App\Http\Requests\Project\UploadProjectRequest;
use App\Models\Account;
use App\Models\Project;
use App\Repositories\ProjectRepository;
use App\Transformers\ProjectTransformer;
@ -559,6 +560,9 @@ class ProjectController extends BaseController
public function upload(UploadProjectRequest $request, Project $project)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $project);

View File

@ -26,6 +26,7 @@ use App\Http\Requests\Quote\StoreQuoteRequest;
use App\Http\Requests\Quote\UpdateQuoteRequest;
use App\Http\Requests\Quote\UploadQuoteRequest;
use App\Jobs\Invoice\ZipInvoices;
use App\Models\Account;
use App\Models\Client;
use App\Models\Invoice;
use App\Models\Quote;
@ -775,6 +776,9 @@ class QuoteController extends BaseController
public function upload(UploadQuoteRequest $request, Quote $quote)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $quote);

View File

@ -21,6 +21,7 @@ use App\Http\Requests\RecurringInvoice\ShowRecurringInvoiceRequest;
use App\Http\Requests\RecurringInvoice\StoreRecurringInvoiceRequest;
use App\Http\Requests\RecurringInvoice\UpdateRecurringInvoiceRequest;
use App\Http\Requests\RecurringInvoice\UploadRecurringInvoiceRequest;
use App\Models\Account;
use App\Models\RecurringInvoice;
use App\Repositories\RecurringInvoiceRepository;
use App\Transformers\RecurringInvoiceTransformer;
@ -738,6 +739,9 @@ class RecurringInvoiceController extends BaseController
public function upload(UploadRecurringInvoiceRequest $request, RecurringInvoice $recurring_invoice)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $recurring_invoice);

View File

@ -212,7 +212,7 @@ class SetupController extends Controller
public function checkPdf(Request $request)
{
try {
if (config('ninja.phantomjs_key')) {
if (config('ninja.phantomjs_pdf_generation')) {
return $this->testPhantom();
}
@ -240,7 +240,7 @@ class SetupController extends Controller
private function testPhantom()
{
try {
$key = config('ninja.phantomjs_key');
$key = config('ninja.phantomjs_pdf_generation');
$url = 'https://www.invoiceninja.org/';
$phantom_url = "https://phantomjscloud.com/api/browser/v2/{$key}/?request=%7Burl:%22{$url}%22,renderType:%22pdf%22%7D";

View File

@ -22,6 +22,7 @@ use App\Http\Requests\Task\ShowTaskRequest;
use App\Http\Requests\Task\StoreTaskRequest;
use App\Http\Requests\Task\UpdateTaskRequest;
use App\Http\Requests\Task\UploadTaskRequest;
use App\Models\Account;
use App\Models\Task;
use App\Repositories\TaskRepository;
use App\Transformers\TaskTransformer;
@ -35,8 +36,8 @@ use Illuminate\Http\Response;
/**
* Class TaskController.
* @covers App\Http\Controllers\TaskController
*/
class TaskController extends BaseController
{
use MakesHash;
@ -569,6 +570,9 @@ class TaskController extends BaseController
public function upload(UploadTaskRequest $request, Task $task)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $task);

View File

@ -24,7 +24,7 @@ class TwoFactorController extends BaseController
return response()->json(['message' => '2FA already enabled'], 400);
elseif(! $user->phone)
return response()->json(['message' => ctrans('texts.set_phone_for_two_factor')], 400);
elseif(! $user->confirmed)
elseif(! $user->isVerified())
return response()->json(['message' => 'Please confirm your account first'], 400);
$google2fa = new Google2FA();

View File

@ -466,6 +466,9 @@ class UserController extends BaseController
*/
public function destroy(DestroyUserRequest $request, User $user)
{
if($user->isOwner())
return response()->json(['message', 'Cannot detach owner.'],400);
/* If the user passes the company user we archive the company user */
$user = $this->user_repo->delete($request->all(), $user);
@ -603,6 +606,9 @@ class UserController extends BaseController
*/
public function detach(DetachCompanyUserRequest $request, User $user)
{
if($user->isOwner())
return response()->json(['message', 'Cannot detach owner.'],400);
$company_user = CompanyUser::whereUserId($user->id)
->whereCompanyId(auth()->user()->companyId())->first();

View File

@ -22,6 +22,7 @@ use App\Http\Requests\Vendor\ShowVendorRequest;
use App\Http\Requests\Vendor\StoreVendorRequest;
use App\Http\Requests\Vendor\UpdateVendorRequest;
use App\Http\Requests\Vendor\UploadVendorRequest;
use App\Models\Account;
use App\Models\Vendor;
use App\Repositories\VendorRepository;
use App\Transformers\VendorTransformer;
@ -569,6 +570,9 @@ class VendorController extends BaseController
public function upload(UploadVendorRequest $request, Vendor $vendor)
{
if(!$this->checkFeature(Account::FEATURE_DOCUMENTS))
return $this->featureFailure();
if ($request->has('documents'))
$this->saveDocuments($request->file('documents'), $vendor);

View File

@ -0,0 +1,75 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Http\Controllers;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Artisan;
class WebCronController extends Controller
{
public function __construct()
{
}
/**
* Store a newly created resource in storage.
*
* @return Response
*
* @OA\Get(
* path="/api/v1/webcron",
* operationId="webcron",
* tags={"webcron"},
* summary="Executes the task scheduler via a webcron service",
* description="Executes the task scheduler via a webcron service",
* @OA\Parameter(ref="#/components/parameters/X-Api-Secret"),
* @OA\Parameter(ref="#/components/parameters/X-Requested-With"),
* @OA\Response(
* response=200,
* description="Success response",
* @OA\Header(header="X-MINIMUM-CLIENT-VERSION", ref="#/components/headers/X-MINIMUM-CLIENT-VERSION"),
* @OA\Header(header="X-RateLimit-Remaining", ref="#/components/headers/X-RateLimit-Remaining"),
* @OA\Header(header="X-RateLimit-Limit", ref="#/components/headers/X-RateLimit-Limit"),
* ),
* @OA\Response(
* response=422,
* description="Validation error",
* @OA\JsonContent(ref="#/components/schemas/ValidationError"),
* ),
* @OA\Response(
* response="default",
* description="Unexpected Error",
* @OA\JsonContent(ref="#/components/schemas/Error"),
* ),
* )
*/
public function index(Request $request)
{
set_time_limit(0);
if(!config('ninja.webcron_secret'))
return response()->json(['message' => 'Web cron has not been configured'], 403);
if($request->has('secret') && (config('ninja.webcron_secret') == $request->query('secret')))
{
Artisan::call('schedule:run');
return response()->json(['message' => 'Executing web cron'], 200);
}
return response()->json(['message' => 'Invalid secret'], 403);
}
}

View File

@ -71,7 +71,7 @@ class PasswordProtection
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), now()->addMinutes(30));
return $next($request);
}
elseif($existing_user = MultiDB::hasUser($query) && !auth()->uer()->has_password){
elseif($existing_user = MultiDB::hasUser($query) && !auth()->user()->has_password){
Cache::add(auth()->user()->hashed_id.'_logged_in', Str::random(64), now()->addMinutes(30));
return $next($request);

View File

@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests\BillingSubscription;
use App\Http\Requests\Request;
class CreateBillingSubscriptionRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize(): bool
{
return true;
// return auth()->user()->can('create', BillingSubscription::class); // TODO
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -0,0 +1,31 @@
<?php
namespace App\Http\Requests\BillingSubscription;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class DestroyBillingSubscriptionRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true; // TODO
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests\BillingSubscription;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class EditBillingSubscriptionRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true;
// return auth()->user()->can('view', $this->billing_subscription); // TODO
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -0,0 +1,32 @@
<?php
namespace App\Http\Requests\BillingSubscription;
use App\Http\Requests\Request;
use Illuminate\Foundation\Http\FormRequest;
class ShowBillingSubscriptionRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize() : bool
{
return true;
// return auth()->user()->can('view', $this->billing_subscription); // TODO
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -0,0 +1,50 @@
<?php
namespace App\Http\Requests\BillingSubscription;
use App\Http\Requests\Request;
class StoreBillingSubscriptionRequest extends Request
{
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true; // TODO
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
'user_id' => ['sometimes'],
'product_id' => ['sometimes'],
'assigned_user_id' => ['sometimes'],
'company_id' => ['sometimes'],
'is_recurring' => ['sometimes'],
'frequency_id' => ['sometimes'],
'auto_bill' => ['sometimes'],
'promo_code' => ['sometimes'],
'promo_discount' => ['sometimes'],
'is_amount_discount' => ['sometimes'],
'allow_cancellation' => ['sometimes'],
'per_set_enabled' => ['sometimes'],
'min_seats_limit' => ['sometimes'],
'max_seats_limit' => ['sometimes'],
'trial_enabled' => ['sometimes'],
'trial_duration' => ['sometimes'],
'allow_query_overrides' => ['sometimes'],
'allow_plan_changes' => ['sometimes'],
'plan_map' => ['sometimes'],
'refund_period' => ['sometimes'],
'webhook_configuration' => ['sometimes'],
];
}
}

View File

@ -0,0 +1,33 @@
<?php
namespace App\Http\Requests\BillingSubscription;
use App\Http\Requests\Request;
use App\Utils\Traits\ChecksEntityStatus;
class UpdateBillingSubscriptionRequest extends Request
{
use ChecksEntityStatus;
/**
* Determine if the user is authorized to make this request.
*
* @return bool
*/
public function authorize()
{
return true; // TODO
}
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public function rules()
{
return [
//
];
}
}

View File

@ -17,6 +17,7 @@ use App\Models\Client;
use App\Models\RecurringInvoice;
use App\Utils\Traits\CleanLineItems;
use App\Utils\Traits\MakesHash;
use Illuminate\Http\UploadedFile;
class StoreRecurringInvoiceRequest extends Request
{
@ -43,6 +44,7 @@ class StoreRecurringInvoiceRequest extends Request
foreach (range(0, $documents) as $index) {
$rules['documents.'.$index] = 'file|mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
}
} elseif ($this->input('documents')) {
$rules['documents'] = 'file|mimes:png,ai,svg,jpeg,tiff,pdf,gif,psd,txt,doc,xls,ppt,xlsx,docx,pptx|max:20000';
}
@ -51,7 +53,7 @@ class StoreRecurringInvoiceRequest extends Request
$rules['invitations.*.client_contact_id'] = 'distinct';
$rules['frequency_id'] = 'required|integer';
$rules['frequency_id'] = 'required|integer|digits_between:1,12';
$rules['number'] = new UniqueRecurringInvoiceNumberRule($this->all());
@ -62,6 +64,16 @@ class StoreRecurringInvoiceRequest extends Request
{
$input = $this->all();
// foreach($this->input('documents') as $document)
// {
// if($document instanceof UploadedFile){
// nlog("i am an uploaded file");
// nlog($document);
// }
// else
// nlog($document);
// }
if (array_key_exists('design_id', $input) && is_string($input['design_id'])) {
$input['design_id'] = $this->decodePrimaryKey($input['design_id']);
}

View File

@ -15,6 +15,7 @@ use App\Http\Requests\Request;
use App\Utils\Traits\ChecksEntityStatus;
use App\Utils\Traits\CleanLineItems;
use App\Utils\Traits\MakesHash;
use Illuminate\Http\UploadedFile;
class UpdateRecurringInvoiceRequest extends Request
{
@ -57,6 +58,16 @@ class UpdateRecurringInvoiceRequest extends Request
{
$input = $this->all();
// foreach($this->input('documents') as $document)
// {
// if($document instanceof UploadedFile){
// nlog("i am an uploaded file");
// nlog($document);
// }
// else
// nlog($document);
// }
if (array_key_exists('design_id', $input) && is_string($input['design_id'])) {
$input['design_id'] = $this->decodePrimaryKey($input['design_id']);
}

View File

@ -65,6 +65,10 @@ class CreateUser
$user->email = $this->request['email']; //todo need to remove this in production
$user->last_login = now();
$user->ip = request()->ip();
if(Ninja::isSelfHost())
$user->email_verified_at = now();
$user->save();
$user->companies()->attach($this->company->id, [
@ -78,7 +82,8 @@ class CreateUser
'settings' => null,
]);
event(new UserWasCreated($user, $user, $this->company, Ninja::eventVars()));
if(!Ninja::isSelfHost())
event(new UserWasCreated($user, $user, $this->company, Ninja::eventVars()));
return $user;
}

View File

@ -45,7 +45,7 @@ class MailSentListener implements ShouldQueue
$postmark_id = $event->message->getHeaders()->get('x-pm-message-id')->getValue();
nlog($postmark_id);
// nlog($postmark_id);
$invitation = $event->message->invitation;
$invitation->message_id = $postmark_id;
$invitation->save();

View File

@ -167,17 +167,17 @@ class Account extends BaseModel
// Enterprise; No Trial allowed; grandfathered for old pro users
case self::FEATURE_USERS:// Grandfathered for old Pro users
if ($planDetails && $planDetails['trial']) {
if ($plan_details && $plan_details['trial']) {
// Do they have a non-trial plan?
$planDetails = $this->getPlanDetails(false, false);
$plan_details = $this->getPlanDetails(false, false);
}
return $self_host || ! empty($planDetails) && ($planDetails['plan'] == self::PLAN_ENTERPRISE);
return $self_host || ! empty($plan_details) && ($plan_details['plan'] == self::PLAN_ENTERPRISE);
// Enterprise; No Trial allowed
case self::FEATURE_DOCUMENTS:
case self::FEATURE_USER_PERMISSIONS:
return $self_host || ! empty($planDetails) && $planDetails['plan'] == self::PLAN_ENTERPRISE && ! $planDetails['trial'];
return $self_host || ! empty($plan_details) && $plan_details['plan'] == self::PLAN_ENTERPRISE && ! $plan_details['trial'];
default:
return false;

View File

@ -12,8 +12,50 @@
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\SoftDeletes;
class BillingSubscription extends BaseModel
{
use HasFactory;
use HasFactory, SoftDeletes;
protected $fillable = [
'user_id',
'product_id',
'company_id',
'product_id',
'is_recurring',
'frequency_id',
'auto_bill',
'promo_code',
'promo_discount',
'is_amount_discount',
'allow_cancellation',
'per_set_enabled',
'min_seats_limit',
'max_seats_limit',
'trial_enabled',
'trial_duration',
'allow_query_overrides',
'allow_plan_changes',
'plan_map',
'refund_period',
'webhook_configuration',
];
public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Company::class);
}
public function user(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(User::class);
}
public function product(): \Illuminate\Database\Eloquent\Relations\BelongsTo
{
return $this->belongsTo(Product::class);
}
}

View File

@ -9,11 +9,13 @@
* @license https://opensource.org/licenses/AAL
*/
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
class ClientSubscription extends BaseModel
class ClientSubscription extends Model
{
use HasFactory;
}

View File

@ -0,0 +1,28 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Repositories;
use App\Models\BillingSubscription;
class BillingSubscriptionRepository extends BaseRepository
{
public function save($data, BillingSubscription $billing_subscription): ?BillingSubscription
{
$billing_subscription
->fill($data)
->save();
return $billing_subscription;
}
}

View File

@ -107,6 +107,9 @@ class UserRepository extends BaseRepository
public function destroy(array $data, User $user)
{
if($user->isOwner())
return $user;
if (array_key_exists('company_user', $data)) {
$this->forced_includes = 'company_users';

View File

@ -0,0 +1,70 @@
<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2021. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Transformers;
use App\Models\BillingSubscription;
use App\Utils\Traits\MakesHash;
class BillingSubscriptionTransformer extends EntityTransformer
{
use MakesHash;
/**
* @var array
*/
protected $defaultIncludes = [];
/**
* @var array
*/
protected $availableIncludes = [
'products',
];
public function transform(BillingSubscription $billing_subscription): array
{
return [
'id' => $this->encodePrimaryKey($billing_subscription->id),
'user_id' => $this->encodePrimaryKey($billing_subscription->user_id),
'product_id' => $this->encodePrimaryKey($billing_subscription->product_id),
'assigned_user_id' => $this->encodePrimaryKey($billing_subscription->assigned_user_id),
'company_id' => $this->encodePrimaryKey($billing_subscription->company_id),
'is_recurring' => (bool)$billing_subscription->is_recurring,
'frequency_id' => (string)$billing_subscription->frequency_id,
'auto_bill' => (string)$billing_subscription->auto_bill,
'promo_code' => (string)$billing_subscription->promo_code,
'promo_discount' => (string)$billing_subscription->promo_discount,
'is_amount_discount' => (bool)$billing_subscription->is_amount_discount,
'allow_cancellation' => (bool)$billing_subscription->allow_cancellation,
'per_set_enabled' => (bool)$billing_subscription->per_set_enabled,
'min_seats_limit' => (int)$billing_subscription->min_seats_limit,
'max_seats_limit' => (int)$billing_subscription->max_seats_limit,
'trial_enabled' => (bool)$billing_subscription->trial_enabled,
'trial_duration' => (string)$billing_subscription->trial_duration,
'allow_query_overrides' => (bool)$billing_subscription->allow_query_overrides,
'allow_plan_changes' => (bool)$billing_subscription->allow_plan_changes,
'plan_map' => (string)$billing_subscription->plan_map,
'refund_period' => (string)$billing_subscription->refund_period,
'webhook_configuration' => (string)$billing_subscription->webhook_configuration,
'is_deleted' => (bool)$billing_subscription->is_deleted,
];
}
public function includeProducts(BillingSubscription $billing_subscription): \League\Fractal\Resource\Item
{
$transformer = new ProductTransformer($this->serializer);
return $this->includeItem($billing_subscription->product, $transformer, Product::class);
}
}

View File

@ -236,7 +236,7 @@ class HtmlEngine
$data['$client.name'] = &$data['$client_name'];
$data['$client.address1'] = &$data['$address1'];
$data['$client.address2'] = &$data['$address2'];
$data['$client_address'] = ['value' => $this->entity->present()->address() ?: '&nbsp;', 'label' => ctrans('texts.address')];
$data['$client_address'] = ['value' => $this->client->present()->address() ?: '&nbsp;', 'label' => ctrans('texts.address')];
$data['$client.address'] = &$data['$client_address'];
$data['$client.id_number'] = &$data['$id_number'];
$data['$client.vat_number'] = &$data['$vat_number'];
@ -271,7 +271,7 @@ class HtmlEngine
$data['$company.city_state_postal'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, false) ?: '&nbsp;', 'label' => ctrans('texts.city_state_postal')];
$data['$company.postal_city_state'] = ['value' => $this->company->present()->cityStateZip($this->settings->city, $this->settings->state, $this->settings->postal_code, true) ?: '&nbsp;', 'label' => ctrans('texts.postal_city_state')];
$data['$company.name'] = ['value' => $this->settings->name ?: '&nbsp;', 'label' => ctrans('texts.company_name')];
$data['$company.name'] = ['value' => $this->settings->name ?: ctrans('texts.untitled_account'), 'label' => ctrans('texts.company_name')];
$data['$company.address1'] = ['value' => $this->settings->address1 ?: '&nbsp;', 'label' => ctrans('texts.address1')];
$data['$company.address2'] = ['value' => $this->settings->address2 ?: '&nbsp;', 'label' => ctrans('texts.address2')];
$data['$company.city'] = ['value' => $this->settings->city ?: '&nbsp;', 'label' => ctrans('texts.city')];

View File

@ -88,9 +88,11 @@ class Phantom
$pdf = CurlUtils::get($phantom_url);
$this->checkMime($pdf, $invitation, $entity);
$instance = Storage::disk(config('filesystems.default'))->put($file_path, $pdf);
nlog($instance);
nlog($file_path);
return $file_path;
}

View File

@ -29,7 +29,7 @@ return [
'hash_salt' => env('HASH_SALT', ''),
'currency_converter_api_key' => env('OPENEXCHANGE_APP_ID', ''),
'enabled_modules' => 32767,
'phantomjs_key' => env('PHANTOMJS_KEY', false),
'phantomjs_key' => env('PHANTOMJS_KEY', 'a-demo-key-with-low-quota-per-ip-address'),
'phantomjs_secret' => env('PHANTOMJS_SECRET', false),
'phantomjs_pdf_generation' => env('PHANTOMJS_PDF_GENERATION', true),
'trusted_proxies' => env('TRUSTED_PROXIES', false),
@ -141,4 +141,5 @@ return [
'snappdf_chromium_path' => env('SNAPPDF_CHROMIUM_PATH', false),
'v4_migration_version' => '4.5.31',
'flutter_canvas_kit' => env('FLUTTER_CANVAS_KIT', false),
'webcron_secret' => env('WEBCRON_SECRET', false),
];

View File

@ -0,0 +1,71 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBillingSubscriptionsTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('billing_subscriptions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('user_id');
$table->unsignedInteger('assigned_user_id');
$table->unsignedInteger('company_id');
$table->unsignedInteger('product_id');
$table->boolean('is_recurring')->default(false);
$table->unsignedInteger('frequency_id');
$table->string('auto_bill')->default('');
$table->string('promo_code')->default('');
$table->float('promo_discount')->default(0);
$table->boolean('is_amount_discount')->default(false);
$table->boolean('allow_cancellation')->default(true);
$table->boolean('per_set_enabled')->default(false);
$table->unsignedInteger('min_seats_limit');
$table->unsignedInteger('max_seats_limit');
$table->boolean('trial_enabled')->default(false);
$table->unsignedInteger('trial_duration');
$table->boolean('allow_query_overrides')->default(false);
$table->boolean('allow_plan_changes')->default(false);
$table->mediumText('plan_map');
$table->unsignedInteger('refund_period')->nullable();
$table->mediumText('webhook_configuration');
$table->softDeletes('deleted_at', 6);
$table->boolean('is_deleted')->default(false);
$table->timestamps();
$table->foreign('product_id')->references('id')->on('products');
$table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade');
$table->index(['company_id', 'deleted_at']);
});
Schema::create('client_subscriptions', function (Blueprint $table) {
$table->increments('id');
$table->unsignedInteger('subscription_id');
$table->unsignedInteger('recurring_invoice_id');
$table->unsignedInteger('client_id');
$table->unsignedInteger('trial_started')->nullable();
$table->unsignedInteger('trial_ends')->nullable();
$table->timestamps();
$table->foreign('subscription_id')->references('id')->on('billing_subscriptions');
$table->foreign('recurring_invoice_id')->references('id')->on('recurring_invoices');
$table->foreign('client_id')->references('id')->on('clients');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('billing_subscriptions');
Schema::dropIfExists('client_subscriptions');
}
}

View File

@ -535,7 +535,7 @@ etc1
khronos
txt
vulkan
vulkan-deps
vulkan-headers
wuffs
Apache License
@ -758,36 +758,6 @@ distribution.
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
accessibility
Copyright (c) 2014 The Chromium Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following disclaimer
in the documentation and/or other materials provided with the
distribution.
* Neither the name of Google Inc. nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
@ -1750,40 +1720,6 @@ POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
angle
Copyright 2021 The ANGLE Project Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
Neither the name of TransGaming Inc., Google Inc., 3DLabs Inc.
Ltd., nor the names of their contributors may be used to endorse
or promote products derived from this software without specific
prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
angle
Copyright The ANGLE Project Authors. All rights reserved.
Redistribution and use in source and binary forms, with or without
@ -1915,14 +1851,28 @@ THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
angle
fuchsia_sdk
rapidjson
khronos
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
Copyright (c) 2007-2016 The Khronos Group Inc.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
--------------------------------------------------------------------------------
angle
khronos
@ -1951,6 +1901,30 @@ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
angle
khronos
Copyright (c) 2013-2016 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
--------------------------------------------------------------------------------
angle
khronos
Copyright (c) 2013-2017 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
@ -6308,31 +6282,6 @@ DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
draggable_scrollbar
The MIT License (MIT)
Copyright (c) 2018 Draggable Scrollbar Authors
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge,
publish, distribute, sublicense, and/or sell copies of the Software,
and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
extended_image
@ -8541,6 +8490,15 @@ negated the permissions granted in the license. In the spirit of
permissive licensing, and of not having licensing issues being an
obstacle to adoption, that text has been removed.
--------------------------------------------------------------------------------
fuchsia_sdk
rapidjson
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--------------------------------------------------------------------------------
glfw
Copyright (c) 2002-2006 Marcus Geelnard
@ -11974,29 +11932,6 @@ MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
--------------------------------------------------------------------------------
khronos
Copyright (c) 2007-2016 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
--------------------------------------------------------------------------------
khronos
Copyright (c) 2008-2009 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
@ -12010,29 +11945,6 @@ the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
--------------------------------------------------------------------------------
khronos
Copyright (c) 2013-2016 The Khronos Group Inc.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and/or associated documentation files (the
"Materials"), to deal in the Materials without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Materials, and to
permit persons to whom the Materials are furnished to do so, subject to
the following conditions:
The above copyright notice and this permission notice shall be included
in all copies or substantial portions of the Materials.
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
@ -15918,6 +15830,38 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
skia
Copyright 2012 Intel Inc.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
skia
Copyright 2012 The Android Open Source Project
Redistribution and use in source and binary forms, with or without
@ -16849,38 +16793,6 @@ skia
Copyright 2021 Google LLC.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in
the documentation and/or other materials provided with the
distribution.
* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived
from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
--------------------------------------------------------------------------------
skia
Copyright 2021 Google, LLC
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are
met:

View File

@ -3,36 +3,36 @@ const MANIFEST = 'flutter-app-manifest';
const TEMP = 'flutter-temp-cache';
const CACHE_NAME = 'flutter-app-cache';
const RESOURCES = {
"main.dart.js": "9642a825d6e3e0331a7b7a8095477684",
"favicon.ico": "51636d3a390451561744c42188ccd628",
"manifest.json": "77215c1737c7639764e64a192be2f7b8",
"icons/Icon-192.png": "bb1cf5f6982006952211c7c8404ffbed",
"icons/Icon-512.png": "0f9aff01367f0a0c69773d25ca16ef35",
"favicon.ico": "51636d3a390451561744c42188ccd628",
"assets/NOTICES": "1c2603c5ad0cd648934fe488850b4dea",
"assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac",
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
"assets/AssetManifest.json": "659dcf9d1baf3aed3ab1b9c42112bf8f",
"assets/assets/images/payment_types/dinerscard.png": "06d85186ba858c18ab7c9caa42c92024",
"assets/assets/images/payment_types/laser.png": "b4e6e93dd35517ac429301119ff05868",
"assets/assets/images/payment_types/solo.png": "2030c3ccaccf5d5e87916a62f5b084d6",
"assets/assets/images/payment_types/unionpay.png": "7002f52004e0ab8cc0b7450b0208ccb2",
"assets/assets/images/payment_types/paypal.png": "8e06c094c1871376dfea1da8088c29d1",
"assets/assets/images/payment_types/mastercard.png": "6f6cdc29ee2e22e06b1ac029cb52ef71",
"assets/assets/images/payment_types/discover.png": "6c0a386a00307f87db7bea366cca35f5",
"assets/assets/images/payment_types/ach.png": "7433f0aff779dc98a649b7a2daf777cf",
"assets/assets/images/payment_types/amex.png": "c49a4247984b3732a4af50a3390aa978",
"assets/assets/images/payment_types/other.png": "d936e11fa3884b8c9f1bd5c914be8629",
"assets/assets/images/payment_types/jcb.png": "07e0942d16c5592118b72e74f2f7198c",
"assets/assets/images/payment_types/carteblanche.png": "d936e11fa3884b8c9f1bd5c914be8629",
"assets/assets/images/payment_types/maestro.png": "e533b92bfb50339fdbfa79e3dfe81f08",
"assets/assets/images/payment_types/switch.png": "4fa11c45327f5fdc20205821b2cfd9cc",
"assets/assets/images/payment_types/visa.png": "3ddc4a4d25c946e8ad7e6998f30fd4e3",
"assets/assets/images/google-icon.png": "0f118259ce403274f407f5e982e681c3",
"assets/NOTICES": "a5e9ede1dfb62a7ca46881980b5a0798",
"assets/assets/images/logo.png": "090f69e23311a4b6d851b3880ae52541",
"assets/assets/images/payment_types/discover.png": "6c0a386a00307f87db7bea366cca35f5",
"assets/assets/images/payment_types/carteblanche.png": "d936e11fa3884b8c9f1bd5c914be8629",
"assets/assets/images/payment_types/visa.png": "3ddc4a4d25c946e8ad7e6998f30fd4e3",
"assets/assets/images/payment_types/paypal.png": "8e06c094c1871376dfea1da8088c29d1",
"assets/assets/images/payment_types/maestro.png": "e533b92bfb50339fdbfa79e3dfe81f08",
"assets/assets/images/payment_types/mastercard.png": "6f6cdc29ee2e22e06b1ac029cb52ef71",
"assets/assets/images/payment_types/amex.png": "c49a4247984b3732a4af50a3390aa978",
"assets/assets/images/payment_types/jcb.png": "07e0942d16c5592118b72e74f2f7198c",
"assets/assets/images/payment_types/dinerscard.png": "06d85186ba858c18ab7c9caa42c92024",
"assets/assets/images/payment_types/ach.png": "7433f0aff779dc98a649b7a2daf777cf",
"assets/assets/images/payment_types/solo.png": "2030c3ccaccf5d5e87916a62f5b084d6",
"assets/assets/images/payment_types/other.png": "d936e11fa3884b8c9f1bd5c914be8629",
"assets/assets/images/payment_types/laser.png": "b4e6e93dd35517ac429301119ff05868",
"assets/assets/images/payment_types/switch.png": "4fa11c45327f5fdc20205821b2cfd9cc",
"assets/assets/images/payment_types/unionpay.png": "7002f52004e0ab8cc0b7450b0208ccb2",
"assets/assets/images/google-icon.png": "0f118259ce403274f407f5e982e681c3",
"assets/fonts/MaterialIcons-Regular.otf": "1288c9e28052e028aba623321f7826ac",
"assets/AssetManifest.json": "659dcf9d1baf3aed3ab1b9c42112bf8f",
"assets/packages/material_design_icons_flutter/lib/fonts/materialdesignicons-webfont.ttf": "3e722fd57a6db80ee119f0e2c230ccff",
"assets/FontManifest.json": "cf3c681641169319e61b61bd0277378f",
"/": "23224b5e03519aaa87594403d54412cf",
"main.dart.js": "53da6fecadfcc13e83a501a510a76f81",
"version.json": "b7c8971e1ab5b627fd2a4317c52b843e",
"manifest.json": "77215c1737c7639764e64a192be2f7b8",
"favicon.png": "dca91c54388f52eded692718d5a98b8b",
"/": "23224b5e03519aaa87594403d54412cf"
"favicon.png": "dca91c54388f52eded692718d5a98b8b"
};
// The application shell files that are downloaded before a service worker can
@ -49,7 +49,7 @@ self.addEventListener("install", (event) => {
return event.waitUntil(
caches.open(TEMP).then((cache) => {
return cache.addAll(
CORE.map((value) => new Request(value, {'cache': 'reload'})));
CORE.map((value) => new Request(value + '?revision=' + RESOURCES[value], {'cache': 'reload'})));
})
);
});

File diff suppressed because one or more lines are too long

236869
public/main.dart.js vendored

File diff suppressed because one or more lines are too long

View File

@ -16,6 +16,6 @@
"/js/clients/quotes/approve.js": "/js/clients/quotes/approve.js?id=85bcae0a646882e56b12",
"/js/clients/shared/multiple-downloads.js": "/js/clients/shared/multiple-downloads.js?id=5c35d28cf0a3286e7c45",
"/js/clients/shared/pdf.js": "/js/clients/shared/pdf.js?id=fc3055d6a099f523ea98",
"/js/setup/setup.js": "/js/setup/setup.js?id=44bc4a71fc1d3606fc8e",
"/js/setup/setup.js": "/js/setup/setup.js?id=8c46629d6d43a29fce69",
"/css/card-js.min.css": "/css/card-js.min.css?id=62afeb675235451543ad"
}

View File

@ -23,6 +23,8 @@ class Setup {
}
handleDatabaseCheck() {
let url = document.querySelector('meta[name=setup-db-check]').content;
let data = {
db_host: document.querySelector('input[name="db_host"]').value,
db_port: document.querySelector('input[name="db_port"]').value,
@ -36,7 +38,7 @@ class Setup {
this.checkDbButton.disabled = true;
Axios.post('/setup/check_db', data)
Axios.post(url, data)
.then((response) =>
this.handleSuccess(this.checkDbAlert, 'mail-wrapper')
)
@ -46,6 +48,8 @@ class Setup {
}
handleSmtpCheck() {
let url = document.querySelector('meta[name=setup-email-check]').content;
let data = {
mail_driver: document.querySelector('select[name="mail_driver"]')
.value,
@ -71,7 +75,7 @@ class Setup {
return (this.checkSmtpButton.disabled = false);
}
Axios.post('/setup/check_mail', data)
Axios.post(url, data)
.then((response) => {
this.handleSuccess(this.checkSmtpAlert, 'account-wrapper');
this.handleSuccess(this.checkSmtpAlert, 'submit-wrapper');
@ -83,9 +87,10 @@ class Setup {
}
handleTestPdfCheck() {
let url = document.querySelector('meta[name=setup-pdf-check]').content;
this.checkPdfButton.disabled = true;
Axios.post('/setup/check_pdf', {})
Axios.post(url, {})
.then((response) => {
try {
let win = window.open(response.data.url, '_blank');

View File

@ -0,0 +1,125 @@
<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<!-- Error: {{ session('error') }} -->
@if (config('services.analytics.tracking_id'))
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-122229484-1"></script>
<script>
window.dataLayer = window.dataLayer || [];
function gtag() {
dataLayer.push(arguments);
}
gtag('js', new Date());
gtag('config', '{{ config('services.analytics.tracking_id') }}', {'anonymize_ip': true});
function trackEvent(category, action) {
ga('send', 'event', category, action, this.src);
}
</script>
<script>
Vue.config.devtools = true;
</script>
@else
<script>
function gtag() {
}
</script>
@endif
<!-- Title -->
@auth()
<title>@yield('meta_title', '') {{ auth('contact')->user()->user->account->isPaid() ? auth('contact')->user()->company->present()->name() : 'Invoice Ninja' }}</title>
@endauth
@guest
<title>@yield('meta_title', '') {{ config('app.name') }}</title>
@endguest
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="@yield('meta_description')"/>
<!-- CSRF Token -->
<meta name="csrf-token" content="{{ csrf_token() }}">
<!-- Scripts -->
@if(strpos(Request::url(),'setup') === false)
<script src="{{ mix('js/app.js') }}" defer></script>
@else
<script src="{{ str_replace("setup", "", Request::url())}}js/app.js" defer></script>
@endif
<script src="https://cdn.jsdelivr.net/gh/alpinejs/alpine@v2.7.x/dist/alpine.min.js" defer></script>
<!-- Fonts -->
<link rel="dns-prefetch" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css?family=Open+Sans&display=swap" rel="stylesheet" type="text/css">
<!-- Styles -->
@if(strpos(Request::url(),'setup') === false)
<link href="{{ mix('css/app.css') }}" rel="stylesheet">
@else
<link href="{{ str_replace("setup", "", Request::url())}}css/app.css" rel="stylesheet">
@endif
{{-- <link href="{{ mix('favicon.png') }}" rel="shortcut icon" type="image/png"> --}}
<link rel="canonical" href="{{ config('ninja.app_url') }}/{{ request()->path() }}"/>
{{-- Feel free to push anything to header using @push('header') --}}
@stack('head')
@if(strpos(Request::url(),'setup'))
<meta name="setup-pdf-check" content="{{ str_replace("setup", "", Request::url())}}setup/check_pdf">
<meta name="setup-db-check" content="{{ str_replace("setup", "", Request::url())}}setup/check_db">
<meta name="setup-email-check" content="{{ str_replace("setup", "", Request::url())}}setup/check_mail">
@endif
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.css" />
</head>
@include('portal.ninja2020.components.primary-color')
<body class="antialiased {{ $custom_body_class ?? '' }}">
@if(session()->has('message'))
<div class="py-1 text-sm text-center text-white bg-primary disposable-alert">
{{ session('message') }}
</div>
@endif
@yield('body')
<script src="https://cdn.jsdelivr.net/npm/cookieconsent@3/build/cookieconsent.min.js" data-cfasync="false"></script>
<script>
window.addEventListener("load", function(){
if (! window.cookieconsent) {
return;
}
window.cookieconsent.initialise({
"palette": {
"popup": {
"background": "#000"
},
"button": {
"background": "#f1d600"
},
},
"content": {
"href": "https://www.invoiceninja.com/privacy-policy/",
"message": "This website uses cookies to ensure you get the best experience on our website.",
"dismiss": "Got it!",
"link": "Learn more",
}
})}
);
</script>
</body>
<footer>
@yield('footer')
@stack('footer')
</footer>
</html>

View File

@ -1,4 +1,4 @@
@extends('portal.ninja2020.layout.clean')
@extends('portal.ninja2020.layout.clean_setup')
@section('meta_title', ctrans('texts.setup'))
@section('body')

View File

@ -68,7 +68,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::post('emails', 'EmailController@send')->name('email.send')->middleware('user_verified');
Route::resource('expenses', 'ExpenseController'); // name = (expenses. index / create / show / update / destroy / edit
Route::put('expenses/{expense}/upload', 'ExpenseController@upload');
Route::put('expenses/{expense}/upload', 'ExpenseController@upload');
Route::post('expenses/bulk', 'ExpenseController@bulk')->name('expenses.bulk');
Route::resource('expense_categories', 'ExpenseCategoryController'); // name = (expense_categories. index / create / show / update / destroy / edit
@ -98,7 +98,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::resource('payments', 'PaymentController'); // name = (payments. index / create / show / update / destroy / edit
Route::post('payments/refund', 'PaymentController@refund')->name('payments.refund');
Route::post('payments/bulk', 'PaymentController@bulk')->name('payments.bulk');
Route::put('payments/{payment}/upload', 'PaymentController@upload');
Route::put('payments/{payment}/upload', 'PaymentController@upload');
Route::resource('payment_terms', 'PaymentTermController'); // name = (payments. index / create / show / update / destroy / edit
Route::post('payment_terms/bulk', 'PaymentTermController@bulk')->name('payment_terms.bulk');
@ -107,20 +107,20 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::resource('products', 'ProductController'); // name = (products. index / create / show / update / destroy / edit
Route::post('products/bulk', 'ProductController@bulk')->name('products.bulk');
Route::put('products/{product}/upload', 'ProductController@upload');
Route::put('products/{product}/upload', 'ProductController@upload');
Route::resource('projects', 'ProjectController'); // name = (projects. index / create / show / update / destroy / edit
Route::post('projects/bulk', 'ProjectController@bulk')->name('projects.bulk');
Route::put('projects/{project}/upload', 'ProjectController@upload')->name('projects.upload');
Route::resource('quotes', 'QuoteController'); // name = (quotes. index / create / show / update / destroy / edit
Route::get('quotes/{quote}/{action}', 'QuoteController@action')->name('quotes.action');
Route::post('quotes/bulk', 'QuoteController@bulk')->name('quotes.bulk');
Route::put('quotes/{quote}/upload', 'QuoteController@upload');
Route::put('quotes/{quote}/upload', 'QuoteController@upload');
Route::resource('recurring_invoices', 'RecurringInvoiceController'); // name = (recurring_invoices. index / create / show / update / destroy / edit
Route::post('recurring_invoices/bulk', 'RecurringInvoiceController@bulk')->name('recurring_invoices.bulk');
Route::put('recurring_invoices/{recurring_invoice}/upload', 'RecurringInvoiceController@upload');
Route::put('recurring_invoices/{recurring_invoice}/upload', 'RecurringInvoiceController@upload');
Route::resource('recurring_quotes', 'RecurringQuoteController'); // name = (recurring_invoices. index / create / show / update / destroy / edit
Route::post('recurring_quotes/bulk', 'RecurringQuoteController@bulk')->name('recurring_quotes.bulk');
@ -137,7 +137,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::resource('tasks', 'TaskController'); // name = (tasks. index / create / show / update / destroy / edit
Route::post('tasks/bulk', 'TaskController@bulk')->name('tasks.bulk');
Route::put('tasks/{task}/upload', 'TaskController@upload');
Route::put('tasks/{task}/upload', 'TaskController@upload');
Route::resource('task_statuses', 'TaskStatusController'); // name = (task_statuses. index / create / show / update / destroy / edit
Route::post('task_statuses/bulk', 'TaskStatusController@bulk')->name('task_statuses.bulk');
@ -155,7 +155,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
Route::resource('vendors', 'VendorController'); // name = (vendors. index / create / show / update / destroy / edit
Route::post('vendors/bulk', 'VendorController@bulk')->name('vendors.bulk');
Route::put('vendors/{vendor}/upload', 'VendorController@upload');
Route::put('vendors/{vendor}/upload', 'VendorController@upload');
Route::get('users', 'UserController@index');
Route::put('users/{user}', 'UserController@update')->middleware('password_protected');
@ -173,7 +173,7 @@ Route::group(['middleware' => ['api_db', 'token_auth', 'locale'], 'prefix' => 'a
// Route::post('hooks', 'SubscriptionController@subscribe')->name('hooks.subscribe');
// Route::delete('hooks/{subscription_id}', 'SubscriptionController@unsubscribe')->name('hooks.unsubscribe');
Route::resource('billing/subscriptions', 'BillingSubscriptionController');
});
Route::match(['get', 'post'], 'payment_webhook/{company_key}/{company_gateway_id}', 'PaymentWebhookController')
@ -182,5 +182,5 @@ Route::match(['get', 'post'], 'payment_webhook/{company_key}/{company_gateway_id
Route::post('api/v1/postmark_webhook', 'PostMarkController@webhook');
Route::get('token_hash_router', 'OneTimeTokenController@router');
Route::get('webcron', 'WebCronController@index');
Route::fallback('BaseController@notFound');