Skip to content

Instantly share code, notes, and snippets.

@Wolg
Created November 10, 2015 09:58
Show Gist options
  • Save Wolg/313e2958c8a71b64b6be to your computer and use it in GitHub Desktop.
Save Wolg/313e2958c8a71b64b6be to your computer and use it in GitHub Desktop.
Can be converted to Markdown table here http://www.tablesgenerator.com/markdown_tables
<?php
$routeCollection = Route::getRoutes();
$result = [];
foreach($routeCollection as $value) {
$result[] = [
'HTTP Method' => $value->getMethods()[0],
'Route' => $value->getPath(),
'Corresponding Action' => $value->getActionName(),
];
}
$file = fopen('file.csv', 'w');
foreach ($result as $row) {
fputcsv($file, $row);
}
fclose($file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment