File: D:/HostingSpaces/SBogers10/rentman2019.komma.pro/app/Komma/Updates/UpdateRoutes.php
<?php
namespace App\Komma\Updates;
use App\Komma\Updates\Kms\UpdateController as KmsUpdateController;
use App\Komma\Updates\Models\Update;
use Illuminate\Support\Facades\Route;
final class UpdateRoutes
{
/**
* Route that are resolved from the Alias route to Rest Route by the AliasMiddleware.
* Through the controller the models will be bind by Implicit Route Model Binding,
* so no need to add Route::model in here.
*/
public static function get()
{
Route::resource('updates', UpdateController::class, [
'only' => [
'index',
'show',
],
]);
Route::get('updates/categories/{categoryId}', UpdateController::class.'@category');
Route::get('/api/updates/timeline/{currentLength}', UpdateController::class.'@getTimelineUpdates');
Route::get('/api/updates', UpdateController::class.'@getUpdates');
}
/**
* Routes that are used for and within the KMS
* Will be prefixed with 'kms' by the Route::group in the RouteResolver
*
* Note: Within the group we use the Explicit Route Model Binding to point to a Update
* This is because we use a global controller to resolve the model
*/
public static function kms()
{
Route::model('update', Update::class); //Explicit route model binding
Route::resource('{siteSlug}/updates', KmsUpdateController::class);
Route::post('updates/{update}/freshness', KmsUpdateController::class.'@freshness');
}
}