|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Foundation\Application;
|
|
|
|
use Illuminate\Support\Facades\Route;
|
|
|
|
use App\Http\Controllers\DashboardController;
|
|
|
|
use App\Http\Controllers\UserController;
|
|
|
|
use App\Http\Controllers\ProductController;
|
|
|
|
use App\Http\Controllers\EmployeeController;
|
|
|
|
|
|
|
|
/*
|
|
|
|
|--------------------------------------------------------------------------
|
|
|
|
| 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', DashboardController::class)->name('dashboard');
|
|
|
|
|
|
|
|
Route::get('/users', [UserController::class, 'index'])->name('users.index');
|
|
|
|
Route::post('/users', [UserController::class, 'store'])->name('users.store');
|
|
|
|
Route::put('/users/{user}', [UserController::class, 'update'])->name('users.update');
|
|
|
|
Route::delete('/users/{user}', [UserController::class, 'destroy'])->name('users.destroy');
|
|
|
|
|
|
|
|
Route::get('/products', [ProductController::class, 'index'])->name('products.index');
|
|
|
|
Route::post('/products', [ProductController::class, 'store'])->name('products.store');
|
|
|
|
Route::post('/products/{product}', [ProductController::class, 'update'])->name('products.update');
|
|
|
|
Route::delete('/products/{product}', [ProductController::class, 'destroy'])->name('products.destroy');
|
|
|
|
|
|
|
|
Route::get('/employees', [EmployeeController::class, 'index'])->name('employees.index');
|
|
|
|
Route::post('/employees', [EmployeeController::class, 'store'])->name('employees.store');
|
|
|
|
Route::post('/employees/{employee}', [EmployeeController::class, 'update'])->name('employees.update');
|
|
|
|
Route::delete('/employees/{employee}', [EmployeeController::class, 'destroy'])->name('employees.destroy');
|
|
|
|
|
|
|
|
Route::get('/payrolls', fn () => inertia('Payrolls'))->name('payrolls.index');
|
|
|
|
Route::get('/report', fn () => inertia('Report'))->name('report');
|
|
|
|
});
|
|
|
|
|
|
|
|
require __DIR__.'/auth.php';
|