HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/brameda/brameda.nl/app/Komma/Shop/Catalog/catalogRoutes.php
<?php declare(strict_types = 1);

namespace App\Komma\Shop\Catalog;

use App\Komma\Shop\Catalog\Kms\CatalogService;
use Illuminate\Support\Facades\Route;


final class CatalogRoutes
{
    public static function web()
    {
        Route::get('/search', CatalogService::class . '@search')->name('catalog.search');
    }

    public static function kms()
    {
        //Note that this route hits a service. This is expected as it is hit from an artisan command and a future "index" button in the kms.
        //Also notice that authentication middleware is linked to the route directly. Normally we assign auth middleware to the controllers these route hit.
        Route::get('kms/catalog/index', CatalogService::class . '@index')->middleware('auth:kms');

        Route::get('/kms/catalog/reindexSearch', function () {
            //Saves all models so that they will be re-indexed in the search databases again.
            CatalogService::reIndexSearch();
            echo 'Done!';
        });
    }
}