PHP code example of cqcqs / laravel-mode

1. Go to this page and download the library: Download cqcqs/laravel-mode 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/ */

    

cqcqs / laravel-mode example snippets


Cqcqs\Mode\ModeServiceProvider::class
$xslt
# 生成 DTO
php artisan make:dto PostDTO
$xslt
# 生成 Service
php artisan make:service PostService
$xslt
use Cqcqs\Mode\Helpers\ResponseHelper;
use App\Repositories\PostRepository;

public function __construct(PostRepository $post)
{
    $this->post = $post;
}

public function store(PostDTO $postDTO)
{
    $list = $this->post->insert($postDTO->toArray());

    return new ResponseHelper();
}