You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
66 lines
3.0 KiB
PHP
66 lines
3.0 KiB
PHP
<?php
|
|
|
|
use App\Http\Controllers\GeneralController;
|
|
use App\Http\Controllers\ProfileController;
|
|
use App\Http\Controllers\RoleController;
|
|
use App\Http\Controllers\UserController;
|
|
use App\Http\Controllers\CategoryController;
|
|
use App\Http\Controllers\CustomerController;
|
|
use App\Http\Controllers\ProductController;
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Web Routes
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| Here is where you can register web routes for your application. These
|
|
| routes are loaded by the RouteServiceProvider within a group which
|
|
| contains the "web" middleware group. Now create something great!
|
|
|
|
|
*/
|
|
|
|
Route::get('/', function () {
|
|
return redirect()->route('login');
|
|
});
|
|
|
|
Route::middleware(['auth'])->group(function () {
|
|
Route::get('/dashboard', [GeneralController::class, 'index'])->name('dashboard');
|
|
Route::get('/maintance', [GeneralController::class, 'maintance'])->name('maintance');
|
|
|
|
// User
|
|
Route::get('/users', [UserController::class, 'index'])->name('user.index');
|
|
Route::post('/users', [UserController::class, 'store'])->name('user.store');
|
|
Route::put('/users/{user}', [UserController::class, 'update'])->name('user.update');
|
|
Route::delete('/users/{user}', [UserController::class, 'destroy'])->name('user.destroy');
|
|
|
|
// Role
|
|
Route::resource('/roles', RoleController::class);
|
|
|
|
// Category
|
|
Route::get('/categories', [CategoryController::class, 'index'])->name('category.index');
|
|
Route::post('/categories', [CategoryController::class, 'store'])->name('category.store');
|
|
Route::put('/categories/{category}', [CategoryController::class, 'update'])->name('category.update');
|
|
Route::delete('/categories/{category}', [CategoryController::class, 'destroy'])->name('category.destroy');
|
|
|
|
// Customer
|
|
Route::get('/customers', [CustomerController::class, 'index'])->name('customer.index');
|
|
Route::post('/customers', [CustomerController::class, 'store'])->name('customer.store');
|
|
Route::put('/customers/{customer}', [CustomerController::class, 'update'])->name('customer.update');
|
|
Route::delete('/customers/{customer}', [CustomerController::class, 'destroy'])->name('customer.destroy');
|
|
|
|
// Product
|
|
Route::get('/products', [ProductController::class, 'index'])->name('product.index');
|
|
Route::post('/products', [ProductController::class, 'store'])->name('product.store');
|
|
Route::put('/products/{product}', [ProductController::class, 'update'])->name('product.update');
|
|
Route::delete('/products/{product}', [ProductController::class, 'destroy'])->name('product.destroy');
|
|
});
|
|
|
|
Route::middleware('auth')->group(function () {
|
|
Route::get('/profile', [ProfileController::class, 'edit'])->name('profile.edit');
|
|
Route::patch('/profile', [ProfileController::class, 'update'])->name('profile.update');
|
|
Route::delete('/profile', [ProfileController::class, 'destroy'])->name('profile.destroy');
|
|
});
|
|
|
|
require __DIR__.'/auth.php';
|