StocksNew/routes/web.php

48 lines
1.6 KiB
PHP
Raw Permalink Normal View History

2024-08-27 12:03:06 +00:00
<?php
use App\Notifications\HrActionNotification;
use Illuminate\Support\Facades\Route;
use Modules\Admin\Models\PromotionDemotion;
use Modules\User\Http\Controllers\PermissionController;
/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider and all of them will
| be assigned to the "web" middleware group. Make something great!
|
*/
Route::withoutMiddleware([\App\Http\Middleware\PermissionMiddleware::class])->group(function () {
Route::get('/', function () {
return view('welcome');
})->name('welcome');
Auth::routes();
Route::get('/initialize-db', function () {
OMIS::initDB();
});
Route::get('/generate-permissions', [PermissionController::class, 'generatePermissionFromRoutes'])->name('permission.generatePermissionFromRoutes');
Route::get('/dashboard', [App\Http\Controllers\HomeController::class, 'index'])->name('home');
Route::get('/notification', function () {
auth()->user()->notify(new HrActionNotification('promotion', PromotionDemotion::first(),'You have been promoted'));
toastr()->success('Notification sent successfully!');
});
});
Route::middleware('auth')->group(function () {
// require __DIR__ . '/CRUDgenerated/route.branches.php';
// require __DIR__ . '/CRUDgenerated/route.vendors.php';
// require __DIR__ . '/CRUDgenerated/route.vendortypes.php';
});