尊龙凯时人生就是博

laravel¹Ø±Õ·ÓÉ»º´æ

laravelÊÇÒ»¿îºÜÊÇÊܽӴýµÄphp¿ª·¢¿ò¼Ü £¬ÆäÓÅÑŵÄÓï·¨ºÍÇ¿Ê¢µÄ¹¦Ð§Ê¹µÃÆäÔÚweb¿ª·¢ÁìÓòÊܵ½ÆÕ±éÇàíù¡£ÔÚlaravelÖÐ £¬Â·ÓÉÊÇÒ»¸öºÜÊÇÖ÷ÒªµÄ¿´·¨ £¬ÆäÈÏÕ潫httpÇëÇóÓ³Éäµ½ÏìÓ¦µÄ¿ØÖÆÆ÷´¦Àíº¯ÊýÉÏ¡£ÔÚÏÖʵӦÓÃÖÐ £¬ÎÒÃÇÓÐʱ¼äÐèÒª¹Ø±ÕlaravelµÄ·ÓÉ»º´æ¹¦Ð§¡£±¾ÎĽ«ÏÈÈÝÔõÑùÔÚlaravelÖйرÕ·ÓÉ»º´æ¡£

ΪʲôÐèÒª¹Ø±Õ·ÓÉ»º´æ£¿

LaravelÌṩÁË·ÓÉ»º´æ¹¦Ð§ £¬Æä¿É½«Ó¦ÓõÄ·ÓÉÐÅÏ¢»º´æµ½ÎļþϵͳÖС£ÕâÑù×öµÄÀûÒæÊÇ¿ÉÒÔ¼ÓËÙ·ÓÉÆ¥ÅäµÄËÙÂÊ £¬Ìá¸ßÓ¦ÓõÄÏìÓ¦ËÙÂÊ¡£¿ÉÊÇ £¬ÔÚijЩÇéÐÎÏ £¬ÎÒÃÇ¿ÉÄÜÐèÒª¹Ø±Õ·ÓÉ»º´æ¹¦Ð§¡£ÏÂÃæö¾ÙÁ˼¸ÖÖ±ØÐè¹Ø±Õ·ÓÉ»º´æ¹¦Ð§µÄÇéÐΣº

·Óɽç˵ÖÐʹÓÃÁ˱հüº¯Êý

ÔÚLaravelÖÐ £¬±Õ°üº¯Êý³£ÓÃÓÚ½ç˵¶¯Ì¬Â·ÓÉ £¬ÈçÏÂËùʾ£º

Route::get('user/{id}', function ($id) {
    return 'User '.$id;
});

µÇ¼ºó¸´ÖÆ

¿ÉÊÇ £¬ÓÉÓÚ±Õ°üº¯ÊýÎÞ·¨±»ÐòÁл¯ £¬Òò´ËÎÞ·¨±»»º´æ¡£ÔÚÕâÖÖÇéÐÎÏ £¬ÈôÊÇ¿ªÆôÁË·ÓÉ»º´æ £¬Ó¦ÓûáÅ×ÍÉ»¯Îó¡£

Ó¦ÓÃʹÓÃÁ˶¯Ì¬Â·ÓÉǰ׺

µ±LaravelÓ¦ÓÃʹÓö¯Ì¬Â·ÓÉǰ׺ʱ £¬ÀýÈ磺

Route::prefix('api/{version}')->group(function () {
    Route::get('users', function ($version) {
        return "API Version ".$version;
    });
});

µÇ¼ºó¸´ÖÆ

´Ëʱ £¬Ã¿¸öÇëÇóµÄ·ÓÉǰ׺¶¼ÊǶ¯Ì¬µÄ £¬ÕâÒâζ×ÅÎÞ·¨ÔÚÓ¦ÓÃÆô¶¯Ê±Ô¤ÏÈ»º´æ·ÓÉÐÅÏ¢¡£Òò´Ë £¬ÈôÊÇ¿ªÆôÁË·ÓÉ»º´æ £¬Ó¦ÓûáÅ×ÍÉ»¯Îó¡£

·Óɽç˵ÓÐת±ä

µ±Ó¦ÓõÄ·Óɽç˵ÓÐת±äʱ £¬ÀýÈçÌí¼ÓÁËеķÓÉ»òÐÞ¸ÄÁËÒÑÓеÄ·ÓÉ £¬ÈôÊÇ¿ªÆôÁË·ÓÉ»º´æ £¬ÕâЩת±ä²»»á±»·´Ó¦ÔÚ·ÓÉ»º´æÖÐ £¬´Ó¶øµ¼ÖÂÓ¦Ó÷ºÆ𲻿ÉÔ¤ÁϵĹýʧ¡£

ÔÚÒÔÉÏÇéÐÎÏ £¬ÎªÁË°ü¹ÜÓ¦ÓõÄÕý³£ÔËÐÐ £¬ÎÒÃÇÐèÒª¹Ø±ÕLaravelµÄ·ÓÉ»º´æ¹¦Ð§¡£

ÔõÑù¹Ø±Õ·ÓÉ»º´æ£¿

ÔÚLaravelÖÐ £¬¹Ø±Õ·ÓÉ»º´æºÜÊǼòÆÓ £¬Ö»ÐèÒªÖ´ÐÐÒÔÏÂÁ½¸ö°ì·¨£º

ɾ³ý·ÓÉ»º´æÎļþ

LaravelµÄ·ÓÉ»º´æÎļþ´æ´¢ÔÚbootstrap/cache/routes.phpÎļþÖÐ £¬Òò´ËÎÒÃÇ¿ÉÒÔͨ¹ýɾ³ý¸ÃÎļþÀ´¹Ø±Õ·ÓÉ»º´æ¡£¿ÉÒÔʹÓÃÒÔÏÂÏÂÁîÀ´É¾³ý·ÓÉ»º´æÎļþ£º

$ php artisan route:clear

µÇ¼ºó¸´ÖÆ

Ö´ÐÐÒÔÉÏÏÂÁîºó £¬Laravel»á×Ô¶¯É¾³ýbootstrap/cache/routes.phpÎļþ¡£

½ûÓ÷ÓÉ»º´æ

³ýÁËɾ³ý·ÓÉ»º´æÎļþ £¬ÎÒÃÇ»¹ÐèÒªÔÚLaravelÉèÖÃÎļþÖÐÌí¼ÓÈçÏÂÉèÖôúÂëÀ´½ûÓ÷ÓÉ»º´æ£º

// config/app.php

return [

    // ...
    
    'route_cache' => false,

    // ...

];

µÇ¼ºó¸´ÖÆ

ÔÚÉÏÊöÉèÖôúÂëÖÐ £¬ÎÒÃǽ«route_cacheÑ¡ÏîµÄÖµÉèÖÃΪfalse¡£ÕâÑù×ö¿ÉÒÔÈ·±£Laravel²»»áÔÚÆô¶¯Ê±¼ÓÔØ·ÓÉ»º´æÎļþ¡£

ÒÔÉÏÁ½¸ö°ì·¨Ö´ÐÐÍê³Éºó £¬Â·ÓÉ»º´æ¹¦Ð§¾Í»á±»¹Ø±ÕÁË¡£ÔÚÐèÒªÖØÐÂÆôÓ÷ÓÉ»º´æ¹¦Ð§Ê± £¬Ö»ÐèÒª½«config/app.phpÉèÖÃÎļþÖеÄroute_cacheÑ¡ÏîÉèÖÃΪtrue¼´¿É¡£

×ܽá

LaravelµÄ·ÓÉ»º´æ¹¦Ð§¿ÉÒÔÌá¸ßÓ¦ÓõÄÏìÓ¦ËÙÂÊ £¬¿ÉÊÇÔÚijЩÇéÐÎÏÂÐèÒª¹Ø±Õ¸Ã¹¦Ð§¡£±¾ÎÄÏÈÈÝÁËÔõÑùÔÚLaravelÖйرÕ·ÓÉ»º´æ¹¦Ð§ £¬°üÀ¨É¾³ý·ÓÉ»º´æÎļþºÍ½ûÓ÷ÓÉ»º´æ¹¦Ð§Á½¸ö°ì·¨¡£Ï£Íû±¾ÎĶÔLaravel·ÓɵÄʹÓÃÓÐËù×ÊÖú¡£

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

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

Ïà¹ØÐÂÎÅ

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

18523999891

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

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

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