vendor api

This commit is contained in:
Shohrat 2023-09-02 12:57:53 +00:00
parent 04f137de87
commit 636fe6e8cc
14 changed files with 687 additions and 100 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
vendor
.env
composer.lock
storage

View File

@ -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

View File

@ -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.

View File

@ -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.

View File

@ -1,5 +1,17 @@
<?php
use Spatie\FlareClient\FlareMiddleware\AddGitInformation;
use Spatie\FlareClient\FlareMiddleware\RemoveRequestIp;
use Spatie\FlareClient\FlareMiddleware\CensorRequestBodyFields;
use Spatie\FlareClient\FlareMiddleware\CensorRequestHeaders;
use Spatie\LaravelIgnition\FlareMiddleware\AddDumps;
use Spatie\LaravelIgnition\FlareMiddleware\AddEnvironmentInformation;
use Spatie\LaravelIgnition\FlareMiddleware\AddExceptionInformation;
use Spatie\LaravelIgnition\FlareMiddleware\AddJobs;
use Spatie\LaravelIgnition\FlareMiddleware\AddLogs;
use Spatie\LaravelIgnition\FlareMiddleware\AddQueries;
use Spatie\LaravelIgnition\FlareMiddleware\AddNotifierName;
return [
/*
|
@ -17,29 +29,46 @@ return [
/*
|--------------------------------------------------------------------------
| Reporting Options
| Middleware
|--------------------------------------------------------------------------
|
| These options determine which information will be transmitted to Flare.
| These middleware will modify the contents of the report sent to Flare.
|
*/
'reporting' => [
'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'],
];

View File

@ -1,5 +1,28 @@
<?php
use Spatie\Ignition\Solutions\SolutionProviders\BadMethodCallSolutionProvider;
use Spatie\Ignition\Solutions\SolutionProviders\MergeConflictSolutionProvider;
use Spatie\Ignition\Solutions\SolutionProviders\UndefinedPropertySolutionProvider;
use Spatie\LaravelIgnition\Recorders\DumpRecorder\DumpRecorder;
use Spatie\LaravelIgnition\Recorders\JobRecorder\JobRecorder;
use Spatie\LaravelIgnition\Recorders\LogRecorder\LogRecorder;
use Spatie\LaravelIgnition\Recorders\QueryRecorder\QueryRecorder;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\DefaultDbNameSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\GenericLaravelExceptionSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\IncorrectValetDbCredentialsSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\InvalidRouteActionSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingAppKeySolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingColumnSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingImportSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingLivewireComponentSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingMixManifestSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\MissingViteManifestSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\RunningLaravelDuskInProductionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\TableNotFoundSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\UndefinedViewVariableSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\UnknownValidationSolutionProvider;
use Spatie\LaravelIgnition\Solutions\SolutionProviders\ViewNotFoundSolutionProvider;
return [
/*
@ -9,7 +32,7 @@ return [
|
| Choose your preferred editor to use when clicking any edit button.
|
| Supported: "phpstorm", "vscode", "vscode-insiders", "vscodium", "textmate", "emacs",
| Supported: "phpstorm", "vscode", "vscode-insiders", "textmate", "emacs",
| "sublime", "atom", "nova", "macvim", "idea", "netbeans",
| "xdebug"
|
@ -28,7 +51,7 @@ return [
|
*/
'theme' => 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
]
];

View File

@ -1,50 +0,0 @@
<?php
return [
/*
* Set trusted proxy IP addresses.
*
* Both IPv4 and IPv6 addresses are
* supported, along with CIDR notation.
*
* The "*" character is syntactic sugar
* within TrustedProxy to trust any proxy
* that connects directly to your server,
* a requirement when you cannot know the address
* of your proxy (e.g. if using ELB or similar).
*
*/
'proxies' => null, // [<ip addresses>,], '*', '<ip addresses>,'
/*
* 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,
];

View File

@ -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'),

View File

@ -0,0 +1,249 @@
<?php
namespace Sarga\API\Http\Controllers;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Webkul\Customer\Repositories\CustomerRepository;
use Illuminate\Support\Str;
use Webkul\Marketplace\Http\Controllers\Shop\Account\ProductController as SellerProductController;
use Webkul\Product\Models\ProductFlat;
use Webkul\Product\Models\ProductInventory;
use Webkul\Product\Models\Product;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Marketplace\Repositories\SellerRepository;
use Webkul\Marketplace\Models\Product as SellerProductModel;
use Webkul\Marketplace\Models\Order as SellerOrderModel;
class SellerProduct extends SellerProductController
{
/**
* Product repository instance.
*
* @var \Webkul\Product\Repositories\ProductRepository
*/
protected $productRepository;
/**
* SellerRepository object
*
* @var Object
*/
protected $sellerRepository;
/**
* Method to store user's sign up form data to DB.
*
* @return \Illuminate\Http\Response
*/
/**
* Create a new controller instance.
* $categoryRepository
* @param \Webkul\Product\Repositories\ProductRepository $productAttributeValueRepository
* @return void
*/
public function __construct(
ProductRepository $productRepository,
SellerRepository $sellerRepository,
) {
$this->_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'
]);
}
}
}

View File

@ -0,0 +1,250 @@
<?php
namespace Sarga\API\Http\Controllers;
use DB;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Event;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Webkul\Customer\Repositories\CustomerRepository;
use Illuminate\Support\Str;
use Webkul\Marketplace\Http\Controllers\Shop\Account\ProductController as SellerProductController;
use Webkul\Product\Models\ProductFlat;
use Webkul\Product\Models\ProductInventory;
use Webkul\Product\Models\Product;
use Webkul\Product\Repositories\ProductRepository;
use Webkul\Marketplace\Repositories\SellerRepository;
use Webkul\Marketplace\Models\Product as SellerProductModel;
use Webkul\Marketplace\Models\Order as SellerOrderModel;
class SellerProduct extends SellerProductController
{
/**
* Product repository instance.
*
* @var \Webkul\Product\Repositories\ProductRepository
*/
protected $productRepository;
/**
* SellerRepository object
*
* @var Object
*/
protected $sellerRepository;
/**
* Method to store user's sign up form data to DB.
*
* @return \Illuminate\Http\Response
*/
/**
* Create a new controller instance.
* $categoryRepository
* @param \Webkul\Product\Repositories\ProductRepository $productAttributeValueRepository
* @return void
*/
public function __construct(
ProductRepository $productRepository,
SellerRepository $sellerRepository,
) {
$this->_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'
]);
}
}
}

View File

@ -1 +1 @@
/Users/tmstore/Desktop/projects old/new folder/nurGul/nurgul_backend/storage/app/public
/var/www/nurgulbackend/storage/app/public

View File

@ -0,0 +1,5 @@
@extends('errors::minimal')
@section('title', __('Payment Required'))
@section('code', '402')
@section('message', __('Payment Required'))

View File

@ -6,16 +6,12 @@
<title>@yield('title')</title>
<!-- Fonts -->
<link rel="preconnect" href="https://fonts.gstatic.com">
<link href="https://fonts.googleapis.com/css2?family=Nunito&display=swap" rel="stylesheet">
<!-- Styles -->
<style>
html, body {
background-color: #fff;
color: #636b6f;
font-family: 'Nunito', sans-serif;
font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
font-weight: 100;
height: 100vh;
margin: 0;

File diff suppressed because one or more lines are too long