diff --git a/app/Http/Middleware/AdminMiddleware.php b/app/Http/Middleware/AdminMiddleware.php deleted file mode 100644 index 12341fcc..00000000 --- a/app/Http/Middleware/AdminMiddleware.php +++ /dev/null @@ -1,30 +0,0 @@ -guest() || ! Auth::user()->isSuperAdminOrAdmin()) { - if ($request->ajax() || $request->wantsJson()) { - return response('Unauthorized.', 401); - } else { - return response()->json(['error' => 'user_is_not_admin'], 404); - } - } - - return $next($request); - } -} diff --git a/app/Http/Requests/CompanySettingRequest.php b/app/Http/Requests/CompanySettingRequest.php deleted file mode 100644 index 2513cdc4..00000000 --- a/app/Http/Requests/CompanySettingRequest.php +++ /dev/null @@ -1,52 +0,0 @@ - [ - 'required', - ], - 'time_zone' => [ - 'required', - ], - 'language' => [ - 'required', - ], - 'fiscal_year' => [ - 'required', - ], - 'moment_date_format' => [ - 'required', - ], - 'carbon_date_format' => [ - 'required', - ], - 'moment_time_format' => [ - 'required', - ], - 'carbon_time_format' => [ - 'required', - ], - 'invoice_use_time' => [ - 'required', - ], - ]; - } -} diff --git a/app/Http/Requests/CustomerEstimateStatusRequest.php b/app/Http/Requests/CustomerEstimateStatusRequest.php deleted file mode 100644 index 05211693..00000000 --- a/app/Http/Requests/CustomerEstimateStatusRequest.php +++ /dev/null @@ -1,29 +0,0 @@ - [ - 'required', - 'in:ACCEPTED,REJECTED', - ], - ]; - } -} diff --git a/app/Http/Requests/ExchangeRateLogRequest.php b/app/Http/Requests/ExchangeRateLogRequest.php deleted file mode 100644 index 07d98d2c..00000000 --- a/app/Http/Requests/ExchangeRateLogRequest.php +++ /dev/null @@ -1,49 +0,0 @@ - [ - 'required', - ], - 'currency_id' => [ - 'required', - ], - ]; - } - - public function getExchangeRateLogPayload() - { - $companyCurrency = CompanySetting::getSetting( - 'currency', - $this->header('company') - ); - - if ($this->currency_id !== $companyCurrency) { - return collect($this->validated()) - ->merge([ - 'company_id' => $this->header('company'), - 'base_currency_id' => $companyCurrency, - ]) - ->toArray(); - } - } -} diff --git a/app/Http/Requests/SettingKeyRequest.php b/app/Http/Requests/SettingKeyRequest.php deleted file mode 100644 index fbee5581..00000000 --- a/app/Http/Requests/SettingKeyRequest.php +++ /dev/null @@ -1,28 +0,0 @@ - [ - 'required', - ], - ]; - } -} diff --git a/app/Http/Resources/AbilityCollection.php b/app/Http/Resources/AbilityCollection.php deleted file mode 100644 index 4b57274e..00000000 --- a/app/Http/Resources/AbilityCollection.php +++ /dev/null @@ -1,19 +0,0 @@ - $this->id, - 'name' => $this->name, - 'entity_id' => $this->entity_id, - 'entity_type' => $this->entity_type, - 'only_owned' => $this->only_owned, - 'options' => $this->options, - 'scope' => $this->scope, - ]; - } -} diff --git a/app/Http/Resources/Customer/AddressCollection.php b/app/Http/Resources/Customer/AddressCollection.php deleted file mode 100644 index 319638cc..00000000 --- a/app/Http/Resources/Customer/AddressCollection.php +++ /dev/null @@ -1,19 +0,0 @@ - $this->id, - 'starts_at' => $this->starts_at, - 'formatted_starts_at' => $this->formattedStartsAt, - 'formatted_created_at' => $this->formattedCreatedAt, - 'formatted_next_invoice_at' => $this->formattedNextInvoiceAt, - 'formatted_limit_date' => $this->formattedLimitDate, - 'send_automatically' => $this->send_automatically, - 'customer_id' => $this->customer_id, - 'company_id' => $this->company_id, - 'status' => $this->status, - 'next_invoice_at' => $this->next_invoice_at, - 'frequency' => $this->frequency, - 'limit_by' => $this->limit_by, - 'limit_count' => $this->limit_count, - 'limit_date' => $this->limit_date, - 'exchange_rate' => $this->exchange_rate, - 'tax_per_item' => $this->tax_per_item, - 'discount_per_item' => $this->discount_per_item, - 'notes' => $this->notes, - 'discount_type' => $this->discount_type, - 'discount' => $this->discount, - 'discount_val' => $this->discount_val, - 'sub_total' => $this->sub_total, - 'total' => $this->total, - 'tax' => $this->tax, - 'due_amount' => $this->due_amount, - 'template_name' => $this->template_name, - 'fields' => $this->when($this->fields()->exists(), function () { - return CustomFieldValueResource::collection($this->fields); - }), - 'items' => $this->when($this->items()->exists(), function () { - return InvoiceItemResource::collection($this->items); - }), - 'customer' => $this->when($this->customer()->exists(), function () { - return new CustomerResource($this->customer); - }), - 'company' => $this->when($this->company()->exists(), function () { - return new CompanyResource($this->company); - }), - 'invoices' => $this->when($this->invoices()->exists(), function () { - return InvoiceResource::collection($this->invoices); - }), - 'taxes' => $this->when($this->taxes()->exists(), function () { - return TaxResource::collection($this->taxes); - }), - 'currency' => $this->when($this->currency()->exists(), function () { - return new CurrencyResource($this->currency); - }), - ]; - } -} diff --git a/app/Http/Resources/Customer/TaxTypeCollection.php b/app/Http/Resources/Customer/TaxTypeCollection.php deleted file mode 100644 index b211a387..00000000 --- a/app/Http/Resources/Customer/TaxTypeCollection.php +++ /dev/null @@ -1,19 +0,0 @@ - $this->id, - 'company_id' => $this->company_id, - 'base_currency_id' => $this->base_currency_id, - 'currency_id' => $this->currency_id, - 'exchange_rate' => $this->exchange_rate, - ]; - } -}