PHP code example of jian1098 / tp-make-service

1. Go to this page and download the library: Download jian1098/tp-make-service library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

jian1098 / tp-make-service example snippets


    return [
        'Jian1098\TpMakeService\Command\Service',
    ];
    

    return [
        // 指令定义
        'commands' => [
            'make:service' => 'Jian1098\TpMakeService\Command\Service',
        ],
    ];
    

  
  
  namespace app\common\service;
  
  use app\common\repository\TestRepository;
  
  class TestService
  {
      /**
       * 绑定仓库
       * @var TestRepository
       */
      protected $repository;
  
      public function __construct(TestRepository $repository)
      {
          $this->repository = $repository;
      }
  
  
  }
  
bash
  php think make:service TestService