framework: route() helper function does not work well in artisan commands
In Laravel 5.2.39, my app has
.env
APP_URL=http://dev.env/smartbots
config/app.php
'url' => env('APP_URL'),
app/Http/routes.php
Route::get('test', function () {
dd(route('twilioVoiceRequest'));
});
Route::get('/twilio-voice-request', function() {
})->name('twilioVoiceRequest');
Artisan command (twilio:setup)
public function handle()
{
dd(route('twilioVoiceRequest'));
}
This is what i got from test route
and from php artisan twilio:setup
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 28 (19 by maintainers)
Commits related to this issue
- Change server variables when bootstrapping the app request from artisan. This change fixes #14139 — committed to j3j5/framework by j3j5 8 years ago
- Change server variables when bootstrapping the app request from artisan. This change fixes #14139 — committed to j3j5/framework by j3j5 8 years ago
We definitely don’t recommend you run apps on sub-folders though.
route()
helper usetoRoute()
andgetRouteDomain()
https://github.com/laravel/framework/blob/5.2/src/Illuminate/Routing/UrlGenerator.php#L324Is this a bug?
I can’t say for homestead… Let’s reference issue #17385 you have just created 😃