Compare commits

..

13 Commits

Author SHA1 Message Date
Mekan1206
e227b24de5 WIP 2026-05-04 13:42:09 +05:00
Mekan1206
79b10b20ea WIP 2026-05-04 13:41:21 +05:00
Mekan1206
fa9d9b68b5 WIP 2026-05-04 13:39:45 +05:00
Mekan1206
c23d0eeab0 downgrade 2026-05-04 13:37:25 +05:00
Mekan1206
14b47d40e8 WIP 2026-05-04 13:34:54 +05:00
Mekan1206
f365bff782 WIP 2026-05-04 13:24:27 +05:00
Mekan1206
82ed332637 WIP 2026-05-03 19:08:02 +05:00
Mekan1206
bac2ad9a3e WIP 2026-05-03 18:42:16 +05:00
Mekan1206
1b467108de WIP 2026-05-03 18:36:49 +05:00
Mekan1206
774ac3c622 remove modal 2026-05-02 16:19:31 +05:00
Mekan1206
62f8deb51f WIP 2026-05-02 16:16:56 +05:00
Mekan1206
40cac31648 fix 2026-05-02 12:56:32 +05:00
Mekan1206
6617c8bd27 WIP 2026-05-02 12:55:20 +05:00
7 changed files with 116 additions and 137 deletions

View File

@@ -6,6 +6,7 @@ use App\Http\Controllers\Api\V1\Filters\Requests\FilterIndexRequest;
use App\Http\Controllers\Controller;
use App\Models\Ecommerce\Channel\Channel;
use App\Models\Ecommerce\Product\Brand\Brand;
use Illuminate\Support\Facades\DB;
use App\Models\Ecommerce\Product\Category\Category;
use App\Models\Ecommerce\Product\Collection\Collection;
use Illuminate\Http\JsonResponse;
@@ -26,11 +27,7 @@ class FilterController extends Controller
public function index(FilterIndexRequest $request): JsonResponse
{
return response()->rest([
'categories' => $this->categories()->map(fn ($category) => [
'id' => $category->id,
'parent_id' => $category->parent_id,
'name' => $category->name,
]),
'categories' => $this->categories(),
'brands' => $this->brands(),
]);
}
@@ -45,7 +42,7 @@ class FilterController extends Controller
}
if ($this->shouldFilterByCollection()) {
return $this->filterByCategoryResource(Collection::find($this->request->collection_id));
return $this->categoriesFor($this->request->collection_id, 'collection');
}
if ($this->shouldFilterByBrand()) {
@@ -53,7 +50,7 @@ class FilterController extends Controller
}
if ($this->shouldFilterByChannel()) {
return $this->filterByCategoryResource(Channel::find($this->request->channel_id));
return $this->categoriesFor($this->request->channel_id, 'channel');
}
return Category::query()->where('is_visible', true)->ordered()->get(['id', 'parent_id', 'name']);
@@ -102,11 +99,42 @@ class FilterController extends Controller
->distinct('products.id')
->pluck('products.id');
return Category::where('is_visible', true)->ordered()->join('product_has_relations', 'categories.id', '=', 'product_has_relations.productable_id')
->where('product_has_relations.productable_type', '=', 'category')
->whereIntegerInRaw('product_has_relations.product_id', $products)
->get(['id', 'parent_id', 'name'])
->unique('categories.id');
return Category::where('is_visible', true)
->ordered()
->join('product_has_relations', 'categories.id', '=', 'product_has_relations.productable_id')
->where('product_has_relations.productable_type', '=', 'category')
->whereIntegerInRaw('product_has_relations.product_id', $products)
->get(['categories.id', 'categories.parent_id', 'categories.name'])
->unique('categories.id');
}
/**
* Categories for a resource
*/
private function categoriesFor(int $id, string $type)
{
return DB::table('categories as c')
->select('c.id', 'c.parent_id', 'c.name')
->where('c.is_visible', true)
->whereExists(function ($query) use ($id, $type) {
$query->select(DB::raw(1))
->from('product_has_relations as phr_cat')
->join('products as p', 'p.id', '=', 'phr_cat.product_id')
->join('product_has_relations as phr_chan', 'phr_chan.product_id', '=', 'p.id')
->whereColumn('phr_cat.productable_id', 'c.id')
->where('phr_cat.productable_type', 'category')
->where('phr_chan.productable_type', $type)
->where('phr_chan.productable_id', $id)
->where('p.is_visible', true)
->whereNull('p.parent_id')
->where('p.stock', '>', 0);
})
->get()
->map(fn ($category) => [
'id' => $category->id,
'parent_id' => $category->parent_id,
'name' => $category->name,
]);
}
/**

View File

@@ -14,7 +14,9 @@ class OrderPaymentController extends Controller
public function index(): JsonResponse
{
return response()->rest(
PaymentType::all(['id', 'name'])
PaymentType::query()
->where('is_enabled', true)
->get(['id', 'name', 'is_enabled'])
->map(fn ($paymentType) => [
'id' => $paymentType->id,
'name' => $paymentType->name,

View File

@@ -13,8 +13,6 @@ use App\Models\Ecommerce\Product\Review\Review;
use App\Models\Post\User\UserDoc;
use App\Models\System\Settings\Location\UserAddress;
use App\Repositories\System\Cache\CacheRepository;
use BasementChat\Basement\Contracts\User as BasementUserContract;
use BasementChat\Basement\Traits\HasPrivateMessages;
use Illuminate\Database\Eloquent\Casts\Attribute;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Relations\HasMany;
@@ -25,12 +23,11 @@ use Laravel\Sanctum\HasApiTokens;
use Spatie\DeletedModels\Models\Concerns\KeepsDeletedModels;
use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable implements BasementUserContract
class User extends Authenticatable
{
use HasApiTokens;
use HasEcommerceChannels;
use HasFactory;
use HasPrivateMessages;
use HasRoles;
use HasSchemalessAttributes;
use InteractsWithNova;

0
artisan Executable file → Normal file
View File

132
composer.lock generated
View File

@@ -3226,16 +3226,16 @@
},
{
"name": "maatwebsite/excel",
"version": "3.1.68",
"version": "3.1.69",
"source": {
"type": "git",
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
"reference": "1854739267d81d38eae7d8c623caf523f30f256b"
"reference": "ae5d65b7c9a2fac43bff4d44f796ac95d7a8e760"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/1854739267d81d38eae7d8c623caf523f30f256b",
"reference": "1854739267d81d38eae7d8c623caf523f30f256b",
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/ae5d65b7c9a2fac43bff4d44f796ac95d7a8e760",
"reference": "ae5d65b7c9a2fac43bff4d44f796ac95d7a8e760",
"shasum": ""
},
"require": {
@@ -3243,7 +3243,7 @@
"ext-json": "*",
"illuminate/support": "5.8.*||^6.0||^7.0||^8.0||^9.0||^10.0||^11.0||^12.0||^13.0",
"php": "^7.0||^8.0",
"phpoffice/phpspreadsheet": "^1.30.0",
"phpoffice/phpspreadsheet": "^1.30.4",
"psr/simple-cache": "^1.0||^2.0||^3.0"
},
"require-dev": {
@@ -3291,7 +3291,7 @@
],
"support": {
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.68"
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.69"
},
"funding": [
{
@@ -3303,35 +3303,35 @@
"type": "github"
}
],
"time": "2026-03-17T20:51:10+00:00"
"time": "2026-04-30T20:03:58+00:00"
},
{
"name": "maennchen/zipstream-php",
"version": "3.2.2",
"version": "3.1.2",
"source": {
"type": "git",
"url": "https://github.com/maennchen/ZipStream-PHP.git",
"reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e"
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
"reference": "77bebeb4c6c340bb3c11c843b2cffd8bbfde4d5e",
"url": "https://api.github.com/repos/maennchen/ZipStream-PHP/zipball/aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"reference": "aeadcf5c412332eb426c0f9b4485f6accba2a99f",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"ext-zlib": "*",
"php-64bit": "^8.3"
"php-64bit": "^8.2"
},
"require-dev": {
"brianium/paratest": "^7.7",
"ext-zip": "*",
"friendsofphp/php-cs-fixer": "^3.86",
"friendsofphp/php-cs-fixer": "^3.16",
"guzzlehttp/guzzle": "^7.5",
"mikey179/vfsstream": "^1.6",
"php-coveralls/php-coveralls": "^2.5",
"phpunit/phpunit": "^12.0",
"phpunit/phpunit": "^11.0",
"vimeo/psalm": "^6.0"
},
"suggest": {
@@ -3373,7 +3373,7 @@
],
"support": {
"issues": "https://github.com/maennchen/ZipStream-PHP/issues",
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.2.2"
"source": "https://github.com/maennchen/ZipStream-PHP/tree/3.1.2"
},
"funding": [
{
@@ -3381,7 +3381,7 @@
"type": "github"
}
],
"time": "2026-04-11T18:38:28+00:00"
"time": "2025-01-27T12:07:53+00:00"
},
{
"name": "markbaker/complex",
@@ -4359,16 +4359,16 @@
},
{
"name": "openspout/openspout",
"version": "v4.32.0",
"version": "v4.28.5",
"source": {
"type": "git",
"url": "https://github.com/openspout/openspout.git",
"reference": "41f045c1f632e1474e15d4c7bc3abcb4a153563d"
"reference": "ab05a09fe6fce57c90338f83280648a9786ce36b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/openspout/openspout/zipball/41f045c1f632e1474e15d4c7bc3abcb4a153563d",
"reference": "41f045c1f632e1474e15d4c7bc3abcb4a153563d",
"url": "https://api.github.com/repos/openspout/openspout/zipball/ab05a09fe6fce57c90338f83280648a9786ce36b",
"reference": "ab05a09fe6fce57c90338f83280648a9786ce36b",
"shasum": ""
},
"require": {
@@ -4378,17 +4378,17 @@
"ext-libxml": "*",
"ext-xmlreader": "*",
"ext-zip": "*",
"php": "~8.3.0 || ~8.4.0 || ~8.5.0"
"php": "~8.2.0 || ~8.3.0 || ~8.4.0"
},
"require-dev": {
"ext-zlib": "*",
"friendsofphp/php-cs-fixer": "^3.86.0",
"infection/infection": "^0.31.2",
"phpbench/phpbench": "^1.4.1",
"phpstan/phpstan": "^2.1.22",
"phpstan/phpstan-phpunit": "^2.0.7",
"phpstan/phpstan-strict-rules": "^2.0.6",
"phpunit/phpunit": "^12.3.7"
"friendsofphp/php-cs-fixer": "^3.68.3",
"infection/infection": "^0.29.10",
"phpbench/phpbench": "^1.4.0",
"phpstan/phpstan": "^2.1.2",
"phpstan/phpstan-phpunit": "^2.0.4",
"phpstan/phpstan-strict-rules": "^2",
"phpunit/phpunit": "^11.5.4"
},
"suggest": {
"ext-iconv": "To handle non UTF-8 CSV files (if \"php-mbstring\" is not already installed or is too limited)",
@@ -4436,7 +4436,7 @@
],
"support": {
"issues": "https://github.com/openspout/openspout/issues",
"source": "https://github.com/openspout/openspout/tree/v4.32.0"
"source": "https://github.com/openspout/openspout/tree/v4.28.5"
},
"funding": [
{
@@ -4448,7 +4448,7 @@
"type": "github"
}
],
"time": "2025-09-03T16:03:54+00:00"
"time": "2025-01-30T13:51:11+00:00"
},
{
"name": "outl1ne/nova-multiselect-field",
@@ -7305,16 +7305,16 @@
},
{
"name": "symfony/console",
"version": "v6.4.36",
"version": "v6.4.37",
"source": {
"type": "git",
"url": "https://github.com/symfony/console.git",
"reference": "9f481cfb580db8bcecc9b2d4c63f3e13df022ad5"
"reference": "7bbcaf3fdb1e18fa42a7f0b84a10d091c10548f5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/console/zipball/9f481cfb580db8bcecc9b2d4c63f3e13df022ad5",
"reference": "9f481cfb580db8bcecc9b2d4c63f3e13df022ad5",
"url": "https://api.github.com/repos/symfony/console/zipball/7bbcaf3fdb1e18fa42a7f0b84a10d091c10548f5",
"reference": "7bbcaf3fdb1e18fa42a7f0b84a10d091c10548f5",
"shasum": ""
},
"require": {
@@ -7379,7 +7379,7 @@
"terminal"
],
"support": {
"source": "https://github.com/symfony/console/tree/v6.4.36"
"source": "https://github.com/symfony/console/tree/v6.4.37"
},
"funding": [
{
@@ -7399,20 +7399,20 @@
"type": "tidelift"
}
],
"time": "2026-03-27T15:30:51+00:00"
"time": "2026-04-13T15:27:04+00:00"
},
{
"name": "symfony/css-selector",
"version": "v7.4.8",
"version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/css-selector.git",
"reference": "b055f228a4178a1d6774909903905e3475f3eac8"
"reference": "b75663ed96cf4756e28e3105476f220f92886cc4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/b055f228a4178a1d6774909903905e3475f3eac8",
"reference": "b055f228a4178a1d6774909903905e3475f3eac8",
"url": "https://api.github.com/repos/symfony/css-selector/zipball/b75663ed96cf4756e28e3105476f220f92886cc4",
"reference": "b75663ed96cf4756e28e3105476f220f92886cc4",
"shasum": ""
},
"require": {
@@ -7448,7 +7448,7 @@
"description": "Converts CSS selectors to XPath expressions",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/css-selector/tree/v7.4.8"
"source": "https://github.com/symfony/css-selector/tree/v7.4.9"
},
"funding": [
{
@@ -7468,7 +7468,7 @@
"type": "tidelift"
}
],
"time": "2026-03-24T13:12:05+00:00"
"time": "2026-04-18T13:18:21+00:00"
},
{
"name": "symfony/deprecation-contracts",
@@ -7618,16 +7618,16 @@
},
{
"name": "symfony/event-dispatcher",
"version": "v7.4.8",
"version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/event-dispatcher.git",
"reference": "f57b899fa736fd71121168ef268f23c206083f0a"
"reference": "e4a2e29753c7801f7a8340e066cfa788f3bc8101"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/f57b899fa736fd71121168ef268f23c206083f0a",
"reference": "f57b899fa736fd71121168ef268f23c206083f0a",
"url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/e4a2e29753c7801f7a8340e066cfa788f3bc8101",
"reference": "e4a2e29753c7801f7a8340e066cfa788f3bc8101",
"shasum": ""
},
"require": {
@@ -7679,7 +7679,7 @@
"description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/event-dispatcher/tree/v7.4.8"
"source": "https://github.com/symfony/event-dispatcher/tree/v7.4.9"
},
"funding": [
{
@@ -7699,7 +7699,7 @@
"type": "tidelift"
}
],
"time": "2026-03-30T13:54:39+00:00"
"time": "2026-04-18T13:18:21+00:00"
},
{
"name": "symfony/event-dispatcher-contracts",
@@ -8130,16 +8130,16 @@
},
{
"name": "symfony/mime",
"version": "v6.4.36",
"version": "v6.4.37",
"source": {
"type": "git",
"url": "https://github.com/symfony/mime.git",
"reference": "9c31726137c70798f815fb98293ffb8a2a47694c"
"reference": "330077bc7fbe314758aff62834b758d06ac6d260"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/mime/zipball/9c31726137c70798f815fb98293ffb8a2a47694c",
"reference": "9c31726137c70798f815fb98293ffb8a2a47694c",
"url": "https://api.github.com/repos/symfony/mime/zipball/330077bc7fbe314758aff62834b758d06ac6d260",
"reference": "330077bc7fbe314758aff62834b758d06ac6d260",
"shasum": ""
},
"require": {
@@ -8195,7 +8195,7 @@
"mime-type"
],
"support": {
"source": "https://github.com/symfony/mime/tree/v6.4.36"
"source": "https://github.com/symfony/mime/tree/v6.4.37"
},
"funding": [
{
@@ -8215,7 +8215,7 @@
"type": "tidelift"
}
],
"time": "2026-03-30T09:31:23+00:00"
"time": "2026-04-29T09:53:28+00:00"
},
{
"name": "symfony/polyfill-ctype",
@@ -9041,16 +9041,16 @@
},
{
"name": "symfony/routing",
"version": "v6.4.34",
"version": "v6.4.37",
"source": {
"type": "git",
"url": "https://github.com/symfony/routing.git",
"reference": "5ab3a3e1a03535ec5ca6ce2d39e4369a1096ae47"
"reference": "48035d186798d27d375d95aad37db8fe097e4048"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/routing/zipball/5ab3a3e1a03535ec5ca6ce2d39e4369a1096ae47",
"reference": "5ab3a3e1a03535ec5ca6ce2d39e4369a1096ae47",
"url": "https://api.github.com/repos/symfony/routing/zipball/48035d186798d27d375d95aad37db8fe097e4048",
"reference": "48035d186798d27d375d95aad37db8fe097e4048",
"shasum": ""
},
"require": {
@@ -9104,7 +9104,7 @@
"url"
],
"support": {
"source": "https://github.com/symfony/routing/tree/v6.4.34"
"source": "https://github.com/symfony/routing/tree/v6.4.37"
},
"funding": [
{
@@ -9124,7 +9124,7 @@
"type": "tidelift"
}
],
"time": "2026-02-24T17:34:50+00:00"
"time": "2026-04-18T13:45:55+00:00"
},
{
"name": "symfony/service-contracts",
@@ -13637,16 +13637,16 @@
},
{
"name": "symfony/var-exporter",
"version": "v7.4.8",
"version": "v7.4.9",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-exporter.git",
"reference": "398907e89a2a56fe426f7955c6fa943ec0c77225"
"reference": "22e03a49c95ef054a43601cd159b222bfab1c701"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/398907e89a2a56fe426f7955c6fa943ec0c77225",
"reference": "398907e89a2a56fe426f7955c6fa943ec0c77225",
"url": "https://api.github.com/repos/symfony/var-exporter/zipball/22e03a49c95ef054a43601cd159b222bfab1c701",
"reference": "22e03a49c95ef054a43601cd159b222bfab1c701",
"shasum": ""
},
"require": {
@@ -13694,7 +13694,7 @@
"serialize"
],
"support": {
"source": "https://github.com/symfony/var-exporter/tree/v7.4.8"
"source": "https://github.com/symfony/var-exporter/tree/v7.4.9"
},
"funding": [
{
@@ -13714,7 +13714,7 @@
"type": "tidelift"
}
],
"time": "2026-03-24T13:12:05+00:00"
"time": "2026-04-18T13:18:21+00:00"
},
{
"name": "symfony/yaml",

View File

@@ -1,48 +0,0 @@
```html
<component
v-for="(rowField, j) in this.field.fields"
:key="j"
:is="`form-${rowField.component}`"
:field="rowField"
class="w-full"
/>
<Modal
:show="showModal"
size="7xl"
tabindex="-1"
role="dialog"
>
<div>
<ModalHeader v-text="'Headline of Modal'" class="bg-gray-100 dark:bg-gray-700" />
<ModalBody>
<div class="px-4 py-5 sm:p-6">
<ModalForm></ModalForm>
</div>
</ModalBody>
<ModalFooter>
<div class="flex items-center ml-auto">
<CancelButton
component="button"
type="button"
dusk="cancel-action-button"
class="ml-auto mr-3"
@click="onClose"
/>
<DefaultButton
type="submit"
@click="onSubmit"
>
Submit
</DefaultButton>
</div>
</ModalFooter>
</div>
</Modal>
```
"type": "composer",
"url": "https://nova.laravel.com"

View File

@@ -101,12 +101,12 @@ Route::get('filters', [FilterController::class, 'index']);
// Global orders...
Route::post('global-order', [GlobalOrderController::class, 'store']);
Route::middleware('auth:sanctum')->group(function () {
Route::get('/chat/contacts', [ChatController::class, 'contacts']);
Route::get('/chat/messages/{conversation}', [ChatController::class, 'messages']);
Route::post('/chat/start', [ChatController::class, 'start']);
Route::post('/chat/send', [ChatController::class, 'send']);
});
// Route::middleware('auth:sanctum')->group(function () {
// Route::get('/chat/contacts', [ChatController::class, 'contacts']);
// Route::get('/chat/messages/{conversation}', [ChatController::class, 'messages']);
// Route::post('/chat/start', [ChatController::class, 'start']);
// Route::post('/chat/send', [ChatController::class, 'send']);
// });
Route::middleware(['auth:sanctum', 'banned'])->group(function () {
// Profile...