Laravel snippets

Revision as of 14:51, 30 May 2020 by Mhan (talk | contribs) (iwu)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

routes/web.php

Add extra routes (e.g. dev.php) if the route file exists.

if (file_exists($rpath = base_path('routes').'/dev.php')) {
    Route::group(['prefix' => 'dev'],function() use ($rpath) {
        include_once($rpath);
    });
}