diff --git a/.gitignore b/.gitignore index 764b589..8ea898f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ vendor .env -composer.lock \ No newline at end of file +composer.lock +storage diff --git a/config/debugbar.php b/config/debugbar.php index fe3b192..5c4643c 100644 --- a/config/debugbar.php +++ b/config/debugbar.php @@ -92,7 +92,7 @@ return [ | Vendor files are included by default, but can be set to false. | This can also be set to 'js' or 'css', to only include javascript or css vendor files. | Vendor files are for css: font-awesome (including fonts) and highlight.js (css files) - | and for js: jquery and and highlight.js + | and for js: jquery and highlight.js | So if you want syntax highlighting, set it to true. | jQuery is set to not conflict with existing jQuery scripts. | @@ -198,7 +198,8 @@ return [ 'types' => ['SELECT'], // Deprecated setting, is always only SELECT ], 'hints' => false, // Show hints for common mistakes - 'show_copy' => false, // Show copy button next to the query + 'show_copy' => false, // Show copy button next to the query, + 'slow_threshold' => false, // Only track queries that last longer than this time in ms ], 'mail' => [ 'full_log' => false, @@ -206,6 +207,7 @@ return [ 'views' => [ 'timeline' => false, // Add the views to the timeline (Experimental) 'data' => false, //Note: Can slow down the application, because the data can be quite large.. + 'exclude_paths' => [], // Add the paths which you don't want to appear in the views ], 'route' => [ 'label' => true, // show complete route on bar diff --git a/config/dompdf.php b/config/dompdf.php index 9a99305..692a131 100644 --- a/config/dompdf.php +++ b/config/dompdf.php @@ -13,6 +13,10 @@ return array( */ 'show_warnings' => false, // Throw an Exception on warnings from dompdf 'orientation' => 'portrait', + /* + * Dejavu Sans font is missing glyphs for converted entities, turn it off if you need to show € and £. + */ + 'convert_entities' => true, 'defines' => array( /** * The location of the DOMPDF font directory @@ -38,7 +42,7 @@ return array( * Times-Roman, Times-Bold, Times-BoldItalic, Times-Italic, * Symbol, ZapfDingbats. */ - "font_dir" => storage_path('fonts/'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) + "font_dir" => storage_path('fonts'), // advised by dompdf (https://github.com/dompdf/dompdf/pull/782) /** * The location of the DOMPDF font cache directory @@ -48,7 +52,7 @@ return array( * * Note: This directory must exist and be writable by the webserver process. */ - "font_cache" => storage_path('fonts/'), + "font_cache" => storage_path('fonts'), /** * The location of a temporary directory. diff --git a/config/excel.php b/config/excel.php index f4d1e78..987883e 100644 --- a/config/excel.php +++ b/config/excel.php @@ -49,6 +49,7 @@ return [ 'include_separator_line' => false, 'excel_compatibility' => false, 'output_encoding' => '', + 'test_auto_detect' => true, ], /* @@ -122,7 +123,7 @@ return [ | */ 'csv' => [ - 'delimiter' => ',', + 'delimiter' => null, 'enclosure' => '"', 'escape_character' => '\\', 'contiguous' => false, @@ -219,7 +220,7 @@ return [ | By default PhpSpreadsheet keeps all cell values in memory, however when | dealing with large files, this might result into memory issues. If you | want to mitigate that, you can configure a cell caching driver here. - | When using the illuminate driver, it will store each value in a the + | When using the illuminate driver, it will store each value in the | cache store. This can slow down the process, because it needs to | store each value. You can use the "batch" store if you want to | only persist to the store when the memory limit is reached. diff --git a/config/flare.php b/config/flare.php index 48fc07d..a4896f3 100644 --- a/config/flare.php +++ b/config/flare.php @@ -1,5 +1,17 @@ [ - 'anonymize_ips' => true, - 'collect_git_information' => false, - 'report_queries' => true, - 'maximum_number_of_collected_queries' => 200, - 'report_query_bindings' => true, - 'report_view_data' => true, - 'grouping_type' => null, - 'report_logs' => true, - 'maximum_number_of_collected_logs' => 200, - 'censor_request_body_fields' => ['password'], + 'flare_middleware' => [ + RemoveRequestIp::class, + AddGitInformation::class, + AddNotifierName::class, + AddEnvironmentInformation::class, + AddExceptionInformation::class, + AddDumps::class, + AddLogs::class => [ + 'maximum_number_of_collected_logs' => 200, + ], + AddQueries::class => [ + 'maximum_number_of_collected_queries' => 200, + 'report_query_bindings' => true, + ], + AddJobs::class => [ + 'max_chained_job_reporting_depth' => 5, + ], + CensorRequestBodyFields::class => [ + 'censor_fields' => [ + 'password', + 'password_confirmation', + ], + ], + CensorRequestHeaders::class => [ + 'headers' => [ + 'API-KEY', + ] + ] ], /* |-------------------------------------------------------------------------- - | Reporting Log statements + | Reporting log statements |-------------------------------------------------------------------------- | | If this setting is `false` log statements won't be sent as events to Flare, @@ -48,15 +77,4 @@ return [ */ 'send_logs_as_events' => true, - - /* - |-------------------------------------------------------------------------- - | Censor request body fields - |-------------------------------------------------------------------------- - | - | These fields will be censored from your request when sent to Flare. - | - */ - - 'censor_request_body_fields' => ['password'], ]; diff --git a/config/ignition.php b/config/ignition.php index 268d2f2..a4fe3ce 100644 --- a/config/ignition.php +++ b/config/ignition.php @@ -1,5 +1,28 @@ env('IGNITION_THEME', 'light'), + 'theme' => env('IGNITION_THEME', 'auto'), /* |-------------------------------------------------------------------------- @@ -56,8 +79,44 @@ return [ | You can enable the command registration below. | */ + 'register_commands' => env('REGISTER_IGNITION_COMMANDS', false), + /* + |-------------------------------------------------------------------------- + | Solution Providers + |-------------------------------------------------------------------------- + | + | You may specify a list of solution providers (as fully qualified class + | names) that shouldn't be loaded. Ignition will ignore these classes + | and possible solutions provided by them will never be displayed. + | + */ + + 'solution_providers' => [ + // from spatie/ignition + BadMethodCallSolutionProvider::class, + MergeConflictSolutionProvider::class, + UndefinedPropertySolutionProvider::class, + + // from spatie/laravel-ignition + IncorrectValetDbCredentialsSolutionProvider::class, + MissingAppKeySolutionProvider::class, + DefaultDbNameSolutionProvider::class, + TableNotFoundSolutionProvider::class, + MissingImportSolutionProvider::class, + InvalidRouteActionSolutionProvider::class, + ViewNotFoundSolutionProvider::class, + RunningLaravelDuskInProductionProvider::class, + MissingColumnSolutionProvider::class, + UnknownValidationSolutionProvider::class, + MissingMixManifestSolutionProvider::class, + MissingViteManifestSolutionProvider::class, + MissingLivewireComponentSolutionProvider::class, + UndefinedViewVariableSolutionProvider::class, + GenericLaravelExceptionSolutionProvider::class, + ], + /* |-------------------------------------------------------------------------- | Ignored Solution Providers @@ -70,7 +129,7 @@ return [ */ 'ignored_solution_providers' => [ - \Facade\Ignition\SolutionProviders\MissingPackageSolutionProvider::class, + ], /* @@ -79,12 +138,19 @@ return [ |-------------------------------------------------------------------------- | | Some solutions that Ignition displays are runnable and can perform - | various tasks. Runnable solutions are enabled when your app has - | debug mode enabled. You may also fully disable this feature. + | various tasks. By default, runnable solutions are only enabled when your + | app has debug mode enabled and the environment is `local` or + | `development`. + | + | Using the `IGNITION_ENABLE_RUNNABLE_SOLUTIONS` environment variable, you + | can override this behaviour and enable or disable runnable solutions + | regardless of the application's environment. + | + | Default: env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS') | */ - 'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS', null), + 'enable_runnable_solutions' => env('IGNITION_ENABLE_RUNNABLE_SOLUTIONS'), /* |-------------------------------------------------------------------------- @@ -109,7 +175,7 @@ return [ | */ - 'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', ''), + 'remote_sites_path' => env('IGNITION_REMOTE_SITES_PATH', base_path()), 'local_sites_path' => env('IGNITION_LOCAL_SITES_PATH', ''), /* @@ -121,6 +187,48 @@ return [ | specify a route prefix that will be used to host all internal links. | */ + 'housekeeping_endpoint_prefix' => '_ignition', + /* + |-------------------------------------------------------------------------- + | Settings File + |-------------------------------------------------------------------------- + | + | Ignition allows you to save your settings to a specific global file. + | + | If no path is specified, a file with settings will be saved to the user's + | home directory. The directory depends on the OS and its settings but it's + | typically `~/.ignition.json`. In this case, the settings will be applied + | to all of your projects where Ignition is used and the path is not + | specified. + | + | However, if you want to store your settings on a project basis, or you + | want to keep them in another directory, you can specify a path where + | the settings file will be saved. The path should be an existing directory + | with correct write access. + | For example, create a new `ignition` folder in the storage directory and + | use `storage_path('ignition')` as the `settings_file_path`. + | + | Default value: '' (empty string) + */ + + 'settings_file_path' => '', + + /* + |-------------------------------------------------------------------------- + | Recorders + |-------------------------------------------------------------------------- + | + | Ignition registers a couple of recorders when it is enabled. Below you may + | specify a recorders will be used to record specific events. + | + */ + + 'recorders' => [ + DumpRecorder::class, + JobRecorder::class, + LogRecorder::class, + QueryRecorder::class + ] ]; diff --git a/config/trustedproxy.php b/config/trustedproxy.php deleted file mode 100644 index e618ae2..0000000 --- a/config/trustedproxy.php +++ /dev/null @@ -1,50 +0,0 @@ - null, // [,], '*', ',' - - /* - * To trust one or more specific proxies that connect - * directly to your server, use an array or a string separated by comma of IP addresses: - */ - // 'proxies' => ['192.168.1.1'], - // 'proxies' => '192.168.1.1, 192.168.1.2', - - /* - * Or, to trust all proxies that connect - * directly to your server, use a "*" - */ - // 'proxies' => '*', - - /* - * Which headers to use to detect proxy related data (For, Host, Proto, Port) - * - * Options include: - * - * - Illuminate\Http\Request::HEADER_X_FORWARDED_ALL (use all x-forwarded-* headers to establish trust) - * - Illuminate\Http\Request::HEADER_FORWARDED (use the FORWARDED header to establish trust) - * - Illuminate\Http\Request::HEADER_X_FORWARDED_AWS_ELB (If you are using AWS Elastic Load Balancer) - * - * - 'HEADER_X_FORWARDED_ALL' (use all x-forwarded-* headers to establish trust) - * - 'HEADER_FORWARDED' (use the FORWARDED header to establish trust) - * - 'HEADER_X_FORWARDED_AWS_ELB' (If you are using AWS Elastic Load Balancer) - * - * @link https://symfony.com/doc/current/deployment/proxies.html - */ - 'headers' => Illuminate\Http\Request::HEADER_X_FORWARDED_ALL, - -]; diff --git a/packages/Sarga/API/Http/Controllers/SellerProduct.php b/packages/Sarga/API/Http/Controllers/SellerProduct.php index 5fe2b91..bf719c1 100644 --- a/packages/Sarga/API/Http/Controllers/SellerProduct.php +++ b/packages/Sarga/API/Http/Controllers/SellerProduct.php @@ -228,6 +228,13 @@ class SellerProduct extends SellerProductController // \Log::info($product); + //$images = json_decode($request['images']['files'][0]); + //\Log::info($images); + //\Log::info($request->all()); + \Log::info($request['images']); + \Log::info($request['surats']); +// dd($request->get('images')); +// dd($request['images']); $data = array( "status" => $request->get('status'), "product_number" => $request->get('product_number'), diff --git a/packages/Sarga/API/Http/Controllers/SellerProduct.php.save b/packages/Sarga/API/Http/Controllers/SellerProduct.php.save new file mode 100644 index 0000000..37107c0 --- /dev/null +++ b/packages/Sarga/API/Http/Controllers/SellerProduct.php.save @@ -0,0 +1,249 @@ +_config = request('_config'); + $this->productRepository = $productRepository; + $this->sellerRepository = $sellerRepository; + } + + + public function sellerOrders(Request $request) + { + $validation = Validator::make($request->all(), [ + 'seller_id' => 'required', + 'user' => 'required', + 'password' => 'required', + ]); + + + if ($validation->fails()) { + return response()->json(['errors' => $validation->getMessageBag()->all()], 422); + } + + $user = $request->get('user'); + $pass = $request->get('password'); + + if ($user == "romanah_" && $pass == "bt110226$$") { + + $seller = $this->sellerRepository->isSellerMarket($request->get('seller_id')); + + if ($seller) { + $orders = SellerOrderModel::where('marketplace_seller_id', $seller->id)->with('order.customer')->paginate(15); + return response($orders); + } else { + return response([ + 'status' => 500, + 'message' => 'not found seller' + ]); + } + } else { + return response([ + 'status' => 500, + 'message' => 'not authorized' + ]); + } + } + + public function storeSellerProd(Request $request) + { + $data = $request->all(); + $validation = Validator::make($request->all(), [ + 'type' => 'required', + 'sku' => ['required', 'unique:products,sku', new \Webkul\Core\Contracts\Validations\Slug], + 'marketplace_seller_id' => 'required', + 'user' => 'required', + 'password' => 'required', + ]); + + + if ($validation->fails()) { + return response()->json(['errors' => $validation->getMessageBag()->all()], 422); + } + + $user = $request->get('user'); + $pass = $request->get('password'); + + if ($user == "romanah_" && $pass == "bt110226$$") { + + $product = new Product; + + $product->type = 'simple'; + $product->attribute_family_id = '1'; + $product->sku = $request->get('sku'); + $product->save(); + + if (!$product) { + response([ + 'error' => "error create prod" + ]); + } + + $sellerProduct = new SellerProductModel; + $sellerProduct->price = 0; + $sellerProduct->description = ""; + $sellerProduct->is_approved = 0; + $sellerProduct->is_owner = 0; + $sellerProduct->product_id = $product->id; + $sellerProduct->marketplace_seller_id = $request->get('marketplace_seller_id'); + $sellerProduct->save(); + + if (!$sellerProduct) { + response([ + 'error' => "error create SELLER prod" + ]); + } + + $productInventory = ProductInventory::create([ + 'qty' => 0, + 'product_id' => $product->id, + 'inventory_source_id' => 1, + 'vendor_id' => $request->get('marketplace_seller_id') + ]); + + if (!$productInventory) { + response([ + 'error' => "error create prod inventory" + ]); + } + + return response([ + 'status' => 200, + 'data' => $product, + 'message' => 'succesfully created product' + ]); + } else { + return response([ + 'status' => 500, + 'message' => 'not authorized' + ]); + } + } + + public function updateProductFlat(Request $request) + { + $validation = Validator::make($request->all(), [ + 'product_id' => 'required', + 'user' => 'required', + 'password' => 'required', + ]); + + + if ($validation->fails()) { + return response()->json(['errors' => $validation->getMessageBag()->all()], 422); + } + + $user = $request->get('user'); + $pass = $request->get('password'); + + if ($user == "romanah_" && $pass == "bt110226$$") { + + $prodId = $request->get('product_id'); + + // $product = ProductFlat::where('product_id', $prodId)->first(); + + // \Log::info($product); + + \Log::info($request['images']['files'][0]); + +// dd($request->get('images')); +// dd($request['images']); + $data = array( + "status" => $request->get('status'), + "product_number" => $request->get('product_number'), + "name" => $request->get('name'), + "description" => $request->get('description'), + "url_key" => Str::slug($request->get('name')), + "featured" => $request->get('featured'), + "status" => $request->get('status'), + "price" => $request->get('price'), + "special_price" => $request->get('special_price'), + "weight" => 0, + "visible_individually" => 1, + "locale" => 'tm', + "channel" => 'Nurgul', + "short_description" => $request->get('short_description'), + "images" => $request['images'], + ); + + $product = $this->productRepository->update($data, $prodId, 'id'); + + + $productInventory = ProductInventory::where('product_id', $prodId)->first(); + if ($productInventory) { + $productInventory->qty = $request->get('qty'); + $productInventory->save(); + } else { + return response([ + 'status' => 500, + 'message' => 'cant find product inv' + ]); + } + + if ($product && $productInventory) { + return response([ + 'status' => 200, + 'data' => $product, + 'message' => 'succesfully updated product' + ]); + } else { + return response([ + 'status' => 500, + 'message' => 'cant update product' + ]); + } + } else { + return response([ + 'status' => 500, + 'message' => 'not authorized' + ]); + } + } +} diff --git a/packages/Sarga/API/Http/Controllers/SellerProduct.php.save.1 b/packages/Sarga/API/Http/Controllers/SellerProduct.php.save.1 new file mode 100644 index 0000000..0c34f93 --- /dev/null +++ b/packages/Sarga/API/Http/Controllers/SellerProduct.php.save.1 @@ -0,0 +1,250 @@ +_config = request('_config'); + $this->productRepository = $productRepository; + $this->sellerRepository = $sellerRepository; + } + + + public function sellerOrders(Request $request) + { + $validation = Validator::make($request->all(), [ + 'seller_id' => 'required', + 'user' => 'required', + 'password' => 'required', + ]); + + + if ($validation->fails()) { + return response()->json(['errors' => $validation->getMessageBag()->all()], 422); + } + + $user = $request->get('user'); + $pass = $request->get('password'); + + if ($user == "romanah_" && $pass == "bt110226$$") { + + $seller = $this->sellerRepository->isSellerMarket($request->get('seller_id')); + + if ($seller) { + $orders = SellerOrderModel::where('marketplace_seller_id', $seller->id)->with('order.customer')->paginate(15); + return response($orders); + } else { + return response([ + 'status' => 500, + 'message' => 'not found seller' + ]); + } + } else { + return response([ + 'status' => 500, + 'message' => 'not authorized' + ]); + } + } + + public function storeSellerProd(Request $request) + { + $data = $request->all(); + $validation = Validator::make($request->all(), [ + 'type' => 'required', + 'sku' => ['required', 'unique:products,sku', new \Webkul\Core\Contracts\Validations\Slug], + 'marketplace_seller_id' => 'required', + 'user' => 'required', + 'password' => 'required', + ]); + + + if ($validation->fails()) { + return response()->json(['errors' => $validation->getMessageBag()->all()], 422); + } + + $user = $request->get('user'); + $pass = $request->get('password'); + + if ($user == "romanah_" && $pass == "bt110226$$") { + + $product = new Product; + + $product->type = 'simple'; + $product->attribute_family_id = '1'; + $product->sku = $request->get('sku'); + $product->save(); + + if (!$product) { + response([ + 'error' => "error create prod" + ]); + } + + $sellerProduct = new SellerProductModel; + $sellerProduct->price = 0; + $sellerProduct->description = ""; + $sellerProduct->is_approved = 0; + $sellerProduct->is_owner = 0; + $sellerProduct->product_id = $product->id; + $sellerProduct->marketplace_seller_id = $request->get('marketplace_seller_id'); + $sellerProduct->save(); + + if (!$sellerProduct) { + response([ + 'error' => "error create SELLER prod" + ]); + } + + $productInventory = ProductInventory::create([ + 'qty' => 0, + 'product_id' => $product->id, + 'inventory_source_id' => 1, + 'vendor_id' => $request->get('marketplace_seller_id') + ]); + + if (!$productInventory) { + response([ + 'error' => "error create prod inventory" + ]); + } + + return response([ + 'status' => 200, + 'data' => $product, + 'message' => 'succesfully created product' + ]); + } else { + return response([ + 'status' => 500, + 'message' => 'not authorized' + ]); + } + } + + public function updateProductFlat(Request $request) + { + $validation = Validator::make($request->all(), [ + 'product_id' => 'required', + 'user' => 'required', + 'password' => 'required', + ]); + + + if ($validation->fails()) { + return response()->json(['errors' => $validation->getMessageBag()->all()], 422); + } + + $user = $request->get('user'); + $pass = $request->get('password'); + + if ($user == "romanah_" && $pass == "bt110226$$") { + + $prodId = $request->get('product_id'); + + // $product = ProductFlat::where('product_id', $prodId)->first(); + + // \Log::info($product); + + +// \Log::info($request['images']['files']); +// \Log::info($request['imagess']['files']); +// dd($request->get('images')); +// dd($request['images']); + $data = array( + "status" => $request->get('status'), + "product_number" => $request->get('product_number'), + "name" => $request->get('name'), + "description" => $request->get('description'), + "url_key" => Str::slug($request->get('name')), + "featured" => $request->get('featured'), + "status" => $request->get('status'), + "price" => $request->get('price'), + "special_price" => $request->get('special_price'), + "weight" => 0, + "visible_individually" => 1, + "locale" => 'tm', + "channel" => 'Nurgul', + "short_description" => $request->get('short_description'), + "images" => $request['images'], + ); + + $product = $this->productRepository->update($data, $prodId, 'id'); + + + $productInventory = ProductInventory::where('product_id', $prodId)->first(); + if ($productInventory) { + $productInventory->qty = $request->get('qty'); + $productInventory->save(); + } else { + return response([ + 'status' => 500, + 'message' => 'cant find product inv' + ]); + } + + if ($product && $productInventory) { + return response([ + 'status' => 200, + 'data' => $product, + 'message' => 'succesfully updated product' + ]); + } else { + return response([ + 'status' => 500, + 'message' => 'cant update product' + ]); + } + } else { + return response([ + 'status' => 500, + 'message' => 'not authorized' + ]); + } + } +} diff --git a/public/storage b/public/storage index 2be32c6..18259e7 120000 --- a/public/storage +++ b/public/storage @@ -1 +1 @@ -/Users/tmstore/Desktop/projects old/new folder/nurGul/nurgul_backend/storage/app/public \ No newline at end of file +/var/www/nurgulbackend/storage/app/public \ No newline at end of file diff --git a/resources/views/errors/402.blade.php b/resources/views/errors/402.blade.php new file mode 100644 index 0000000..3bc23ef --- /dev/null +++ b/resources/views/errors/402.blade.php @@ -0,0 +1,5 @@ +@extends('errors::minimal') + +@section('title', __('Payment Required')) +@section('code', '402') +@section('message', __('Payment Required')) diff --git a/resources/views/errors/layout.blade.php b/resources/views/errors/layout.blade.php index 4f2318f..019c2cd 100644 --- a/resources/views/errors/layout.blade.php +++ b/resources/views/errors/layout.blade.php @@ -6,16 +6,12 @@ @yield('title') - - - -