×ðÁú¿­Ê±¹ÙÍøµÇ¼

laravel composerÔõôװÖÃ

laravelÊÇÒ»¿î»ùÓÚphpÓïÑÔ¿ª·¢µÄwebÓ¦Óÿò¼Ü £¬Ëü½ÓÄÉÁËÐí¶àÏȽøµÄÊÖÒÕºÍÉè¼ÆÍ·ÄÔ £¬¸øweb¿ª·¢´øÀ´ÁËÐí¶à±ãµ±¡£laravelÒÀÀµÓÚcomposer¾ÙÐаü¹ÜÀí £¬¿ÉÒÔÇáËɵØ×°Öú͸üÐÂÒÀÀµ¹Øϵ¡£±¾ÎĽ«ÏÈÈÝÔõÑùʹÓÃcomposer×°ÖÃlaravel¡£

×°ÖÃComposer

ÔÚʹÓÃComposer×°ÖÃLaravel֮ǰ £¬Ê×ÏÈÐèÒªÔÚ±¾»úÉÏ×°ÖÃComposer¡£×î¼òÆÓµÄ×°ÖÃÒªÁìÊÇʹÓÃϵͳ°ü¹ÜÀíÆ÷¾ÙÐÐ×°Öà £¬ÀýÈçÔÚUbuntuÉÏʹÓÃÒÔÏÂÏÂÁ

sudo apt-get update
sudo apt-get install composer

µÇ¼ºó¸´ÖÆ

×°ÖÃÍê³Éºó £¬¿ÉÒÔͨ¹ýÔËÐÐÒÔÏÂÏÂÁîÀ´ÑéÖ¤ÊÇ·ñ×°ÖÃÀֳɣº

composer --version

µÇ¼ºó¸´ÖÆ

½¨ÉèLaravelÏîÄ¿

ÔÚ×°ÖÃComposerÖ®ºó £¬¾Í¿ÉÒÔ×îÏȽ¨ÉèLaravelÏîÄ¿ÁË¡£¿ÉÒÔͨ¹ýÔËÐÐÒÔÏÂÏÂÁîÀ´½¨ÉèÏîÄ¿£º

composer create-project --prefer-dist laravel/laravel project-name

µÇ¼ºó¸´ÖÆ

ÆäÖÐ £¬project-nameΪÏîÄ¿µÄÃû³Æ £¬¿ÉÒÔƾ֤×Ô¼ºµÄÐèÇó¾ÙÐÐÐ޸ġ£ÏîÄ¿½¨ÉèÍê³Éºó £¬¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁî½øÈëÏîĿĿ¼£º

cd project-name

µÇ¼ºó¸´ÖÆ

ÉèÖÃÊý¾Ý¿â

ÔÚ½¨ÉèLaravelÏîÄ¿Ö®ºó £¬ÐèÒªÉèÖÃÊý¾Ý¿â¡£ÔÚÏîÄ¿¸ùĿ¼Ï £¬¿ÉÒÔÕÒµ½.env.exampleÎļþ £¬½«Æ临ÖÆΪ.envÎļþ¡£È»ºó·­¿ª.envÎļþ £¬ÕÒµ½ÒÔÏ´úÂ룺

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=homestead
DB_USERNAME=homestead
DB_PASSWORD=secret

µÇ¼ºó¸´ÖÆ

½«ÆäÐÞ¸ÄΪ×Ô¼ºµÄÊý¾Ý¿âÐÅÏ¢¡£

ÌìÉúÓ¦ÓÃÃÜÔ¿

ÔÚÏîÄ¿ÖÐ £¬ÐèÒªÌìÉúÒ»¸öÓ¦ÓÃÃÜÔ¿¡£¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´ÌìÉú£º

php artisan key:generate

µÇ¼ºó¸´ÖÆ

ÔËÐÐLaravelЧÀÍ

ÔÚÍê³ÉÒÔÉÏ°ì·¨Ö®ºó £¬¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁîÀ´ÔËÐÐLaravelЧÀÍ£º

php artisan serve

µÇ¼ºó¸´ÖÆ

ÔËÐÐÀֳɺó £¬¿ÉÒÔÔÚä¯ÀÀÆ÷Öлá¼û¸ÃµØµã £¬Éó²éLaravelµÄ½Ó´ýÒ³Ãæ¡£

×°ÖÃLaravelÀ©Õ¹

LaravelÒѾ­Ô¤×°ÖÃÁËÐí¶à³£ÓõÄÀ©Õ¹ £¬¿ÉÊÇÓÐЩÀ©Õ¹¿ÉÄÜÐèÒªÊÖ¶¯×°Ö᣿ÉÒÔͨ¹ýComposerÀ´×°ÖÃLaravelÀ©Õ¹¡£ÀýÈç £¬ÈôÊÇÐèҪװÖÃLaravelµÄdebugbarÀ©Õ¹ £¬¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁ

composer require barryvdh/laravel-debugbar

µÇ¼ºó¸´ÖÆ

×°ÖÃÍê³Éºó £¬ÐèÒªÔÚconfig/app.phpÎļþÖÐÌí¼ÓÒÔÏ´úÂëÀ´ÒýÓøÃÀ©Õ¹£º

'providers' => [
    // ...
    Barryvdh\Debugbar\ServiceProvider::class,
    // ...
],

'aliases' => [
    // ...
    'Debugbar' => Barryvdh\Debugbar\Facade::class,
    // ...
],

µÇ¼ºó¸´ÖÆ

È»ºó¿ÉÒÔʹÓÃÒÔÏ´úÂëÔÚ´úÂëÖÐŲÓøÃÀ©Õ¹£º

Debugbar::info($someVariable);

µÇ¼ºó¸´ÖÆ

×ܽá

ʹÓÃComposer×°ÖÃLaravelÊǺÜÊÇÀû±ãºÍ¿ì½ÝµÄ¡£¿ÉÒÔͨ¹ý¼òÆÓµÄÏÂÁîÀ´½¨ÉèÏîÄ¿ £¬×°ÖÃÒÀÀµ¹ØϵºÍÀ©Õ¹ £¬ÌìÉúÓ¦ÓÃÃÜÔ¿ÒÔ¼°Ò»ÏµÁеĿª·¢Ê¹Ãü¡£ÔÚÏÖʵ¿ª·¢Àú³ÌÖÐ £¬LaravelΪ¿ª·¢Ö°Ô±ÌṩÁËÐí¶àÓÅÒìµÄ¹¦Ð§ºÍ¹¤¾ß £¬ÕâʹµÃ¿ª·¢ÍŶӿÉÒÔ¸ü¸ßЧµØ¾ÙÐпª·¢ÊÂÇé¡£

ÒÔÉϾÍÊÇlaravel composerÔõôװÖõÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

ÃâÔð˵Ã÷£ºÒÔÉÏչʾÄÚÈÝȪԴÓÚÏàÖúýÌå¡¢ÆóÒµ»ú¹¹¡¢ÍøÓÑÌṩ»òÍøÂçÍøÂçÕûÀí £¬°æȨÕùÒéÓë±¾Õ¾ÎÞ¹Ø £¬ÎÄÕÂÉæ¼°¿´·¨Óë¿´·¨²»´ú±í×ðÁú¿­Ê±¹ÙÍøµÇ¼ÂËÓÍ»úÍø¹Ù·½Ì¬¶È £¬Çë¶ÁÕß½ö×ö²Î¿¼¡£±¾ÎĽӴýתÔØ £¬×ªÔØÇë˵Ã÷À´ÓÉ¡£ÈôÄúÒÔΪ±¾ÎÄÇÖÕ¼ÁËÄúµÄ°æȨÐÅÏ¢ £¬»òÄú·¢Ã÷¸ÃÄÚÈÝÓÐÈκÎÉæ¼°ÓÐÎ¥¹«µÂ¡¢Ã°·¸Ö´·¨µÈÎ¥·¨ÐÅÏ¢ £¬ÇëÄúÁ¬Ã¦ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼ʵʱÐÞÕý»òɾ³ý¡£

Ïà¹ØÐÂÎÅ

ÁªÏµ×ðÁú¿­Ê±¹ÙÍøµÇ¼

18523999891

¿É΢ÐÅÔÚÏß×Éѯ

ÊÂÇéʱ¼ä£ºÖÜÒ»ÖÁÖÜÎå £¬9:30-18:30 £¬½ÚãåÈÕÐÝÏ¢

QR code
ÍøÕ¾µØͼ