Skip to content

Instantly share code, notes, and snippets.

@ederrafo
Last active July 12, 2020 01:38
Show Gist options
  • Save ederrafo/b80b659ccf1d58869c79acbab27cac1a to your computer and use it in GitHub Desktop.
Save ederrafo/b80b659ccf1d58869c79acbab27cac1a to your computer and use it in GitHub Desktop.
laravel install

Laravel install

Upgrade

Upgrading :

# php --version
PHP 7.2.24-0ubuntu0.18.04.6 (cli) (built: May 26 2020 13:09:11) ( NTS )
# php artisan --version
Laravel Framework 5.8.38

From :

$ php --version
PHP 7.3.11 (cli) (built: Feb 29 2020 02:50:36) ( NTS )
$ php artisan --version
Laravel Framework 5.5.48

Solution laravel/framework#23058

Trusted proxies

Due to underlying changes in the trusted proxy functionality of Symfony HttpFoundation, slight changes must be made to your application's App\Http\Middleware\TrustProxies middleware. The $headers property, which was previously an array, is now a bit property that accepts several different values. For example, to trust all forwarded headers, you may update your $headers property to the following value:

use Illuminate\Http\Request;

/**
 * The headers that should be used to detect proxies.
 *
 * @var int
 */
protected $headers = Request::HEADER_X_FORWARDED_ALL;

For more information on the available $headers values, check out the full documentation on trusting proxies.

Application structure

Folder Events are used to trigger activities, raise errors or necessary validations and provide greater flexibility. Laravel keeps all the events under one directory. The default file included is event.php where all the basic events are declared.

  • create a controller php artisan make:controller Front

  • If migrate result this: SQLSTATE[42000]: Syntax error or access violation: 1071 Specified key was too long; max key length is 767 bytes solved: In AppServiceProvider.php use Illuminate\Support\Facades\Schema; // epe https://laravel-news.com/laravel-5-4-key-too-long-error Schema::defaultStringLength(191);

  • Class ‘App\Http\Controllers\Auth\Socialite’ not found solved: user Socialite

  • php artisan config:clear


$ composer global require "laravel/installer"

macOS: $HOME/.composer/vendor/bin GNU / Linux Distributions: $HOME/.config/composer/vendor/bin

$ laravel new blog

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment