WIP
This commit is contained in:
@@ -102,11 +102,13 @@ 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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -13,24 +13,20 @@ 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;
|
||||
use Illuminate\Database\Eloquent\Relations\HasOne;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Laravel\Sanctum\HasApiTokens;
|
||||
use Spatie\DeletedModels\Models\Concerns\KeepsDeletedModels;
|
||||
use Spatie\Permission\Traits\HasRoles;
|
||||
|
||||
class User extends Authenticatable implements BasementUserContract
|
||||
class User
|
||||
{
|
||||
use HasApiTokens;
|
||||
use HasEcommerceChannels;
|
||||
use HasFactory;
|
||||
use HasPrivateMessages;
|
||||
use HasRoles;
|
||||
use HasSchemalessAttributes;
|
||||
use InteractsWithNova;
|
||||
|
||||
@@ -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...
|
||||
|
||||
Reference in New Issue
Block a user