laravel¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓÃ
ÔÚlaravelÖУ¬¿ØÖÆÆ÷ÊÇÆäÖÐÒ»¸ö×îÖ÷ÒªµÄ×é¼þÖ®Ò»¡£ËüÓÃÓÚ´¦Öóͷ£Óû§ÇëÇ󣬲¢·µ»ØÏìÓ¦¡£È»¶ø£¬ÓÐʱ¼äÎÒÃÇ»áÓöµ½¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓõÄÎÊÌ⣬ÕâÊdz£¼ûµÄÎÊÌâ¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«Ì½ÌÖ¼¸ÖÖÔµ¹ÊÔÓÉÏ¢Õù¾ö¼Æ»®£¬ÒÔ×ÊÖú½â¾ö¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓõÄÎÊÌâ¡£
Ôµ¹ÊÔÓÉÒ»£ºÃüÃû¿Õ¼ä¹ýʧ
ÔÚLaravelÖУ¬¿ØÖÆÆ÷±ØÐèÔÚ׼ȷµÄÃüÃû¿Õ¼äϲŻªÊ¹Óá£ÈôÊÇÄãµÄ¿ØÖÆÆ÷ûÓÐÔÚ׼ȷµÄÃüÃû¿Õ¼äÏ£¬Laravel¾ÍÎÞ·¨×Ô¶¯¼ÓÔØËüÃÇ£¬½ø¶øµ¼Ö¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓõÄÎÊÌâ¡£
½â¾ö¼Æ»®£ºÈ·±£¿ØÖÆÆ÷λÓÚ׼ȷµÄÃüÃû¿Õ¼äÏ¡£Ä¬ÈÏÇéÐÎÏ£¬¿ØÖÆÆ÷Ó¦¸ÃλÓÚAppHttpControllersÃüÃû¿Õ¼äÏ¡£ÈôÊÇÄ㽨ÉèÁËÒ»¸ö×Ô½ç˵ÃüÃû¿Õ¼ä£¬È·±£ÄãµÄ¿ØÖÆÆ÷ÃüÃû¿Õ¼äºÍĿ¼·¾¶Óë֮ƥÅä¡£
Ôµ¹ÊÔÓɶþ£º¿ØÖÆÆ÷ÀàÃû¹ýʧ
¿ØÖÆÆ÷ÀàÃû±ØÐèÇкÏLaravelµÄÃüÃû¹æÔòºÍÔ¼¶¨¡£ÈôÊÇÄãµÄ¿ØÖÆÆ÷ÀàÃû²»Çкϻ®¶¨£¬»áµ¼ÖÂLaravelÎÞ·¨×Ô¶¯¼ÓÔØËüÃÇ£¬´Ó¶øʹ¿ØÖÆÆ÷ÎÞ·¨Ê¹Óá£
½â¾ö¼Æ»®£ºÈ·±£ÄãµÄ¿ØÖÆÆ÷ÀàÃûÇкÏLaravelµÄÃüÃû¹æÔòºÍÔ¼¶¨¡£¿ØÖÆÆ÷ÀàÃûÓ¦¸Ã½ÓÄÉÅÁ˹¿¨ÃüÃû·¨£¨PascalCase£©£¬ÀýÈçUserController¡£Í¬Ê±È·±£ÔÚ½ç˵¿ØÖÆÆ÷Ààʱ£¬Ê¹ÓÃ׼ȷµÄÀàÃû£¬ÈôÊÇÀàÃû¹ýʧ½«»áµ¼Ö¿ØÖÆÆ÷ÎÞ·¨Ê¹Óá£
Ôµ¹ÊÔÓÉÈý£ºÂ·Óɹýʧ
ÔÚLaravelÖУ¬¿ØÖÆÆ÷ÐèҪͨ¹ý·Óɰ󶨲Żª±»Ê¹Óá£ÈôÊÇÄãµÄ·ÓÉûÓÐ׼ȷµØÖ¸Ïò¿ØÖÆÆ÷£¬¿ØÖÆÆ÷Ò²½«ÎÞ·¨Ê¹Óá£
½â¾ö¼Æ»®£ºÈ·±£ÄãµÄ·ÓÉ׼ȷµØÖ¸Ïò¿ØÖÆÆ÷¡£ÔÚWeb.php»òApi.phpÎļþÖУ¬ÄãÐèҪͨ¹ýRoute::get»òRoute::postµÈÒªÁìÀ´½ç˵·ÓÉ£¬²¢Ö¸¶¨¿ØÖÆÆ÷µÄÃû³ÆºÍÒªÁìÃû¡£È·±£ÄãµÄ·ÓɺͿØÖÆÆ÷Ãû³ÆºÍÒªÁìÃûÏàÆ¥Åä¡£ÈôÊÇÕÕ¾ÉÎÞ·¨Ê¹Ó㬿ÉÒÔʵÑéÖ´ÐÐphp artisan route:listÏÂÁî¼ì²é·ÓɵÄ׼ȷÐÔ¡£
Ôµ¹ÊÔÓÉËÄ£ºÒÀÀµ×¢Èë¹ýʧ
ÔÚLaravelÖУ¬¿ØÖÆÆ÷ͨ³£ÐèÒªÒÀÀµ×¢ÈëÀ´»ñÈ¡Êý¾ÝºÍЧÀÍ¡£ÈôÊÇÄãµÄÒÀÀµ×¢È벻׼ȷ£¬¿ØÖÆÆ÷Ò²½«ÎÞ·¨Ê¹Óá£
½â¾ö¼Æ»®£ºÈ·±£ÄãµÄÒÀÀµ×¢Èë׼ȷ¡£¼ì²é¿ØÖÆÆ÷½á¹¹º¯ÊýÖеÄÒÀÀµÏ²¢È·±£ÕâЩÒÀÀµÏî¿ÉÓá£ÈôÊÇÒÀÀµÏîδ׼ȷ°ó¶¨£¬»òÕßÒÀÀµÏîÎÞ·¨ÆÊÎö£¬Ôò¿ØÖÆÆ÷½«ÎÞ·¨Ê¹Óá£Ê¹ÓÃLaravelÌṩµÄÈÝÆ÷£¬¿ÉÒÔÇáËɵؽâ¾öÕâ¸öÎÊÌâ¡£
½áÂÛ
ÔÚLaravelÖУ¬¿ØÖÆÆ÷ÊÎÑÝ×ÅÖÁ¹ØÖ÷ÒªµÄ½ÇÉ«£¬ÈÏÕæ´¦Öóͷ£Óû§ÇëÇó²¢·µ»ØÏìÓ¦¡£ÈôÊÇ·ºÆð¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓõÄÎÊÌ⣬¿ÉÄÜÊÇÓÉÓÚÃüÃû¿Õ¼ä¹ýʧ£¬¿ØÖÆÆ÷ÀàÃû¹ýʧ£¬Â·Óɹýʧ»òÒÀÀµ×¢Èë¹ýʧµÈÎÊÌâÒýÆðµÄ¡£Í¨¹ý¼ì²éÕâЩÎÊÌ⣬²¢½ÓÄÉÏìÓ¦µÄ½â¾ö¼Æ»®£¬¿ÉÒÔÇáËɵؽâ¾ö¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓõÄÎÊÌâ¡£
ÒÔÉϾÍÊÇlaravel¿ØÖÆÆ÷ÎÞ·¨Ê¹ÓõÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡