Laravel开发-showrouter

  • v7_485766
    了解作者
  • 23.2KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-06-13 06:40
    上传日期
Laravel开发-showrouter Laravel表演路由器
Laravel开发-showrouter .zip
  • showrouter-master
  • views
  • showrouter.blade.php
    4.6KB
  • Readme.docx
    12.8KB
  • src
  • ShowRouterServiceProvider.php
    1.3KB
  • ShowRouter.php
    1.5KB
  • DataCollectors
  • DataCollectorInterface.php
    170B
  • ApiCallsCountCollector.php
    451B
  • Models
  • ApiCallsCount.php
    1023B
  • MIddleware
  • ShowRouterMiddleware.php
    864B
  • .idea
  • misc.xml
    174B
  • php.xml
    147B
  • showrouter.iml
    408B
  • modules.xml
    272B
  • composerJson.xml
    301B
  • vcs.xml
    180B
  • config
  • showrouter.php
    1.4KB
  • LICENSE
    1KB
  • README.md
    2.6KB
  • .gitignore
    324B
  • stubs
  • migration.stub
    709B
  • composer.json
    758B
内容介绍
![](https://user-images.githubusercontent.com/39079284/41203137-a3a213ae-6d05-11e8-85d8-1fd8f69e7fb8.png) # Installation ## Add Package Add following package into your composer.json. ```php "require": { "chouhai2018/showrouter": "dev-master" } ``` After adding packages, run the following command: ``` composer update ``` ## Add Service Provider Add following service provider into your providers array in config/app.php ``` \Chouhai2018\ShowRouter\ShowRouterServiceProvider::class, ``` ## Run the following command: ``` php artisan vendor:publish ``` Note:look at [num]ChouHai2018, input num enter ``` php artisan migrate ``` ## Access http://localhost:8000/showrouter # Customization ## Customize Routes You can customize your route to anything other than showrouter. Open `config/chouhai2018/showrouter.php` Change the value of route parameter to your favorite one. ## Customize View Publish view file by, ``` php artisan vendor:publish --tag=views ``` It will publish view file to `resources/views/routes/showrouter.php`. Customize it the way you want. ## Change Configuration View Change view parameter in `config/chouhai2018/showrouter.php` to routes.showrouter # Language Change Configuration `config/chouhai2018/showrouter.php` to `zhcn => true`,display 简体中文 for web. Note:default is English # Security Of course, you need to secure this route showrouter in the production environment. You can find option enable_showrouter into `config/chouhai2018/showrouter.php` and simply make it false while in production environment directly or via your .env file. ## Track Api calls count By the time, our project grows with lots of routes and api endpoints. And it's really difficult to figure out which routes are most used or used or not used at all. In some cases, we also want to know, which routes are frequently called and we want to cache those data. Other lots of real life practical problems and use cases can be there with our routes. To start tracking api calls, you need to perform following steps: ## Publish Migration Run the following command to publish migration, ``` php artisan vendor:publish --tag=migrations ``` It will publish migration file into database/migrations. ## Migrate database Migrate your database by, ``` php artisan migrate ``` It will create one new table in database called api_calls_count. ## Change Configuration file Change config file config/chouhai2018/showrouter.php & Make collections.api_calls_count => true. That's all. Checkout your routes and one new column count will be added into datatable.
评论
    相关推荐
    • laravel
      关于Laravel Laravel是一个具有表达力,优雅语法的Web应用程序框架。 我们认为,发展必须是一种令人愉快的,富有创造力的经历,才能真正实现。 Laravel减轻了许多Web项目中使用的常见任务,从而减轻了开发过程中的...
    • Laravel
      关于Laravel Laravel是一个具有表达力,优雅语法的Web应用程序框架。 我们认为,发展必须是一种令人愉悦的创造力,才能真正实现。 Laravel通过减轻许多Web项目中使用的常见任务来减轻开发工作的痛苦,例如: 。 。...
    • Laravel
      Laravel
    • laravel
      关于Laravel Laravel是一个Web应用程序框架,具有表达力强,优雅的语法。 我们认为,发展必须是一种令人愉快的,富有创造力的经历,才能真正实现。 Laravel减轻了许多Web项目中使用的常见任务,从而减轻了开发过程中...
    • Laravel
      Laravel
    • laravel
      关于Laravel Laravel是一个具有表达力,优雅语法的Web应用程序框架。 我们认为,发展必须是一种令人愉快的,富有创造力的经历,才能真正实现。 Laravel减轻了许多Web项目中使用的常见任务,从而减轻了开发过程中的...
    • laravel
      关于Laravel Laravel是一个具有表达力,优雅语法的Web应用程序框架。 我们认为,发展必须是一种令人愉快的,富有创造力的经历,才能真正实现。 Laravel减轻了许多Web项目中使用的常见任务,从而减轻了开发过程中的...
    • Laravel
      Laravel
    • laravel
      laravel
    • Laravel
      Laravel