PHP code example of hirodev / base-design-patterns

1. Go to this page and download the library: Download hirodev/base-design-patterns 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/ */

    

hirodev / base-design-patterns example snippets


php artisan make:repository UserRepository

php artisan make:repository Backend/UserRepository

php artisan make:service UserService

php artisan make:service Backend/UserService

php artisan make:trait CheckAuth

php artisan make:trait Backend/CheckAuth

public function find(array $conditions = []);
public function findOne(array $conditions);
public function findById(int $id);
public function create(array $attributes);
public function update(Model $model, array $attributes = []);
public function save(Model $model);
public function delete(Model $model);
public function get($query);
public function destroy(array $ids);
public function findCount(array $conditions);
public function toBase($query);
public function updateMultiple(Builder $query, array $attributes = []);
public function updateOrCreate(array $attributes, array $values);
public function findAll();
public function findByIds(array $ids);
public function model();
public function makeModel();
public function resetModel();