Browse Source

Set Str alias for Lumen

shalvah 4 years ago
parent
commit
2b523a57eb
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/ScribeServiceProvider.php

+ 6 - 1
src/ScribeServiceProvider.php

@@ -40,10 +40,15 @@ class ScribeServiceProvider extends ServiceProvider
 
         // Bind the route matcher implementation
         $this->app->bind(RouteMatcherInterface::class, config('scribe.routeMatcher', RouteMatcher::class));
+
+        if (!class_exists('Str')) {
+            // Lumen may not have the aliases set up, and we don't want to have to use the FQN in our blade files.
+            class_alias(\Illuminate\Support\Str::class, 'Str');
+        }
     }
 
     /**
-     * Initializing routes in the application.
+     * Add docs routes for users that want their docs to pass through their Laravel app.
      */
     protected function bootRoutes()
     {