laradock的workspace下創建指定版本的laravel


一、使用composer創建laravel 8

composer create-project laravel/laravel:^8.0 example-app

 

報錯:

COMPOSER_AUTH" does not match the expected JSON schema, this may result in errors and should be resolved:
- Boolean value found, but an object is required

 

在/var/www下執行 echo $COMPOSER_AUTH 返回 false

 

解決:

export COMPOSER_AUTH=
composer update -- 可以忽略此步驟

 

二、使用laravel installer

composer global require laravel/installer
laravel new my-app

 

laravel installer 會根據php的版本安裝對應版本的laravel,但是不能指定具體的版本 

 

在開發環境下,可以安裝laravel debugbar,方便進行調試,執行下面的命令

composer require barryvdh/laravel-debugbar --dev

 開發模式下,使用debugbar,需要確保滿足以下條件:

.env的APP_DEBUG=true

把 Barryvdh\Debugbar\ServiceProvider::class, 添加到 config/app.php 的 providers 數組里。

如果想更方便的使用debugbar,可以借助laravel的facade特性實現,把 'Debugbar' => Barryvdh\Debugbar\Facades\Debugbar::class, 添加到 config/app.php 的 aliases 數組里。

發布debugbar的自定義配置,執行如下命令:

php artisan vendor:publish --provider="Barryvdh\Debugbar\ServiceProvider"

 

參考資料

https://laravel.com/docs/8.x/installation

https://github.com/laradock/laradock/issues/3189

https://github.com/barryvdh/laravel-debugbar


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM