forceSchema() публичный статический Метод

Force the schema for URLs.
public static forceSchema ( string $schema ) : void
$schema string
Результат void
Пример #1
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     if ($this->app->environment('production')) {
         \URL::forceSchema('https');
     }
 }
Пример #2
0
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     if (!\App::environment('local')) {
         \URL::forceSchema('http');
     }
 }
Пример #3
0
<?php

/*
|--------------------------------------------------------------------------
| Set $_SERVER['HTTPS'] dpending on HTTP_X_FORWARDED_PROTO
|--------------------------------------------------------------------------
|
| See: https://github.com/twostairs/paperwork/issues/281
| See: https://github.com/JamborJan/paperwork/issues/20
|
*/
if ((array_key_exists('HTTP_X_FORWARDED_PROTO', $_SERVER) ? $_SERVER['HTTP_X_FORWARDED_PROTO'] : 'HTTP_X_FORWARDED_PROTO not set') == "https") {
    $_SERVER['HTTPS'] = "on";
    URL::forceSchema('https');
}
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the Closure to execute when that URI is requested.
|
*/
Blade::setContentTags('[[', ']]');
Blade::setEscapedContentTags('[[[', ']]]');
App::missing(function ($exception) {
    return Response::view('404', array(), 404);
});
if (Config::get('paperwork.sandstorm')) {
Пример #4
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
URL::forceSchema("https");
Route::get('/', 'PagesController@home');
Route::get('contact', 'PagesController@contact');
Route::get('login', 'PagesController@login');
Route::get('register', 'PagesController@register');