Laravel snippets

From Han Wiki
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);
    });
}