mercredi 7 mars 2018

Environment stays Local when deploying Laravel to Heroku

I'm trying to set dev + production environment in Laravel 5, but when i check the current environment - i get Local in both cases...when i work local and when i deploy to Heroku...

I want to create the 2 environments for switch from https to http smoothly...

Here is the AppServiceProvider.php file...

<?php

        namespace App\Providers;
        use App;
        use Illuminate\Support\ServiceProvider;

        class AppServiceProvider extends ServiceProvider
        {

            public function boot()
            {
                $environment = App::environment();
                echo '<pre>';
                print_r($environment); // prints Local - always
                echo '</pre>';
                die();
                if (App::environment('production', 'staging'))
                {
                    \URL::forceSchema('https');
                }
                else
                {
                    echo "environment=", App::environment(), "\n";
                }
            }

            public function register()
            {
                //
            }
        }



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2toLvOp
via IFTTT

Aucun commentaire:

Enregistrer un commentaire