Laravel¿ª·¢£ºÔõÑùʹÓÃLaravel Telescope¾ÙÐÐÐÔÄÜÆÊÎöºÍ¼àÊÓ£¿
laravel¿ª·¢£ºÔõÑùʹÓÃlaravel telescope¾ÙÐÐÐÔÄÜÆÊÎöºÍ¼àÊÓ£¿
LaravelÊÇÒ»¿îÓÅÒìµÄPHP¿ò¼Ü£¬ÓÉÓÚÆä¼òÆÓÒ×ÓúÍÎÞаÐÔ¶ø±¸ÊÜ¿ª·¢Õßϲ»¶¡£ÎªÁ˸üºÃµØ¼à¿ØºÍÆÊÎöLaravelÓ¦ÓóÌÐòµÄÐÔÄÜ£¬LaravelÍŶӿª·¢ÁËÒ»¸öÃûΪTelescopeµÄÇ¿Ê¢¹¤¾ß¡£ÔÚ±¾ÎÄÖУ¬ÎÒÃǽ«ÏÈÈÝTelescopeµÄһЩ»ù±¾Ê¹ÓÃÒªÁìºÍ¹¦Ð§¡£
×°ÖÃTelescope
ÔÚLaravel 5.5»ò¸ü¸ß°æ±¾ÖУ¬TelescopeÒѾ±»°üÀ¨ÔÚLaravel½¹µãÖУ¬ÒÔÊÇÄãÖ»ÐèÒªÔÚÖÕ¶ËÏÂÁîÐÐÖÐÔËÐÐÒÔÏÂÏÂÁî¼´¿É×°ÖÃTelescope£º
composer require laravel/telescope
µÇ¼ºó¸´ÖÆ
½ÓÏÂÀ´£¬ÔËÐÐÒÔÏÂÏÂÁîÐû²¼TelescopeµÄÉèÖúÍ×ÊÔ´Îļþ£º
php artisan telescope:install
µÇ¼ºó¸´ÖÆ
×îºó£¬ÔËÐÐÒÔÏÂÏÂÁîÆô¶¯TelescopeЧÀÍÌṩÕߣº
php artisan telescope:provider
µÇ¼ºó¸´ÖÆ
ÉèÖÃTelescope
TelescopeµÄÉèÖÃÎļþ¿ÉÒÔͨ¹ýÒÔÏÂÏÂÁî·¿ª£º
php artisan vendor:publish --provider="LaravelTelescopeTelescopeServiceProvider" --tag="config"
µÇ¼ºó¸´ÖÆ
ÔÚconfig/telescope.phpÎļþÖУ¬Äú¿ÉÒÔ×Ô½ç˵TelescopeµÄÉèÖÃÐÅÏ¢¡£ÀýÈ磬Äú¿ÉÒÔÉèÖÃTelescopeµÄ·¾¶»ò½ûÓá°ÍøÂçЧÀÍÌṩÕß¡±¡£±ðµÄ£¬Äú»¹¿ÉÒÔ¸ü¸ÄTelescopeÒªÍøÂçµÄÊý¾ÝµÄÑ¡ÏÀýÈ磺ÔõÑùÍøÂçÅÌÎʺÍÒì³£ÐÅÏ¢¡£
»á¼ûTelescope
ÔÚ×°ÖúÍÉèÖÃTelescopeºó£¬Äú¿ÉÒÔͨ¹ý»á¼ûURL /telescopeÀ´»á¼ûTelescopeµÄÓû§½çÃæ¡£Äú¿ÉÒÔÔÚ×ó²àµÄµ¼º½Ãæ°åÖÐÕÒµ½ÖÖÖÖÑ¡Ï°üÀ¨£º
Dashboard£º¸ÅÀÀTelescopeµÄÖÖÖÖͳ¼ÆÐÅÏ¢ºÍÖÒÑÔÐÅÏ¢¡£
Requests£ºÉó²éÓ¦ÓóÌÐò´¦ÀíµÄHTTPÇëÇó¡¢Ö´ÐÐʱ¼äºÍÏìÓ¦´úÂë¡£
Gates£ºÉó²éLaravel GateµÄÏêϸÐÅÏ¢£¬°üÀ¨±»ÊÚȨºÍδ±»ÊÚȨµÄȨÏÞ¡£
Jobs£ºÉó²éÐÐÁÐʹÃüµÄÏêϸÐÅÏ¢£¬°üÀ¨´¦Àíʱ¼äºÍÖ´ÐÐ״̬¡£
Exceptions£ºÉó²éÓ¦ÓóÌÐòÅ׳öµÄÒì³£ÐÅÏ¢£¬²¢ÏàʶÕâЩÒì³£ÔõÑù±»´¦ÀíºÍ¼Í¼¡£
Metrics£ºÉó²éÓйØÓ¦ÓóÌÐòÐÔÄܵÄÓÐÓÃͳ¼ÆÐÅÏ¢¡£
Telescope¹¤¾ßÀ¸
Telescope×îÓÐȤµÄ¹¦Ð§Ö®Ò»ÊÇTool-bar£¬ÕâÊÇÒ»×éÓÃÓÚ¼à¿ØÓ¦ÓóÌÐòÐÔÄܺÍÔËÐÐ״̬µÄ¿Ø¼þ¡£Äú¿ÉÒÔ½«ÆäÌí¼Óµ½ÄúµÄÓ¦ÓóÌÐòÖУ¬ÒÔ±ãÔÚÍâµØ¿ª·¢ÇéÐÎÖпìËÙ»á¼û¡£
ҪʹÓÃTelescope Tool-bar£¬ÇëÔÚresources/views/vendor/telescope/layout.blade.phpÎļþÖÐÌí¼ÓÒÔÏ´úÂ룺
@if (app()->isLocal()) <script src="{{ asset('vendor/telescope/js/telescope.js') }}"></script> @endif
µÇ¼ºó¸´ÖÆ
½ÓÏÂÀ´£¬»á¼ûÄúµÄÍâµØÓ¦ÓóÌÐò²¢µ¥»÷Ò³ÃæÖеÄTelescopeͼ±ê£¬¼´¿É»á¼ûTelescope¹¤¾ßÀ¸¡£
TelescopeÏÂÁîÐй¤¾ß
×îºó£¬Äú»¹¿ÉÒÔʹÓÃTelescopeµÄÏÂÁîÐй¤¾ßÀ´Éó²éÓйØÄúµÄÓ¦ÓóÌÐòµÄÒì³£¡¢ÈÕÖ¾¡¢ÐÐÁкÍʹÃüµÄÐÅÏ¢¡£ÒÔÏÂÊÇһЩ³£ÓÃÏÂÁ
php artisan telescope:clear£ºÉ¨³ýËùÓÐTelescopeÊý¾Ý¡£
php artisan telescope:prune£ºÉ¾³ýÔçÓÚÖ¸¶¨ÌìÊýµÄËùÓÐTelescopeÊý¾Ý¡£
php artisan telescope:dump£º½«TelescopeÊý¾Ýµ¼³öµ½ÎļþÖС£
php artisan telescope:publish£ºÐû²¼TelescopeÉèÖÃÎļþºÍ×ÊÔ´¡£
×ܽá
TelescopeÊÇÒ»¸öºÜÊÇÇ¿Ê¢µÄ¹¤¾ß£¬¿ÉÒÔ×ÊÖúÄúÏàʶÄúµÄLaravelÓ¦ÓóÌÐòµÄÐÔÄܺÍÔËÐÐÇéÐΡ£Í¨¹ý»á¼ûTelescopeµÄ½çÃæ¡¢¹¤¾ßÀ¸ºÍÏÂÁîÐй¤¾ß£¬Äú¿ÉÒÔÇáËɵؼà¿ØÄúµÄÓ¦ÓóÌÐò²¢²éÕÒDZÔÚµÄÎÊÌ⡣СÎÒ˽È˽¨Òé¸÷ÈËÔÚ¿ª·¢½×¶Î¾Í×îÏÈʹÓÃTelescope£¬ÕâÑù¿ÉÒÔ×ÊÖúÄú¿ìËÙ¶¨Î»ÎÊÌâ²¢Ìá¸ß¿ª·¢Ð§ÂÊ¡£
ÒÔÉϾÍÊÇLaravel¿ª·¢£ºÔõÑùʹÓÃLaravel Telescope¾ÙÐÐÐÔÄÜÆÊÎöºÍ¼àÊÓ£¿µÄÏêϸÄÚÈÝ£¬¸ü¶àÇë¹Ø×¢±¾ÍøÄÚÆäËüÏà¹ØÎÄÕ£¡