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

laravelÔõôÐÞ¸ÄĬÈÏ·ÓÉ

laravelÊÇÒ»¿îÊ¢ÐеÄphp¿ò¼Ü £¬ÓÉÓÚÆ侫Á·¡¢¸ßЧ¡¢Ò×ÓõÈÌصã £¬±»Ô½À´Ô½¶àµÄ¿ª·¢ÕßËùʹÓá£laravel¿ò¼ÜÖÐ £¬Â·ÓÉÊÇÒ»¸öºÜÊÇÖ÷ÒªµÄ¿´·¨ £¬Í¨¹ý·ÓÉ¿ÉÒÔʵÏÖurlÓë¿ØÖÆÆ÷Ö®¼äµÄÓ³Éä £¬´Ó¶øʵÏÖwebÓ¦ÓõĹ¦Ð§¡£ÔÚlaravel¿ò¼ÜÖÐ £¬ÓÐÐí¶àĬÈϵÄ·ÓÉ £¬¿ÉÊÇÕâЩ·Óɲ¢·×Æ綨ÊʺÏÎÒÃǵÄÏîÄ¿ £¬Òò´ËÎÒÃÇÐèÒªÐÞ¸ÄĬÈÏ·ÓÉ¡£±¾ÆªÎÄÕ½«Îª¸÷ÈËÏÈÈÝlaravel¿ò¼ÜÖÐÔõÑùÐÞ¸ÄĬÈÏ·ÓÉ¡£

Ò»¡¢ÏàʶLaravel¿ò¼ÜµÄ·ÓÉ¿´·¨

ÔÚLaravel¿ò¼ÜÖÐ £¬Â·ÓÉÊÇÖ¸½«Ò»¸öURLÇëÇóת·¢¸øÏìÓ¦µÄ¿ØÖÆÆ÷ÒªÁì¾ÙÐд¦ÀíµÄ»úÖÆ¡£LaravelµÄ·ÓɹæÔòͨ³£½ç˵ÔÚroutes/web.phpÎļþÖС£Laravel¿ò¼ÜÌṩÁËÒ»Ì×Ò×ÓõÄ·ÓÉϵͳ £¬ÆäÖаüÀ¨Á˼¸¸ö³£ÓõÄHTTPÇëÇóÒªÁì £¬È磺GET¡¢POST¡¢PUT¡¢DELETEµÈ¡£¹ØÓÚÿ¸öHTTPÇëÇóÒªÁì £¬Laravel¾ùÌṩÁËÏìÓ¦µÄÏìÓ¦´¦ÀíÒªÁì £¬È磺view¡¢json¡¢redirectµÈ¡£

ÔÚLaravel¿ò¼ÜÖÐ £¬Â·ÓÉͨ³£ÓÉÁ½²¿·Ö×é³É£ºURIºÍ»Øµ÷º¯Êý¡£URIÖ¸»á¼û·ÓÉʱʹÓõÄURL £¬»Øµ÷º¯ÊýÔòÊÇÔÚ»á¼û¶ÔӦ·ÓÉʱËùÖ´ÐеIJÙ×÷¡£ÈôÊÇÏëÒªÉè¼ÆÒ»¸öеķÓÉ £¬Ê×ÏÈÐèÒª½ç˵URI £¬È»ºóÖ¸¶¨´¦Àí¸ÃÇëÇóµÄ¿ØÖÆÆ÷ºÍÒªÁì¡£

¶þ¡¢Laravel¿ò¼ÜÐÞ¸ÄĬÈÏ·ÓɵÄÒªÁì

1.½¨Éè×Ô½ç˵·ÓÉ

Laravel¿ò¼ÜĬÈÏÌṩÁ˼¸¸ö·ÓÉ £¬È磺GET¡¢POST¡¢PUT¡¢DELETEµÈ £¬ÕâЩ¶¼ÊÇÕë¶Ô²î±ðµÄHTTPÇëÇóÒªÁì½ç˵µÄ¡£ÈôÊÇÎÒÃÇÏëÒªÐÞ¸ÄĬÈϵÄ·ÓÉ £¬Ê×ÏÈÐèÒª½¨Éè×Ô½ç˵·ÓÉ¡£

н¨Ò»¸öÃûΪroutes/custom.phpµÄÎļþ £¬´ËÎļþÓÃÓÚ½ç˵×Ô¼ºµÄ·ÓɹæÔò £¬È»ºó½«¸ÃÎļþÒýÈëµ½routes/web.phpÖÐ £¬ÈçÏ´úÂëËùʾ£º

//routes/custom.php
Route::get('/custom', 'CustomController@index');

µÇ¼ºó¸´ÖÆ

//routes/web.php
require_once __DIR__.'/custom.php';

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊö´úÂëÖÐ £¬ÎÒÃǽç˵ÁËÒ»¸ö×Ô½ç˵µÄ·ÓÉ/custom £¬¸Ã·Óɽ«»áŲÓÃCustomControllerµÄindex()ÒªÁì¾ÙÐд¦Àí¡£

2.ÐÞ¸ÄLaravelĬÈÏ·ÓÉ

ÈôÊÇÎÒÃÇÏëÒªÐÞ¸ÄLaravel¿ò¼ÜĬÈϵÄ·ÓÉ £¬ÐèÒªÊ×ÏÈÏàʶĬÈÏ·ÓɵĽç˵ºÍ¹æÔò¡£ÔÚLaravel¿ò¼ÜÖÐ £¬Ò»Ð©Ä¬ÈϵÄ·Óɱ»½ç˵ÔÚapp/Providers/RouteServiceProvider.phpÎļþÖС£ÔÚ¸ÃÎļþÖÐ £¬ÎÒÃÇ¿ÉÒÔ¿´µ½´ó×ڵķÓɽç˵ £¬È磺/login¡¢/registerµÈµÈ¡£

ÈôÊÇÎÒÃÇÏëÒªÐÞ¸ÄÕâЩĬÈÏ·ÓÉ £¬Ö»ÐèÒªÔÚRouteServiceProvider.phpÎļþÖоÙÐÐÐ޸ļ´¿É¡£ÒÔ/loginΪÀý £¬ÎÒÃÇ¿ÉÒÔ½«µÇ¼·Óɱ任Ϊ/login-page £¬´úÂëÈçÏÂËùʾ£º

//app/Providers/RouteServiceProvider.php
public const HOME = '/home';

//Auth::routes();    
Route::get('/login-page', 'Auth\LoginController@showLoginForm')->name('login');
Route::post('/login', 'Auth\LoginController@login');

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊö´úÂëÖÐ £¬ÎÒÃÇ×¢Ê͵ôÁËÔ­ÓеÄAuth::routes()ÒªÁì £¬È»ºóн¨ÁËÒ»¸öÃûΪ/login-pageµÄ·ÓÉ £¬¸Ã·Óɽ«»áŲÓÃAuth/LoginControllerµÄshowLoginForm()ÒªÁì¾ÙÐд¦Àí¡£

Èý¡¢×ܽá

Laravel¿ò¼ÜÖеÄ·ÓÉϵͳÊÇʵÏÖWebÓ¦ÓõÄÖ÷Òª×é³É²¿·Ö¡£ÐÞ¸ÄĬÈÏ·ÓÉÊÇÏîÄ¿¿ª·¢Öг£¼ûµÄÐèÇó £¬±¾ÎÄͨ¹ýÏÈÈݽ¨Éè×Ô½ç˵·ÓɺÍÐÞ¸ÄĬÈÏ·ÓɵÄÒªÁì £¬Ï£ÍûÄÜ×ÊÖú¸÷È˸üºÃµØÃ÷È·Laravel¿ò¼ÜÖеÄ·ÓÉ¿´·¨ºÍʹÓá£

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

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

QR code
ÍøÕ¾µØͼ