Skip to content

Commit

Permalink
version: 7.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
txsoura committed Jul 30, 2021
2 parents 4900f14 + 80f69e0 commit c87c451
Show file tree
Hide file tree
Showing 6 changed files with 106 additions and 5 deletions.
36 changes: 32 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,47 @@
# Changelog

All notable changes to this project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

## [unreleased]
- Activity log service support
## [7.0.0] - 2021-05-09

### Added

- First project release

## [7.0.1] - 2021-06-15
### Added

### Fixed

- Fix base query paramns dates validation

## [7.0.1.1] - 2021-06-15

### Changed

- Add controllers methods success and fail messages
- Improve CRUD methods services

### Added

- Add new dictionaries words

## [7.0.2] - 2021-07-30

### Fixed

- Remove query params request include transformation

### Added

- Add git merge pull cli
- Create git cmd shortcuts
- Repository soft delete trait methods



11 changes: 11 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
pull:
git pull origin develop

git:
bash git-cli.sh

merge:
git checkout master
git pull origin master
git merge develop
git push
18 changes: 18 additions & 0 deletions git-cli.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/bin/sh

###############################################################################
# Git Script #
# #
# Author: Victor Tesoura Júnior <txsoura@yahoo.com> #
###############################################################################
# #
# This script, is to be used after a approved pull request in main repo #
# branch. #
# #
###############################################################################


git checkout develop
git fetch -p
git pull origin develop

2 changes: 1 addition & 1 deletion src/Http/Requests/QueryParamsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ protected function prepareForValidation()
{
if ($this->include) {
$this->merge([
'include' => Str::lower($this->include)
'include' => $this->include
]);
}
if ($this->q) {
Expand Down
10 changes: 10 additions & 0 deletions src/Repositories/Interfaces/CoreSoftDeleteRepositoryInterface.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<?php

namespace Txsoura\Core\Repositories\Interfaces;

interface CoreSoftDeleteRepositoryInterface
{
public function findWithTrased($id);

public function findOrFailWithTrased($id);
}
34 changes: 34 additions & 0 deletions src/Repositories/Traits/SoftDeleteMethodsRepository.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

namespace Txsoura\Core\Services\Traits;

trait SoftDeleteMethodsRepository
{
/**
* @param int $id
* @return Model|null
*/
public function findWithTrased($id)
{
return $this->model()::withTrashed()
->where('id', $id)
->when(key_exists('include', $this->request), function ($query) {
return $query->with(explode(',', $this->request['include']));
})
->first();
}

/**
* @param int $id
* @return Model|null
*/
public function findOrFailWithTrased($id)
{
return $this->model()::withTrashed()
->where('id', $id)
->when(key_exists('include', $this->request), function ($query) {
return $query->with(explode(',', $this->request['include']));
})
->firstOrFail();
}
}

0 comments on commit c87c451

Please sign in to comment.