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

laravelÕÒ²»µ½Ñùʽ

ÔÚ¿ª·¢webÓ¦ÓóÌÐòʱ£¬Ê¹ÓÃһЩǰ¶Ë¿ò¼ÜºÍ¿âÊǺܳ£¼ûµÄÊÂÇé¡£laravel×÷ΪһÖÖÊ¢ÐеÄphp web¿ò¼Ü£¬¿ÉÒÔ¼¯³ÉÖÖÖÖÇ°¶Ë¿ò¼ÜºÍ¿â¡£¿ÉÊÇÓÐʱ¼äÄã»á·¢Ã÷ÄãµÄlaravelÏîÄ¿ÖмÓÔز»³öÔ¤ÆÚµÄÑùʽ£¬Õâʱ¼ä¾ÍÐèÒªÕÒ³öÎÊÌâ³öÔÚÄÇÀ½â¾öÎÊÌâ¡£

Ê×ÏÈ£¬ÄãÐèҪȷ¶¨ÄãµÄÑùʽÎļþÊÇ·ñ±£´æ¡£ÔÚLaravel ÏîÄ¿ÖУ¬Ò»Ñùƽ³£ÇéÐÎÏÂCSSºÍJSÎļþÊÇ´æ·ÅÔÚpublicĿ¼ÏµÄ£¬Äã¿ÉÒÔͨ¹ýÔÚä¯ÀÀÆ÷µØµãÀ¸ÖÐÊäÈëhttp://localhost:8000/css/your_css_file.cssÉó²éÄãµÄÑùʽÎļþÊÇ·ñ±£´æ¡£ÈôÊÇÎļþ²»±£´æ£¬ËµÃ÷LaravelÔÚÆô¶¯ÏîĿʱûÓÐ׼ȷµØÌìÉúËüÃÇ¡£

Laravel ÏîÄ¿Æô¶¯Ê±»áÖ´ÐÐÐí¶à²Ù×÷¡£ÆäÖÐÒ»¸ö²Ù×÷ÊÇŲÓÃartisan serveÏÂÁ¸ÃÏÂÁî»áÆô¶¯Ò»¸öЧÀÍ£¬ÓÃÓÚ½«Ó¦ÓóÌÐòÊä³öµ½ä¯ÀÀÆ÷ÖС£Í¨³££¬ÈôÊÇÑùʽÎļþɥʧ£¬Ôµ¹ÊÔ­ÓÉ¿ÉÄÜÊÇÔËÐÐÏÂÁîʱ²ÎÊýת´ïʧ°Ü»òĿ¼ȨÏÞȱ·¦µÈÎÊÌâ¡£

µ±ÄãʹÓÃLaravel MixÒÔ¼°ÆäËûÇ°¶Ë¹¹½¨¹¤¾ßʱ£¬ÄãÐèÒªÌìÉúCSSºÍJSÎļþ¡£Laravel Mix»á½«Ô´´úÂë±àÒë³Éä¯ÀÀÆ÷¿ÉÒÔÃ÷È·µÄ´úÂ룬²¢½«Æä´æ´¢ÔÚpublicÎļþ¼ÐÖС£ÈôÊÇÄãÏëÒªÔÚLaravelÏîÄ¿ÖÐÒýÓÃÕâЩÎļþ£¬ÄãÐèҪȷ±£ËüÃÇ´æ´¢ÔÚ׼ȷµÄ·¾¶Ï¡£ÕâÊÇÓÉÓÚLaravel²¢²»ÖªµÀÄÄЩÎļþÓ¦¸ÃÓÃÓÚÇ°¶ËäÖȾ¡£

ÈôÊÇÄãµÄLaravelÏîÄ¿ÖеÄCSSºÍJSÎļþ±£´æ£¬ÄÇô½ÓÏÂÀ´ÐèÒª¼ì²éÊÇ·ñ׼ȷÒýÓÃÁËÑùʽÎļþ¡ £¿ÉÄÜ·ºÆðÒ»¸ö³£¼ûÎÊÌâÊÇ£¬µ±ÄãÔÚÎļþÖÐʹÓÃasset()º¯ÊýÒýÓÃCSSºÍJSÎļþʱ£¬ËüÎÞ·¨×¼È·µØÆÊÎöÎļþ·¾¶¡£Õâ¸öÎÊÌâÔÚʹÓÃLaravelµÄ¹²ÏíÖ÷»úÍйÜʱÌØÊâÈÝÒ×±¬·¢¡£

ΪÏàʶ¾öÕâ¸öÎÊÌ⣬Äã¿ÉÒÔʹÓÃurl()º¯Êý¶ø²»ÊÇasset()º¯Êý¡£ÕâÊÇÓÉÓÚurl()º¯ÊýÌìÉúµÄURL×ÜÊÇÏà¹ØÓÚÄãµÄÏîÄ¿¸ùĿ¼¡£ÔÚʹÓÃurl()º¯Êýʱ£¬ÄãÐèҪȷ±£ÄãµÄÇëÇóURLÖÐÓÐÇ°µ¼Ð±¸Ë¡£Äã¿ÉÒÔÔÚÊÓͼÎļþÖÐʹÓÃÒÔÏ´úÂ룺

<link href="{{ url('/css/your_css_file.css') }}" rel="stylesheet">
<script src="{{ url('/js/your_js_file.js') }}"></script>

µÇ¼ºó¸´ÖÆ

ÈôÊÇÄãÔÚЧÀÍÆ÷ÉÏÔËÐÐPHPʱʹÓÃÁËPHP-FPM£¬»òÕßʹÓÃÁËHTTPЧÀÍÆ÷¾ÙÐз´ÏòÊðÀí£¬ÄÇôÄãÐèÒªÌí¼ÓһЩÌØÁíÍâÉèÖá£ÔÚNginxÖÐÌí¼ÓÒÔÏÂÉèÖãº

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

µÇ¼ºó¸´ÖÆ

ÕâÑù£¬ÈôÊÇÄãµÄÑùʽÎļþÎÞ·¨±»ÕÒµ½£¬Laravel»á½«ÇëÇóת·¢µ½index.phpÎļþÖУ¬´Ó¶ø°ü¹ÜÇëÇóÄܹ»±»´¦Àí¡£

ÈôÊÇÄãµÄÑùʽÎļþ·¾¶×¼È·£¬¿ÉÊÇÕÕ¾ÉÎÞ·¨×¼È·µØ¼ÓÔØ£¬ÄÇ¿ÉÄÜÊÇ»º´æµÄÎÊÌâ¡£Äã¿ÉÒÔɨ³ýä¯ÀÀÆ÷»º´æ²¢ÖØмÓÔØÒ³Ã棬Ȼºó¿´¿´ÎÊÌâÊÇ·ñ»ñµÃ½â¾ö¡£ÈôÊÇÕÕ¾ÉûÓнâ¾ö£¬Äã¿ÉÒÔÔËÐÐÒÔÏÂÏÂÁîɨ³ýLaravelµÄ»º´æÎļþ£º

php artisan cache:clear
php artisan config:cache
php artisan route:cache

µÇ¼ºó¸´ÖÆ

ÕâЩÏÂÁɨ³ýLaravelµÄ»º´æÎļþ£¬²¢ÖØÐÂÌìÉúËüÃÇ¡£ÔÚÖ´ÐÐÕâЩÏÂÁîÖ®ºó£¬ÄãÐèÒªÖØÐÂÆô¶¯LaravelЧÀÍ£¬ÒÔ±ãËüÖØмÓÔØ»º´æÎļþ¡£

×ÜÖ®£¬ÈôÊÇÄãµÄLaravelÏîÄ¿ÖÐÎÞ·¨¼ÓÔØÑùʽÎļþ£¬ÄÇôÄãÐèÒª¼ì²éÑùʽÎļþÊÇ·ñ±£´æ¡¢ÑùʽÎļþ·¾¶ÊÇ·ñ׼ȷ¡¢ÒýÓÃÑùʽÎļþµÄ´úÂëÊÇ·ñ׼ȷÒÔ¼°»º´æÊÇ·ñ±»É¨³ýµÈÎÊÌâ¡£ÔÚ½â¾öÕâЩÎÊÌâºó£¬ÄãµÄLaravelÏîÄ¿¾ÍÄÜ׼ȷµØ¼ÓÔØÑùʽÎļþÁË¡£

ÒÔÉϾÍÊÇlaravelÕÒ²»µ½ÑùʽµÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ