partial update products

This commit is contained in:
2025-06-04 16:58:50 +07:00
parent 215792ce63
commit 8305e44c42
35 changed files with 179 additions and 707 deletions

View File

@@ -9,8 +9,6 @@ use App\Http\Controllers\TransactionController;
use App\Http\Controllers\UserController;
use App\Http\Controllers\WarehouseManagement\ProductCategoriesController;
use App\Http\Controllers\WarehouseManagement\ProductsController;
use App\Http\Controllers\WarehouseManagement\StockMutationsController;
use App\Http\Controllers\WarehouseManagement\StockOpnamesController;
use App\Http\Controllers\WorkController;
use App\Models\Menu;
use App\Models\Privilege;
@@ -205,13 +203,31 @@ Route::group(['middleware' => 'auth'], function() {
Route::get('/report/transaction_dealer', [ReportController::class, 'transaction_dealer'])->name('report.transaction_dealer');
});
Route::prefix('warehouse')->group(function (){
Route::resource('products', ProductsController::class);
Route::resource('product_categories', ProductCategoriesController::class);
Route::get('categories/parents', [ProductCategoriesController::class, 'getParents'])->name('products.parents');
Route::post('products/{product}/toggle-active', [ProductsController::class, 'toggleActive'])->name('products.toggleActive');
Route::get('mutations/index',[StockMutationsController::class, 'index'])->name('mutations.index');
Route::get('opnames/index',[StockOpnamesController::class, 'index'])->name('opnames.index');
Route::prefix('warehouse')->group(function () {
// ProductsController routes
Route::prefix('products')->controller(ProductsController::class)->group(function () {
Route::get('/', 'index')->name('products.index');
Route::get('create', 'create')->name('products.create');
Route::post('/', 'store')->name('products.store');
Route::get('{product}', 'show')->name('products.show');
Route::get('{product}/edit', 'edit')->name('products.edit');
Route::put('{product}', 'update')->name('products.update');
Route::delete('{product}', 'destroy')->name('products.destroy');
Route::post('{product}/toggle-active', 'toggleActive')->name('products.toggleActive');
});
// ProductCategoriesController routes
Route::prefix('product_categories')->controller(ProductCategoriesController::class)->group(function () {
Route::get('/', 'index')->name('product_categories.index');
Route::get('create', 'create')->name('product_categories.create');
Route::post('/', 'store')->name('product_categories.store');
Route::get('parents','product_category_parents')->name('product_categories.parents');
Route::get('{product_category}', 'show')->name('product_categories.show');
Route::get('{product_category}/edit', 'edit')->name('product_categories.edit');
Route::put('{product_category}', 'update')->name('product_categories.update');
Route::delete('{product_category}', 'destroy')->name('product_categories.destroy');
});
});
});