-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- add laravel default public_path helper because it's not present in lumen usage IDocGeneratorCommand line 74 - improve readme.md to define public path if needed - add new routes for lumen because it's totaly diffrent - extends service provider for lumen
- Loading branch information
Pooya
committed
Oct 8, 2021
1 parent
6c75161
commit f6bd0ae
Showing
7 changed files
with
70 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ | |
composer.lock | ||
.php_cs.cache | ||
/vendor/ | ||
/.idea | ||
/public | ||
.couscous/ | ||
.phpintel/ | ||
.phpintel/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
if (! function_exists('public_path')) { | ||
/** | ||
* Get the path to the public folder. | ||
* | ||
* @param string $path | ||
* @return string | ||
*/ | ||
function public_path($path = '') | ||
{ | ||
return app()->make('path.public').($path ? DIRECTORY_SEPARATOR.ltrim($path, DIRECTORY_SEPARATOR) : $path); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
<?php | ||
|
||
/** @var Laravel\Lumen\Routing\Router $router */ | ||
|
||
//This is the route for the documentation info page. | ||
$router->get('info', [function () { return view('idoc::partials.info'); }, 'as' => 'info']); | ||
|
||
//This is the route for the root documentation view page. | ||
$router->get('', [function () { return view('idoc::documentation'); }, 'as' => 'root']); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?php | ||
|
||
namespace OVAC\IDoc; | ||
|
||
class IDocLumenServiceProvider extends IDocServiceProvider | ||
{ | ||
public function boot() | ||
{ | ||
$this->registerRoutes(); | ||
$this->registerPublishing(); | ||
|
||
$this->loadTranslationsFrom(__DIR__ . '/../../resources/lang', 'idoc'); | ||
$this->loadViewsFrom(__DIR__ . '/../../resources/views/', 'idoc'); | ||
|
||
if ($this->app->runningInConsole()) { | ||
$this->commands([ | ||
IDocGeneratorCommand::class, | ||
]); | ||
} | ||
} | ||
|
||
protected function registerRoutes() | ||
{ | ||
app()->router->group($this->routeConfiguration(), function ($router) { | ||
require __DIR__ . '/../../resources/routes/lumen.php'; | ||
}); | ||
} | ||
|
||
protected function routeConfiguration() | ||
{ | ||
return [ | ||
'domain' => config('idoc.domain'), | ||
'prefix' => config('idoc.path'), | ||
'middleware' => config('idoc.middleware', []), | ||
'as' => 'idoc', | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters