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

laravel·ÓÉÌøתʧ°Ü

ÔÚʹÓà laravel ¿ò¼Ü¾ÙÐпª·¢µÄÀú³ÌÖÐ £¬ÎÒÃǾ­³£ÐèҪʹÓõ½Â·ÓÉÌøת £¬¿ÉÊÇÔÚijЩÇéÐÎÏ £¬ÎÒÃÇ¿ÉÄÜ»áÓöµ½Â·ÓÉÌøתʧ°ÜµÄÇéÐÎ £¬µ¼ÖÂÎÒÃǵÄÓ¦ÓÃÎÞ·¨Õý³£ÔËÐС£±¾ÎĽ«ÏÈÈÝһЩ³£¼ûµÄ laravel ·ÓÉÌøתʧ°ÜµÄÔµ¹ÊÔ­ÓÉÒÔ¼°½â¾öÒªÁì¡£

·ÓÉÌøתµÄ·¾¶²»×¼È·

ÈôÊÇÎÒÃÇÔÚʹÓà Laravel ¾ÙÐзÓÉÌøתʱ £¬Â·¾¶²»×¼È· £¬ÊÇÎÞ·¨ÀÖ³ÉÌøתµÄ¡£Òò´Ë £¬Ê×ÏÈÐèҪȷ±£ÎÒÃÇдµÄÌøת·¾¶×¼È·¡£ÎÒÃÇ¿ÉÒÔʵÑéʹÓÃÏÂÁîÐÐÊäÈë php artisan route:list À´Éó²éÎÒÃǽç˵µÄ·ÓÉÁÐ±í¼°Æä¶ÔÓ¦µÄ·¾¶ £¬È·±£Ìøת·¾¶µÄ׼ȷÐÔ¡£

Öض¨Ïò»á»°ÓâÆÚ

ÔÚ Laravel Ó¦ÓÃÖÐ £¬Öض¨Ïòµ½ÁíÒ»¸ö·ÓÉʱ £¬Ó¦ÓûὫĿ½ñ»á»°ÐÅÏ¢´æ´¢µ½»á»°ÖÐÑë¼þÖС£µ±Â·ÓÉÌøתʧ°Üʱ £¬»á»°ÐÅÏ¢»áÓâÆÚ²¢±»Ïú»Ù¡£ÎªÁË×èÖ¹»á»°ÐÅÏ¢ÓâÆÚ £¬ÎÒÃÇ¿ÉÒÔʹÓà Laravel ÌṩµÄ Redirect ÀàÖÐÑë¼þ £¬½«Öض¨ÏòÇëÇó·¢Ë͵½ÁíÒ»¸öURL £¬²¢´øÊÜÆ­Ç°»á»°ÐÅÏ¢¡£ÀýÈ磺

return redirect()->route('home')->with('message', 'Welcome back!');

µÇ¼ºó¸´ÖÆ

ÎÞ·¨ÕÒµ½¿ØÖÆÆ÷

µ±ÎÒÃǽç˵һ¸ö·ÓÉʱ £¬ÎÒÃÇÐèÒªÖ¸¶¨¶ÔÓ¦µÄ¿ØÖÆÆ÷¼°ÆäÒªÁì¡£ÈôÊÇÎÒÃÇÔÚÖ¸¶¨¿ØÖÆÆ÷ʱ £¬Â·¾¶²»×¼È·»òÕß¿ØÖÆÆ÷Ãû³Æ²»×¼È· £¬Ôò»áÌøתʧ°Ü¡£ÔÚ Laravel Ó¦ÓÃÖÐ £¬ÎÒÃÇÐèÒª½«¿ØÖÆÆ÷°²ÅÅÔÚ app/Http/Controllers Ŀ¼Ï £¬²¢Ê¹ÓÃÃüÃû¿Õ¼ä AppHttpControllers¡£ÀýÈç £¬ÎÒÃǽç˵һ¸öÃûΪ HomeController µÄ¿ØÖÆÆ÷ £¬ËüµÄ·¾¶Ó¦¸ÃΪ app/Http/Controllers/HomeController.php £¬²¢ÇÒËüµÄÃüÃû¿Õ¼äÓ¦¸ÃΪ AppHttpControllers¡£ÔÚ½ç˵·ÓÉʱ £¬ÎÒÃÇÐèҪͨ¹ý¿ØÖÆÆ÷Ãû³ÆºÍÒªÁìÃû³ÆÀ´Ö¸¶¨Â·ÓɶÔÓ¦µÄ²Ù×÷¡£ÀýÈ磺

Route::get('/home', 'HomeController@index')->name('home');

µÇ¼ºó¸´ÖÆ

ʹÓùýʧµÄ HTTP ÒªÁì

ÔÚ Laravel Ó¦ÓÃÖÐ £¬²î±ðµÄ HTTP ÒªÁì¶ÔÓ¦²î±ðµÄ·ÓɺͶÔÓ¦µÄ²Ù×÷¡£ÀýÈç GET ÇëÇóÒ»Ñùƽ³£ÌåÏÖÅÌÎÊ×ÊÔ´ £¬POST ÇëÇóÒ»Ñùƽ³£ÓÃÓÚ½¨Éè×ÊÔ´µÈ¡£ÈôÊÇÎÒÃÇÔÚ½ç˵·ÓÉʱ £¬Ê¹ÓÃÁ˹ýʧµÄ HTTP ÒªÁì £¬»áµ¼Ö·ÓÉÌøתʧ°Ü¡£ÔÚ Laravel ÖÐ £¬ÎÒÃÇ¿ÉÒÔʹÓà Route ÀàµÄ²î±ðÒªÁìÀ´½ç˵²î±ð HTTP ÒªÁìµÄ·ÓÉ¡£ÀýÈ磺

Route::get('/users', 'UserController@index')->name('users.index');
Route::post('/users', 'UserController@store')->name('users.store');

µÇ¼ºó¸´ÖÆ

·ÓÉÃüÃû³åÍ»

µ±ÎÒÃǽç˵¶à¸ö·ÓÉʱ £¬ÈôÊÇ·ÓɵÄÃû³ÆÏàͬ £¬»áµ¼ÖÂÃüÃû³åÍ» £¬´Ó¶øÎÞ·¨ÀÖ³ÉÌøת¡£ÎªÁË×èÖ¹ÃüÃû³åÍ» £¬ÎÒÃÇÐèÒªÔÚ½ç˵·ÓÉʱΪÿ¸ö·ÓÉÖ¸¶¨²î±ðµÄÃû³Æ¡£ÀýÈ磺

Route::get('/home', 'HomeController@index')->name('home');
Route::get('/about', 'AboutController@index')->name('about');

µÇ¼ºó¸´ÖÆ

ÔÚ Laravel Ó¦ÓÃÖÐ £¬Â·ÓÉÌøתʧ°Ü¿ÉÄÜÓÉÐí¶àÔµ¹ÊÔ­ÓÉÒýÆð¡£ÎÒÃÇÐèÒª×Ðϸ¼ì²é·ÓÉ·¾¶µÄ׼ȷÐÔ¡¢¿ØÖÆÆ÷Ãû³ÆºÍÒªÁì¡¢HTTP ÒªÁì¡¢ÃüÃû³åÍ»µÈÎÊÌâ¡£ÈôÊÇÎÒÃÇ·ºÆðÁËÎÊÌâ £¬ÎÒÃÇ¿ÉÒÔͨ¹ý Laravel ÌṩµÄ¹ýʧÌáÐÑÀ´ÕÒ³öÎÊÌâËùÔÚ²¢¼ÓÒÔ½â¾ö¡£ÕâÑù £¬ÎÒÃǾÍÄܹ»Ë³ËìʹÓà Laravel ¾ÙÐзÓÉÌøתÁË¡£

ÒÔÉϾÍÊÇlaravel·ÓÉÌøתʧ°ÜµÄÏêϸÄÚÈÝ £¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡

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

Ïà¹ØÐÂÎÅ

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

13452372176

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

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

QR code
ÍøÕ¾µØͼ