コード例 #1
0
ファイル: ResponseFactory.php プロジェクト: appkr/api
 /**
  * Create an instance of Laravel or Lumen ResponseFactory
  *
  * @return \Laravel\Lumen\Http\ResponseFactory
  */
 public function make()
 {
     if (is_lumen()) {
         return new \Laravel\Lumen\Http\ResponseFactory();
     }
     return app(\Illuminate\Contracts\Routing\ResponseFactory::class);
 }
コード例 #2
0
 /**
  * Publish examples
  */
 protected function publishExamples()
 {
     $this->publishes([realpath(__DIR__ . '/../database/migrations/') => database_path('migrations'), realpath(__DIR__ . '/../database/factories/') => database_path('factories')]);
     if (is_laravel()) {
         include __DIR__ . '/./example/routes.php';
     } elseif (is_lumen()) {
         $app = $this->app;
         include __DIR__ . '/./example/routes-lumen.php';
     }
 }