dimanche 16 août 2020

How to refactor laravel routes?

we have a lot of routes in our web.php . We want to refactor these routes . what is the best way of it. should i make one separate file for that or anything else. I didn't tried anything . I am looking for best practice . I am just Putting sample routes here

<?php



Route::group(['middleware' => ['auth']], function () {


    Route::get('/', function () {
        return view('web.pages.dashboard');
    })->name('dashboard');

    Route::get('/dashboardtwo', function () {
        return view('web.pages.dashboardtwo');
    })->name('dashboard.two');
    // Organization Settings Page
    Route::get('/organizationsettings', function () {
        return view('web.pages.misc.organization_settings.index');
    })->name('index');

    Route::get('/live_search/{table_name}/{select_key}/{select_value}/{search_columns}', function (Request $request, $table_name, $select_key, $select_value, $search_columns) {
        return selectLiveSearchHelper($table_name, $select_key, $select_value, $search_columns, $request->q);
    });

    Route::get('/addnewcustomer', function () {
        return view('web.pages.customers.index1');
    })->name('index');

    Route::get('/create_product_to_warehouse_location', function () {
        return view('web.pages.warehouses.locations.move_bulk');
    })->name('index');
    Route::get('/move_bulk_warehouse_location', function () {
        return view('web.pages.warehouses.locations.move_bulk_stock_warehoues_locations');
    })->name('index');
    Route::get('/consignment_customer_invoices', function () {
        return view('web.pages.consignment_customer_invoices.index');
    })->name('index');
    Route::get('/view_consignment_customer_invoices', function () {
        return view('web.pages.consignment_customer_invoices.view');
    })->name('index');
    Route::get('/view_ocr_text', function () {
        return view('web.pages.ocr_text');
    })->name('ocr.text.extraction');
    Route::get('/view_pppuom', function () {
        return view('web.partials.product.product_packaging_product_unit_of_measure');
    })->name('index');

    Route::get('/imap', 'ImapController@index');

    Route::get('/split', 'ImapController@split');

    Route::get('/resendemail', 'ImapController@reSendEmail');

    Route::get('/ftp', 'ImapController@ftp_pdf');





via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire