Skip to content

Commit

Permalink
feat(http): add http&https setting, force to use config's host url
Browse files Browse the repository at this point in the history
  • Loading branch information
GimmyHchs committed Jun 2, 2018
1 parent 50a201b commit 10da9ff
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
APP_NAME=CocoCharge
APP_NAME=CocoCharge-Local
APP_ENV=local
APP_KEY=
APP_DEBUG=true
APP_URL=http://localhost
APP_SCHEME=http

LOG_CHANNEL=stack

Expand Down
3 changes: 3 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use Barryvdh\Debugbar\ServiceProvider as DebugBarServiceProvider;
use Illuminate\Support\ServiceProvider;
use URL;

class AppServiceProvider extends ServiceProvider
{
Expand All @@ -12,6 +13,8 @@ class AppServiceProvider extends ServiceProvider
*/
public function boot()
{
URL::forceRootUrl(config('app.url'));
URL::forceScheme(config('app.scheme'));
}

/**
Expand Down
9 changes: 2 additions & 7 deletions config/app.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?php

return [

/*
|--------------------------------------------------------------------------
| Application Name
Expand All @@ -13,7 +12,7 @@
|
*/

'name' => env('APP_NAME', 'Laravel'),
'name' => env('APP_NAME', 'CocoCharge'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -53,6 +52,7 @@
*/

'url' => env('APP_URL', 'http://localhost'),
'scheme' => env('APP_SCHEME', 'http'),

/*
|--------------------------------------------------------------------------
Expand Down Expand Up @@ -120,7 +120,6 @@
*/

'providers' => [

/*
* Laravel Framework Service Providers...
*/
Expand Down Expand Up @@ -159,7 +158,6 @@
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,

],

/*
Expand All @@ -174,7 +172,6 @@
*/

'aliases' => [

'App' => Illuminate\Support\Facades\App::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
Expand Down Expand Up @@ -208,7 +205,5 @@
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,

],

];

0 comments on commit 10da9ff

Please sign in to comment.