尊龙凯时人生就是搏

Laravel¿ª·¢£ºÔõÑùʹÓÃLaravel ValetÉèÖÿª·¢ÇéÐÎ £¿

×÷ΪһÃûphp¿ª·¢Õߣ¬ÎªÁËÓÐÓõؿª·¢Ó¦ÓóÌÐòºÍÍøÕ¾£¬Ò»¸öÓÅÒìµÄ¿ª·¢ÇéÐÎÊDZز»¿ÉÉٵġ£laravel valet ÊÇÒ»ÖÖºÜÊÇÊ¢ÐкÍÒ×ÓÚʹÓõŤ¾ß£¬¿ÉÒÔ×ÊÖúÄãÇáËɵØÉèÖÃlaravel¿ª·¢ÇéÐΡ£ÔÚÕâƪÎÄÕÂÖУ¬ÎÒÃǽ«ÏÈÈÝÔõÑùʹÓÃlaravel valetÉèÖÿª·¢ÇéÐΡ£

ʲôÊÇLaravel Valet £¿

Laravel Valet ÊÇÒ»¸ö»ùÓÚMacµÄ¿ª·¢ÇéÐΣ¬ËüרÃÅΪLaravel¿ò¼Ü¶¨ÖÆ¡£Ëü¿ÉÒÔÇáËɵØÉèÖÃÄãµÄÍâµØ¿ª·¢ÇéÐΣ¬¶ø²»ÐèÒªÊÖ¶¯×°ÖÃЧÀÍÆ÷Èí¼þ¡¢ÉèÖÃÐéÄâÖ÷»ú»òµ÷½â¶Ë¿ÚºÅµÈ·±ËöµÄʹÃü¡£Laravel Valet½ÓÄÉÁËNgrokºÍDnsMasqµÈÊÖÒÕ£¬¿ÉÌṩ¸ßЧµÄ±¾»ú¿ª·¢ÇéÐΡ£

×°ÖÃLaravel Valet

ÔÚ×îÏÈʹÓÃLaravel Valet֮ǰ£¬ÇëÈ·±£ÄãµÄϵͳÒѾ­×°ÖÃÁËHomebrewºÍComposer¡ £¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´×°ÖÃËüÃÇ£º

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

µÇ¼ºó¸´ÖÆ

brew install composer

µÇ¼ºó¸´ÖÆ

È»ºó£¬Ê¹ÓÃComposerͨ¹ýÒÔÏÂÏÂÁîÀ´×°ÖÃLaravel Valet£º

composer global require laravel/valet

µÇ¼ºó¸´ÖÆ

×°ÖÃÍê³Éºó£¬Ê¹ÓÃÒÔÏÂÏÂÁîÀ´ÔËÐÐLaravel ValetµÄ×°ÖÃÆ÷£º

valet install

µÇ¼ºó¸´ÖÆ

Õ⽫Íê³ÉLaravel ValetµÄ×°ÖúͳõʼÉèÖá£

ʹÓÃLaravel Valet

ÔÚ×°ÖÃÍêLaravel ValetÖ®ºó£¬Äã¿ÉÒÔÇáËɵØʹÓÃÒÔÏÂÏÂÁîÀ´½¨ÉèLaravelÓ¦ÓóÌÐò£º

cd ~/Sites
laravel new my-app

µÇ¼ºó¸´ÖÆ

Õ⽫ÓÃLaravel¿ò¼Ü½¨ÉèÒ»¸öеÄÏîÄ¿£¬²¢´æ´¢ÔÚ ~/Sites/my-app Ŀ¼ÖС£

½ÓÏÂÀ´£¬Ê¹ÓÃÒÔÏÂÏÂÁĿ½ñĿ¼°ó¶¨µ½ValetÓòÃû£º

cd my-app
valet link

µÇ¼ºó¸´ÖÆ

Íê³É´Ë²Ù×÷ºó£¬Äã¾Í¿ÉÒÔͨ¹ý http://my-app.test »á¼ûÄãµÄÓ¦ÓóÌÐòÁË¡£

ÈôÊÇÄãÓжà¸öÏîÄ¿ÐèÒªÖÎÀí£¬¿ÉÒÔʹÓÃÒÔÏÂÏÂÁÉèÒ»¸öÈ«¾ÖÊðÀí²¢·ÖÅɸøÏìÓ¦µÄÏîÄ¿£º

cd my-app
valet park

µÇ¼ºó¸´ÖÆ

´ËÏÂÁʹÓÃÄ¿½ñÎļþ¼ÐµÄÃû³ÆΪÏîÄ¿½¨ÉèÒ»¸öValetÊðÀí£¬²¢½«´ËÊðÀí·ÖÅɸø http://my-app.test ÓòÃû¡£

ʹÓÃÊý¾Ý¿â

µ±ÄãʹÓÃLaravel Valetʱ£¬ËüʹÓÃSQLite×÷ΪĬÈÏÊý¾Ý¿â¡£¿ÉÊÇ£¬ÈôÊÇÄãÐèҪʹÓÃMySQL»òÆäËûÊý¾Ý¿â£¬¿ÉÒÔ°´ÒÔÏ°취²Ù×÷£º

×°ÖÃÊý¾Ý¿â

ʹÓÃÒÔÏÂÏÂÁMySQL×°Öõ½ÅÌËã»úÉÏ£º

brew install mysql

µÇ¼ºó¸´ÖÆ

µ±×°ÖÃÍê³Éºó£¬Ê¹ÓÃÒÔÏÂÏÂÁMySQL×÷ΪϵͳЧÀÍÆô¶¯£º

brew services start mysql

µÇ¼ºó¸´ÖÆ

ÉèÖÃÊý¾Ý¿â

ʹÓÃÒÔÏÂÏÂÁî½øÈëMySQL¿ØÖÆ̨£º

mysql -u root

µÇ¼ºó¸´ÖÆ

Õ⽫½øÈëMySQLÏÂÁîÐнçÃæ¡£Ôڴ˽çÃæÖУ¬¼üÈëÒÔÏÂÏÂÁîÒÔ½¨ÉèеÄÊý¾Ý¿â£º

CREATE DATABASE my_database;

µÇ¼ºó¸´ÖÆ

Õ⽫½¨ÉèÒ»¸öÃûΪ my_database µÄÐÂÊý¾Ý¿â¡£

ÉèÖÃÓ¦ÓóÌÐò

ƾ֤LaravelµÄͨÀýÉèÖÃÀú³Ì£¬ÔÚ .env ÎļþÖÐÉèÖÃÊý¾Ý¿âÅþÁ¬¡£¸üÐÂÒÔÏÂÐУº

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=my_database
DB_USERNAME=root
DB_PASSWORD=

µÇ¼ºó¸´ÖÆ

ÔÚÕâÀ½«Êý¾Ý¿âµÄÃû³Æ¡¢Óû§ÃûºÍÃÜÂëÌ滻ΪÏÖʵֵ¡£

ǨáãÊý¾Ý¿â

ÔÚÉèÖÃÁË׼ȷµÄÊý¾Ý¿âÅþÁ¬ºó£¬ÔËÐÐÒÔÏÂÏÂÁîÒÔ½¨ÉèÊý¾Ý¿â±íºÍ½á¹¹£º

php artisan migrate

µÇ¼ºó¸´ÖÆ

Õ⽫½¨ÉèÊý¾Ý¿â±í£¬²¢È·±£ÅþÁ¬µ½×¼È·µÄÊý¾Ý¿â¡£

×ܽá

ÔÚ±¾ÎÄÖУ¬ÎÒÃÇÏÈÈÝÁËLaravel ValetµÄ»ù±¾¿´·¨ÒÔ¼°ÔõÑùʹÓÃËüÀ´ÉèÖúÍÖÎÀíLaravel¿ª·¢ÇéÐΡ£ValetÌṩÁËÒ»¸öºÜÊÇÓÐÓúÍÀû±ãµÄ·½·¨À´ÖÎÀíÄãµÄÏîÄ¿ºÍµ÷ÊÔÀú³Ì£¬×ÊÖú¿ª·¢ÕßΪËûÃǵÄÓ¦ÓóÌÐòÌṩ¸ßЧ¡¢¿É¿¿µÄЧÀÍ¡£

ÒÔÉϾÍÊÇLaravel¿ª·¢£ºÔõÑùʹÓÃLaravel ValetÉèÖÿª·¢ÇéÐÎ £¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

ÁªÏµ尊龙凯时人生就是搏

18523999891

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

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

QR code
sitemap¡¢ÍøÕ¾µØͼ