Laravel snippets

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

Jump to navigation Jump to search

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);
    });
}