<commit_before><?php

namespace TypiCMS\Modules\Translations\Providers;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use TypiCMS\Modules\Translations\Http\Controllers\AdminController;
use TypiCMS\Modules\Translations\Http\Controllers\ApiController;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * Define the routes for the application.
     */
    public function map()
    {
        Route::namespace($this->namespace)->group(function (Router $router) {
            /*
             * Admin routes
             */
            $router->middleware('admin')->prefix('admin')->group(function (Router $router) {
                $router->get('translations', [AdminController::class, 'index'])->name('admin::index-translations')->middleware('can:read translations');
                $router->get('translations/create', [AdminController::class, 'create'])->name('admin::create-translation')->middleware('can:create translations');
                $router->get('translations/{translation}/edit', [AdminController::class, 'edit'])->name('admin::edit-translation')->middleware('can:read translations');
                $router->post('translations', [AdminController::class, 'store'])->name('admin::store-translation')->middleware('can:create translations');
                $router->put('translations/{translation}', [AdminController::class, 'update'])->name('admin::update-translation')->middleware('can:update translations');
            });

            /*
             * API routes
             */
            $router->middleware('api')->prefix('api')->group(function (Router $router) {
                $router->middleware('auth:api')->group(function (Router $router) {
                    $router->get('translations', [ApiController::class, 'index'])->middleware('can:read translations');
                    $router->patch('translations/{translation}', [ApiController::class, 'updatePartial'])->middleware('can:update translations');
                    $router->delete('translations/{translation}', [ApiController::class, 'destroy'])->middleware('can:delete translations');
                });
            });
        });
    }
}<commit_msg>Routes definition cleaned<commit_after><?php

namespace TypiCMS\Modules\Translations\Providers;

use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
use Illuminate\Routing\Router;
use Illuminate\Support\Facades\Route;
use TypiCMS\Modules\Translations\Http\Controllers\AdminController;
use TypiCMS\Modules\Translations\Http\Controllers\ApiController;

class RouteServiceProvider extends ServiceProvider
{
    /**
     * Define the routes for the application.
     */
    public function map()
    {
        /*
         * Admin routes
         */
        Route::middleware('admin')->prefix('admin')->name('admin::')->group(function (Router $router) {
            $router->get('translations', [AdminController::class, 'index'])->name('index-translations')->middleware('can:read translations');
            $router->get('translations/create', [AdminController::class, 'create'])->name('create-translation')->middleware('can:create translations');
            $router->get('translations/{translation}/edit', [AdminController::class, 'edit'])->name('edit-translation')->middleware('can:read translations');
            $router->post('translations', [AdminController::class, 'store'])->name('store-translation')->middleware('can:create translations');
            $router->put('translations/{translation}', [AdminController::class, 'update'])->name('update-translation')->middleware('can:update translations');
        });

        /*
         * API routes
         */
        Route::middleware(['api', 'auth:api'])->prefix('api')->group(function (Router $router) {
            $router->get('translations', [ApiController::class, 'index'])->middleware('can:read translations');
            $router->patch('translations/{translation}', [ApiController::class, 'updatePartial'])->middleware('can:update translations');
            $router->delete('translations/{translation}', [ApiController::class, 'destroy'])->middleware('can:delete translations');
        });
    }
}
{'fraction_non_alphanumeric': 0.1706172260032856, 'fraction_numerical': 0.0, 'mean_word_length': 3.870857142857143, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 60, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '916759', 'n_tokens_mistral': 1075, 'n_tokens_neox': 1071, 'n_words': 149}