mirror of
https://github.com/nullthoughts/laravel-data-sync.git
synced 2026-01-26 11:44:11 +00:00
Compare commits
34 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8a987b89c5 | ||
|
|
552bc8fba8 | ||
|
|
7b89add86e | ||
|
|
8c69fe4d27 | ||
|
|
a6b0d7aa66 | ||
|
|
6dbf71adbc | ||
|
|
0a462f9193 | ||
|
|
ec73547e7a | ||
| f478df70c4 | |||
| 382c4a152d | |||
| 27e8683874 | |||
|
|
6f826afe71 | ||
|
|
de80308447 | ||
|
|
5f7fa84914 | ||
|
|
ee3f13ec2b | ||
|
|
5acf52b9f4 | ||
|
|
6b3ff0ebdf | ||
|
|
862a15b95c | ||
|
|
325667f1f7 | ||
|
|
cdd675a862 | ||
|
|
dafbb6cb6a | ||
|
|
aa9d2905fb | ||
|
|
916f203c5b | ||
|
|
9dd3e29601 | ||
|
|
e6200c346a | ||
|
|
12ba3008cc | ||
|
|
a64f17891f | ||
|
|
c601bee490 | ||
|
|
d081af525c | ||
|
|
82e5865831 | ||
|
|
b5eacfb0f7 | ||
|
|
ec80e79b01 | ||
|
|
2b27089c60 | ||
|
|
bd682f0d78 |
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
43
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,43 @@
|
||||
---
|
||||
name: Bug report
|
||||
about: Create a report to help us improve
|
||||
title: ''
|
||||
labels: bug
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Describe the bug**
|
||||
A clear and concise description of what the bug is.
|
||||
|
||||
**To Reproduce**
|
||||
Steps to reproduce the behavior:
|
||||
1. Go to '...'
|
||||
2. Click on '....'
|
||||
3. Scroll down to '....'
|
||||
4. See error
|
||||
|
||||
**Expected behavior**
|
||||
A clear and concise description of what you expected to happen.
|
||||
|
||||
**Screenshots**
|
||||
If applicable, add screenshots to help explain your problem.
|
||||
|
||||
|
||||
**Laravel (please complete the following information):**
|
||||
- Host OS: [e.g. Linux]
|
||||
- Version [e.g. 6.1.0]
|
||||
|
||||
**Desktop (please complete the following information):**
|
||||
- OS: [e.g. iOS]
|
||||
- Browser [e.g. chrome, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Smartphone (please complete the following information):**
|
||||
- Device: [e.g. iPhone6]
|
||||
- OS: [e.g. iOS8.1]
|
||||
- Browser [e.g. stock browser, safari]
|
||||
- Version [e.g. 22]
|
||||
|
||||
**Additional context**
|
||||
Add any other context about the problem here.
|
||||
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
20
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
---
|
||||
name: Feature request
|
||||
about: Suggest an idea for this project
|
||||
title: ''
|
||||
labels: enhancement
|
||||
assignees: ''
|
||||
|
||||
---
|
||||
|
||||
**Is your feature request related to a problem? Please describe.**
|
||||
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||
|
||||
**Describe the solution you'd like**
|
||||
A clear and concise description of what you want to happen.
|
||||
|
||||
**Describe alternatives you've considered**
|
||||
A clear and concise description of any alternative solutions or features you've considered.
|
||||
|
||||
**Additional context**
|
||||
Add any other context or screenshots about the feature request here.
|
||||
30
.travis.yml
Normal file
30
.travis.yml
Normal file
@@ -0,0 +1,30 @@
|
||||
language: php
|
||||
|
||||
env:
|
||||
global:
|
||||
- setup=stable
|
||||
|
||||
matrix:
|
||||
fast_finish: true
|
||||
include:
|
||||
- php: 7.1
|
||||
- php: 7.1
|
||||
env: setup=lowest
|
||||
- php: 7.2
|
||||
- php: 7.2
|
||||
env: setup=lowest
|
||||
- php: 7.3
|
||||
- php: 7.3
|
||||
env: setup=lowest
|
||||
|
||||
sudo: false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.composer/cache
|
||||
|
||||
install:
|
||||
- if [[ $setup = 'stable' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-stable --no-suggest; fi
|
||||
- if [[ $setup = 'lowest' ]]; then travis_retry composer update --prefer-dist --no-interaction --prefer-lowest --prefer-stable --no-suggest; fi
|
||||
|
||||
script: vendor/bin/phpunit
|
||||
76
CODE_OF_CONDUCT.md
Normal file
76
CODE_OF_CONDUCT.md
Normal file
@@ -0,0 +1,76 @@
|
||||
# Contributor Covenant Code of Conduct
|
||||
|
||||
## Our Pledge
|
||||
|
||||
In the interest of fostering an open and welcoming environment, we as
|
||||
contributors and maintainers pledge to making participation in our project and
|
||||
our community a harassment-free experience for everyone, regardless of age, body
|
||||
size, disability, ethnicity, sex characteristics, gender identity and expression,
|
||||
level of experience, education, socio-economic status, nationality, personal
|
||||
appearance, race, religion, or sexual identity and orientation.
|
||||
|
||||
## Our Standards
|
||||
|
||||
Examples of behavior that contributes to creating a positive environment
|
||||
include:
|
||||
|
||||
* Using welcoming and inclusive language
|
||||
* Being respectful of differing viewpoints and experiences
|
||||
* Gracefully accepting constructive criticism
|
||||
* Focusing on what is best for the community
|
||||
* Showing empathy towards other community members
|
||||
|
||||
Examples of unacceptable behavior by participants include:
|
||||
|
||||
* The use of sexualized language or imagery and unwelcome sexual attention or
|
||||
advances
|
||||
* Trolling, insulting/derogatory comments, and personal or political attacks
|
||||
* Public or private harassment
|
||||
* Publishing others' private information, such as a physical or electronic
|
||||
address, without explicit permission
|
||||
* Other conduct which could reasonably be considered inappropriate in a
|
||||
professional setting
|
||||
|
||||
## Our Responsibilities
|
||||
|
||||
Project maintainers are responsible for clarifying the standards of acceptable
|
||||
behavior and are expected to take appropriate and fair corrective action in
|
||||
response to any instances of unacceptable behavior.
|
||||
|
||||
Project maintainers have the right and responsibility to remove, edit, or
|
||||
reject comments, commits, code, wiki edits, issues, and other contributions
|
||||
that are not aligned to this Code of Conduct, or to ban temporarily or
|
||||
permanently any contributor for other behaviors that they deem inappropriate,
|
||||
threatening, offensive, or harmful.
|
||||
|
||||
## Scope
|
||||
|
||||
This Code of Conduct applies both within project spaces and in public spaces
|
||||
when an individual is representing the project or its community. Examples of
|
||||
representing a project or community include using an official project e-mail
|
||||
address, posting via an official social media account, or acting as an appointed
|
||||
representative at an online or offline event. Representation of a project may be
|
||||
further defined and clarified by project maintainers.
|
||||
|
||||
## Enforcement
|
||||
|
||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be
|
||||
reported by contacting the project team at jani@nullincorporated.com. All
|
||||
complaints will be reviewed and investigated and will result in a response that
|
||||
is deemed necessary and appropriate to the circumstances. The project team is
|
||||
obligated to maintain confidentiality with regard to the reporter of an incident.
|
||||
Further details of specific enforcement policies may be posted separately.
|
||||
|
||||
Project maintainers who do not follow or enforce the Code of Conduct in good
|
||||
faith may face temporary or permanent repercussions as determined by other
|
||||
members of the project's leadership.
|
||||
|
||||
## Attribution
|
||||
|
||||
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
|
||||
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
|
||||
|
||||
[homepage]: https://www.contributor-covenant.org
|
||||
|
||||
For answers to common questions about this code of conduct, see
|
||||
https://www.contributor-covenant.org/faq
|
||||
19
CONTRIBUTING.md
Normal file
19
CONTRIBUTING.md
Normal file
@@ -0,0 +1,19 @@
|
||||
# Contribution Guide
|
||||
|
||||
<a name="bug-reports"></a>
|
||||
## Bug Reports
|
||||
|
||||
To encourage active collaboration, we strongly encourages pull requests, not just bug reports. "Bug reports" may also be sent in the form of a pull request containing a failing test.
|
||||
|
||||
However, if you file a bug report, your issue should contain a title and a clear description of the issue. You should also include as much relevant information as possible and a code sample that demonstrates the issue. The goal of a bug report is to make it easy for yourself - and others - to replicate the bug and develop a fix.
|
||||
|
||||
Remember, bug reports are created in the hope that others with the same problem will be able to collaborate with you on solving it. Do not expect that the bug report will automatically see any activity or that others will jump to fix it. Creating a bug report serves to help yourself and others start on the path of fixing the problem.
|
||||
|
||||
<a name="coding-style"></a>
|
||||
## Coding Style
|
||||
|
||||
Laravel follows the [PSR-2](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md) coding standard and the [PSR-4](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-4-autoloader.md) autoloading standard, so do we.
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within the package, please send an e-mail to [@nullthoughts](https://github.com/nullthoughts) via [jani@nullincorporated.com](mailto:jani@nullincorporated.com). All security vulnerabilities will be promptly addressed.
|
||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2019 Jani Gyllenberg
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"name": "distinctm/laravel-data-sync",
|
||||
"description": "Laravel utility to keep records synced between enviroments through source control",
|
||||
"name": "nullthoughts/laravel-data-sync",
|
||||
"description": "Laravel utility to keep records synced between environments through source control",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "distinctm",
|
||||
"email": "jani@marketdistinctly.com"
|
||||
"name": "nullthoughts",
|
||||
"email": "jani@nullincorporated.com"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
@@ -16,18 +16,18 @@
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4" : {
|
||||
"distinctm\\LaravelDataSync\\": "src/"
|
||||
"nullthoughts\\LaravelDataSync\\": "src/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4" : {
|
||||
"distinctm\\LaravelDataSync\\Tests\\": "tests/"
|
||||
"nullthoughts\\LaravelDataSync\\Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"providers": [
|
||||
"distinctm\\LaravelDataSync\\DataSyncBaseServiceProvider"
|
||||
"nullthoughts\\LaravelDataSync\\DataSyncBaseServiceProvider"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
165
composer.lock
generated
165
composer.lock
generated
@@ -1,10 +1,10 @@
|
||||
{
|
||||
"_readme": [
|
||||
"This file locks the dependencies of your project to a known state",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "cf25345b5d84c3622c3d086ff147283c",
|
||||
"content-hash": "8a67fd9ec1f1d05a6f27057f100809ac",
|
||||
"packages": [],
|
||||
"packages-dev": [
|
||||
{
|
||||
@@ -3652,30 +3652,31 @@
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-foundation",
|
||||
"version": "v4.2.2",
|
||||
"version": "v4.4.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/http-foundation.git",
|
||||
"reference": "a633d422a09242064ba24e44a6e1494c5126de86"
|
||||
"reference": "8bccc59e61b41963d14c3dbdb23181e5c932a1d5"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/a633d422a09242064ba24e44a6e1494c5126de86",
|
||||
"reference": "a633d422a09242064ba24e44a6e1494c5126de86",
|
||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/8bccc59e61b41963d14c3dbdb23181e5c932a1d5",
|
||||
"reference": "8bccc59e61b41963d14c3dbdb23181e5c932a1d5",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"symfony/mime": "^4.3|^5.0",
|
||||
"symfony/polyfill-mbstring": "~1.1"
|
||||
},
|
||||
"require-dev": {
|
||||
"predis/predis": "~1.0",
|
||||
"symfony/expression-language": "~3.4|~4.0"
|
||||
"symfony/expression-language": "^3.4|^4.0|^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "4.2-dev"
|
||||
"dev-master": "4.4-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3702,7 +3703,7 @@
|
||||
],
|
||||
"description": "Symfony HttpFoundation Component",
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-01-05T16:37:49+00:00"
|
||||
"time": "2019-11-28T13:33:56+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/http-kernel",
|
||||
@@ -3793,6 +3794,68 @@
|
||||
"homepage": "https://symfony.com",
|
||||
"time": "2019-01-06T16:19:23+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/mime",
|
||||
"version": "v5.0.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/mime.git",
|
||||
"reference": "0e6a4ced216e49d457eddcefb61132173a876d79"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/mime/zipball/0e6a4ced216e49d457eddcefb61132173a876d79",
|
||||
"reference": "0e6a4ced216e49d457eddcefb61132173a876d79",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.2.5",
|
||||
"symfony/polyfill-intl-idn": "^1.10",
|
||||
"symfony/polyfill-mbstring": "^1.0"
|
||||
},
|
||||
"conflict": {
|
||||
"symfony/mailer": "<4.4"
|
||||
},
|
||||
"require-dev": {
|
||||
"egulias/email-validator": "^2.1.10",
|
||||
"symfony/dependency-injection": "^4.4|^5.0"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "5.0-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Component\\Mime\\": ""
|
||||
},
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Fabien Potencier",
|
||||
"email": "fabien@symfony.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "A library to manipulate MIME messages",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"mime",
|
||||
"mime-type"
|
||||
],
|
||||
"time": "2019-11-30T14:12:50+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-ctype",
|
||||
"version": "v1.10.0",
|
||||
@@ -3838,7 +3901,7 @@
|
||||
},
|
||||
{
|
||||
"name": "Gert de Pagter",
|
||||
"email": "backendtea@gmail.com"
|
||||
"email": "BackEndTea@gmail.com"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for ctype functions",
|
||||
@@ -3852,17 +3915,79 @@
|
||||
"time": "2018-08-06T14:22:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.10.0",
|
||||
"name": "symfony/polyfill-intl-idn",
|
||||
"version": "v1.13.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494"
|
||||
"url": "https://github.com/symfony/polyfill-intl-idn.git",
|
||||
"reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/c79c051f5b3a46be09205c73b80b346e4153e494",
|
||||
"reference": "c79c051f5b3a46be09205c73b80b346e4153e494",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/6f9c239e61e1b0c9229a28ff89a812dc449c3d46",
|
||||
"reference": "6f9c239e61e1b0c9229a28ff89a812dc449c3d46",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
"php": ">=5.3.3",
|
||||
"symfony/polyfill-mbstring": "^1.3",
|
||||
"symfony/polyfill-php72": "^1.9"
|
||||
},
|
||||
"suggest": {
|
||||
"ext-intl": "For best performance"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.13-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Intl\\Idn\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Laurent Bassin",
|
||||
"email": "laurent@bassin.info"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"idn",
|
||||
"intl",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2019-11-27T13:56:44+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-mbstring",
|
||||
"version": "v1.13.1",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/polyfill-mbstring.git",
|
||||
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/7b4aab9743c30be783b73de055d24a39cf4b954f",
|
||||
"reference": "7b4aab9743c30be783b73de055d24a39cf4b954f",
|
||||
"shasum": ""
|
||||
},
|
||||
"require": {
|
||||
@@ -3874,7 +3999,7 @@
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.9-dev"
|
||||
"dev-master": "1.13-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
@@ -3908,7 +4033,7 @@
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2018-09-21T13:07:52+00:00"
|
||||
"time": "2019-11-27T14:18:11+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/polyfill-php72",
|
||||
@@ -4498,6 +4623,8 @@
|
||||
"stability-flags": [],
|
||||
"prefer-stable": false,
|
||||
"prefer-lowest": false,
|
||||
"platform": [],
|
||||
"platform": {
|
||||
"ext-json": "*"
|
||||
},
|
||||
"platform-dev": []
|
||||
}
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
'path' => base_path('sync'),
|
||||
'path' => base_path('sync'),
|
||||
'order' => [
|
||||
//
|
||||
]
|
||||
],
|
||||
];
|
||||
|
||||
34
readme.md
34
readme.md
@@ -1,10 +1,32 @@
|
||||
<p align="center">
|
||||
<a href="https://packagist.org/packages/nullthoughts/laravel-data-sync" target="_blank"><img src="https://poser.pugx.org/nullthoughts/laravel-data-sync/d/total.svg" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/nullthoughts/laravel-data-sync" target="_blank"><img src="https://poser.pugx.org/nullthoughts/laravel-data-sync/v/stable.svg" alt="Latest Stable Version"></a>
|
||||
<a href="https://travis-ci.com/nullthoughts/laravel-data-sync"><img src="https://api.travis-ci.com/nullthoughts/laravel-data-sync.svg?branch=master" alt="Travis CI Build Status: Master"></a>
|
||||
</p>
|
||||
|
||||
# Laravel Data Sync
|
||||
|
||||
Laravel utility to keep records synced between enviroments through source control
|
||||
Laravel utility to keep records synchronized between environments through source control
|
||||
|
||||
## Installation & Usage
|
||||
- Via composer: `composer require distinctm/laravel-data-sync`
|
||||
- Run `php artisan vendor:publish --provider="distinctm\LaravelDataSync\DataSyncBaseServiceProvider" --tag="data-sync-config"` to publish config file. Specify directory for sync data files (default is a new sync directory in the project root)
|
||||
## Installation
|
||||
You can install this package via composer:
|
||||
```bash
|
||||
composer require nullthoughts/laravel-data-sync
|
||||
```
|
||||
|
||||
Or add this line in your `composer.json`, inside of the `require` section:
|
||||
|
||||
``` json
|
||||
{
|
||||
"require": {
|
||||
"nullthoughts/laravel-data-sync": "^1.0",
|
||||
}
|
||||
}
|
||||
```
|
||||
then run ` composer install `
|
||||
|
||||
## Usage
|
||||
- Run `php artisan vendor:publish --provider="nullthoughts\LaravelDataSync\DataSyncBaseServiceProvider" --tag="data-sync-config"` to publish config file. Specify directory for sync data files (default is a new sync directory in the project root)
|
||||
- Create a JSON file for each model, using the model name as the filename. Example: Product.json would update the Product model
|
||||
- Use nested arrays in place of hardcoded IDs for relationships
|
||||
- Run `php artisan data:sync` (or `php artisan data:sync --model={model}` with the model flag to specify a model)
|
||||
@@ -14,8 +36,8 @@ If using Laravel Forge, you can have the data sync run automatically on deploy.
|
||||
```
|
||||
if [ -f artisan ]
|
||||
then
|
||||
php artisan data:sync
|
||||
php artisan migrate --force
|
||||
php artisan data:sync
|
||||
fi
|
||||
```
|
||||
|
||||
@@ -144,4 +166,4 @@ translates to...
|
||||
'role_id' => Role::where('slug', 'destroy-ferrari')->first()->id,
|
||||
]);
|
||||
|
||||
```
|
||||
```
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Console\Commands;
|
||||
namespace nullthoughts\LaravelDataSync\Console\Commands;
|
||||
|
||||
use distinctm\LaravelDataSync\Updater;
|
||||
use nullthoughts\LaravelDataSync\Updater;
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class Sync extends Command
|
||||
@@ -17,9 +17,9 @@ class Sync extends Command
|
||||
$model = $this->option('model');
|
||||
|
||||
$this->info('Updating Models with sync data files');
|
||||
|
||||
|
||||
(new Updater($path, $model))->run();
|
||||
|
||||
|
||||
$this->comment('Data sync completed');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync;
|
||||
namespace nullthoughts\LaravelDataSync;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
@@ -23,7 +23,7 @@ class DataSyncBaseServiceProvider extends ServiceProvider
|
||||
protected function registerPublishing()
|
||||
{
|
||||
$this->publishes([
|
||||
__DIR__ . '/../config/data-sync.php' => config_path('data-sync.php'),
|
||||
__DIR__.'/../config/data-sync.php' => config_path('data-sync.php'),
|
||||
], 'data-sync-config');
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Exceptions;
|
||||
namespace nullthoughts\LaravelDataSync\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
|
||||
class ErrorUpdatingModelException extends Exception
|
||||
{
|
||||
public function __construct(string $message = "", int $code = 0, Throwable $previous = null)
|
||||
public function __construct(string $message = '', int $code = 0, Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
$this->message = "Error updating the {$message} model.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Exceptions;
|
||||
namespace nullthoughts\LaravelDataSync\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class FileDirectoryNotFoundException extends Exception
|
||||
{
|
||||
protected $message = 'Specified sync file directory does not exist';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Exceptions;
|
||||
namespace nullthoughts\LaravelDataSync\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class NoCriteriaException extends Exception
|
||||
{
|
||||
protected $message = 'No criteria/attributes detected';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Exceptions;
|
||||
namespace nullthoughts\LaravelDataSync\Exceptions;
|
||||
|
||||
use Exception;
|
||||
use Throwable;
|
||||
|
||||
class NoRecordsInvalidJSONException extends Exception
|
||||
{
|
||||
public function __construct(string $message = "", int $code = 0, Throwable $previous = null)
|
||||
public function __construct(string $message = '', int $code = 0, Throwable $previous = null)
|
||||
{
|
||||
parent::__construct($message, $code, $previous);
|
||||
|
||||
$this->message = "No records or invalid JSON for {$message} model.";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync;
|
||||
namespace nullthoughts\LaravelDataSync;
|
||||
|
||||
use distinctm\LaravelDataSync\Exceptions\FileDirectoryNotFoundException;
|
||||
use distinctm\LaravelDataSync\Exceptions\NoCriteriaException;
|
||||
use distinctm\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException;
|
||||
use nullthoughts\LaravelDataSync\Exceptions\ErrorUpdatingModelException;
|
||||
use nullthoughts\LaravelDataSync\Exceptions\FileDirectoryNotFoundException;
|
||||
use nullthoughts\LaravelDataSync\Exceptions\NoCriteriaException;
|
||||
use nullthoughts\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException;
|
||||
use Illuminate\Support\Collection;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use distinctm\LaravelDataSync\Exceptions\ErrorUpdatingModelException;
|
||||
use Illuminate\Support\Str;
|
||||
use stdClass;
|
||||
|
||||
class Updater
|
||||
{
|
||||
/**
|
||||
* Get files in sync directory
|
||||
* Get files in sync directory.
|
||||
*
|
||||
* @param string|null $path
|
||||
* @param string|null $model
|
||||
*
|
||||
* @throws \distinctm\LaravelDataSync\Exceptions\FileDirectoryNotFoundException
|
||||
* @throws \nullthoughts\LaravelDataSync\Exceptions\FileDirectoryNotFoundException
|
||||
*/
|
||||
public function __construct($path = null, $model = null)
|
||||
{
|
||||
@@ -26,7 +28,7 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute syncModel for each file
|
||||
* Execute syncModel for each file.
|
||||
*
|
||||
* @return mixed
|
||||
*/
|
||||
@@ -46,12 +48,13 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Parse each record for criteria/values and update/create model
|
||||
* Parse each record for criteria/values and update/create model.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @throws \nullthoughts\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @throws \distinctm\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException
|
||||
*/
|
||||
protected function syncModel(string $file)
|
||||
{
|
||||
@@ -74,28 +77,29 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Get directory path for sync files
|
||||
* Get directory path for sync files.
|
||||
*
|
||||
* @param $path
|
||||
*
|
||||
* @throws \nullthoughts\LaravelDataSync\Exceptions\FileDirectoryNotFoundException
|
||||
*
|
||||
* @return string
|
||||
* @throws \distinctm\LaravelDataSync\Exceptions\FileDirectoryNotFoundException
|
||||
*/
|
||||
protected function getDirectory($path)
|
||||
{
|
||||
$directory = $path ?? config('data-sync.path', base_path('sync'));
|
||||
|
||||
if (!file_exists($directory)) {
|
||||
throw new FileDirectoryNotFoundException;
|
||||
throw new FileDirectoryNotFoundException();
|
||||
}
|
||||
|
||||
return $directory;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get list of files in directory
|
||||
* Get list of files in directory.
|
||||
*
|
||||
* @param string $directory
|
||||
* @param string $directory
|
||||
* @param string|null $model
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
@@ -103,11 +107,11 @@ class Updater
|
||||
protected function getFiles(string $directory, $model = null)
|
||||
{
|
||||
if ($model) {
|
||||
return Collection::wrap($directory . '/' . $model . '.json');
|
||||
return Collection::wrap($directory.'/'.$model.'.json');
|
||||
}
|
||||
|
||||
return collect(File::files($directory))
|
||||
->filter(function($file) {
|
||||
->filter(function ($file) {
|
||||
return pathinfo($file, PATHINFO_EXTENSION) == 'json';
|
||||
})->map(function ($path) {
|
||||
return $path->getPathname();
|
||||
@@ -115,45 +119,47 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort Models by pre-configured order
|
||||
* Sort Models by pre-configured order.
|
||||
*
|
||||
* @param \Illuminate\Support\Collection $files
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
protected function sortModels(\Illuminate\Support\Collection $files)
|
||||
{
|
||||
if(empty(config('data-sync.order'))) {
|
||||
if (empty(config('data-sync.order'))) {
|
||||
return $files;
|
||||
}
|
||||
|
||||
return $files->sortBy(function($file) use ($files) {
|
||||
|
||||
return $files->sortBy(function ($file) use ($files) {
|
||||
$filename = pathinfo($file, PATHINFO_FILENAME);
|
||||
|
||||
|
||||
$order = array_search(
|
||||
studly_case($filename),
|
||||
Str::studly($filename),
|
||||
config('data-sync.order')
|
||||
);
|
||||
|
||||
|
||||
return $order !== false ? $order : (count($files) + 1);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter record criteria
|
||||
* Filter record criteria.
|
||||
*
|
||||
* @param object $record
|
||||
* @param stdClass $record
|
||||
*
|
||||
* @throws \nullthoughts\LaravelDataSync\Exceptions\NoCriteriaException
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @throws \distinctm\LaravelDataSync\Exceptions\NoCriteriaException
|
||||
*/
|
||||
protected function getCriteria(object $record)
|
||||
protected function getCriteria(stdClass $record)
|
||||
{
|
||||
$criteria = collect($record)->filter(function ($value, $key) {
|
||||
return $this->isCriteria($key);
|
||||
});
|
||||
|
||||
if ($criteria->count() == 0) {
|
||||
throw new NoCriteriaException;
|
||||
throw new NoCriteriaException();
|
||||
}
|
||||
|
||||
return $criteria->mapWithKeys(function ($value, $key) {
|
||||
@@ -162,13 +168,13 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Filter record values
|
||||
* Filter record values.
|
||||
*
|
||||
* @param object $record
|
||||
* @param stdClass $record
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
*/
|
||||
protected function getValues(object $record)
|
||||
protected function getValues(stdClass $record)
|
||||
{
|
||||
return collect($record)->reject(function ($value, $key) {
|
||||
if ($this->isCriteria($key)) {
|
||||
@@ -184,7 +190,7 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns model name for file
|
||||
* Returns model name for file.
|
||||
*
|
||||
* @param string $name
|
||||
*
|
||||
@@ -192,16 +198,17 @@ class Updater
|
||||
*/
|
||||
protected function getModel(string $name)
|
||||
{
|
||||
return '\\App\\' . studly_case(pathinfo($name, PATHINFO_FILENAME));
|
||||
return '\\App\\'.Str::studly(pathinfo($name, PATHINFO_FILENAME));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses JSON from file and returns collection
|
||||
* Parses JSON from file and returns collection.
|
||||
*
|
||||
* @param string $file
|
||||
*
|
||||
* @throws \nullthoughts\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException
|
||||
*
|
||||
* @return \Illuminate\Support\Collection
|
||||
* @throws \distinctm\LaravelDataSync\Exceptions\NoRecordsInvalidJSONException
|
||||
*/
|
||||
protected function getRecords(string $file)
|
||||
{
|
||||
@@ -215,11 +222,11 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if column is criteria for a condition match
|
||||
* Check if column is criteria for a condition match.
|
||||
*
|
||||
* @param string $key
|
||||
*
|
||||
* @return boolean
|
||||
* @return bool
|
||||
*/
|
||||
protected function isCriteria($key)
|
||||
{
|
||||
@@ -227,19 +234,18 @@ class Updater
|
||||
}
|
||||
|
||||
/**
|
||||
* Return ID for nested key-value pairs
|
||||
* Return ID for nested key-value pairs.
|
||||
*
|
||||
* @param string $key
|
||||
* @param object $values
|
||||
* @param stdClass $values
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function resolveId(string $key, object $values)
|
||||
protected function resolveId(string $key, stdClass $values)
|
||||
{
|
||||
$model = $this->getModel($key);
|
||||
|
||||
$values = collect($values)->mapWithKeys(function ($value, $column) {
|
||||
|
||||
if (is_object($value)) {
|
||||
return $this->resolveId($column, $value);
|
||||
}
|
||||
@@ -247,11 +253,11 @@ class Updater
|
||||
return [$column => $value];
|
||||
})->toArray();
|
||||
|
||||
return [$key . '_id' => $model::where($values)->first()->id];
|
||||
return [$key.'_id' => $model::where($values)->first()->id];
|
||||
}
|
||||
|
||||
/**
|
||||
* Detect nested objects and resolve them
|
||||
* Detect nested objects and resolve them.
|
||||
*
|
||||
* @param \Illuminate\Support\Collection $record
|
||||
*
|
||||
@@ -267,5 +273,4 @@ class Updater
|
||||
return [$key => $value];
|
||||
})->toArray();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Tests;
|
||||
namespace nullthoughts\LaravelDataSync\Tests;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -14,4 +14,4 @@ class Roles extends Model
|
||||
{
|
||||
return $this->belongsTo(Supervisor::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Tests;
|
||||
namespace nullthoughts\LaravelDataSync\Tests;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
@@ -14,4 +14,4 @@ class Supervisor extends Model
|
||||
{
|
||||
return $this->hasMany(Roles::class);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Tests;
|
||||
namespace nullthoughts\LaravelDataSync\Tests;
|
||||
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
@@ -11,12 +11,12 @@ class TestCase extends \Orchestra\Testbench\TestCase
|
||||
{
|
||||
$app['config']->set('database.default', 'testdb');
|
||||
$app['config']->set('database.connections.testdb', [
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:'
|
||||
'driver' => 'sqlite',
|
||||
'database' => ':memory:',
|
||||
]);
|
||||
}
|
||||
|
||||
protected function setUp()
|
||||
protected function setUp(): void
|
||||
{
|
||||
parent::setUp();
|
||||
|
||||
@@ -32,4 +32,4 @@ class TestCase extends \Orchestra\Testbench\TestCase
|
||||
$table->string('category')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Tests;
|
||||
namespace nullthoughts\LaravelDataSync\Tests;
|
||||
|
||||
use distinctm\LaravelDataSync\Tests\Fakes\UpdaterFake;
|
||||
use nullthoughts\LaravelDataSync\Exceptions\ErrorUpdatingModelException;
|
||||
use nullthoughts\LaravelDataSync\Tests\fakes\UpdaterFake;
|
||||
use Exception;
|
||||
use distinctm\LaravelDataSync\Exceptions\ErrorUpdatingModelException;
|
||||
|
||||
class UpdaterTest extends TestCase
|
||||
{
|
||||
/** @test */
|
||||
public function it_adds_roles_to_the_database()
|
||||
{
|
||||
$updater = new UpdaterFake(__DIR__ . '/../test-data', 'roles');
|
||||
$updater = new UpdaterFake(__DIR__.'/../test-data', 'roles');
|
||||
|
||||
$updater->run();
|
||||
|
||||
@@ -23,7 +23,7 @@ class UpdaterTest extends TestCase
|
||||
/** @test */
|
||||
public function it_can_default_to_configuration()
|
||||
{
|
||||
config()->set('data-sync.path', __DIR__ . '/../test-data');
|
||||
config()->set('data-sync.path', __DIR__.'/../test-data');
|
||||
|
||||
$updater = new UpdaterFake();
|
||||
|
||||
@@ -37,10 +37,10 @@ class UpdaterTest extends TestCase
|
||||
/** @test */
|
||||
public function it_can_update_an_existing_record()
|
||||
{
|
||||
config()->set('data-sync.path', __DIR__ . '/../test-data');
|
||||
config()->set('data-sync.path', __DIR__.'/../test-data');
|
||||
(new UpdaterFake())->run();
|
||||
|
||||
config()->set('data-sync.path', __DIR__ . '/../test-data/valid');
|
||||
config()->set('data-sync.path', __DIR__.'/../test-data/valid');
|
||||
(new UpdaterFake())->run();
|
||||
|
||||
$this->assertDatabaseHas('roles', ['category' => 'changed']);
|
||||
@@ -55,7 +55,7 @@ class UpdaterTest extends TestCase
|
||||
'name' => 'CEO',
|
||||
]);
|
||||
|
||||
config()->set('data-sync.path', __DIR__ . '/../test-data/relationship', 'roles');
|
||||
config()->set('data-sync.path', __DIR__.'/../test-data/relationship', 'roles');
|
||||
(new UpdaterFake())->run();
|
||||
|
||||
$this->assertEquals($supervisor->id, Roles::first()->supervisor_id);
|
||||
@@ -69,21 +69,19 @@ class UpdaterTest extends TestCase
|
||||
new UpdaterFake();
|
||||
|
||||
$this->fail('exception was thrown');
|
||||
|
||||
} catch (Exception $e) {
|
||||
$this->assertEquals('Specified sync file directory does not exist', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/** @test */
|
||||
public function invalid_json_throws_an_exception()
|
||||
{
|
||||
try {
|
||||
$updater = new UpdaterFake(__DIR__ . '/../test-data/invalid-json');
|
||||
$updater = new UpdaterFake(__DIR__.'/../test-data/invalid-json');
|
||||
$updater->run();
|
||||
|
||||
$this->fail('exception was thrown');
|
||||
|
||||
} catch (Exception $e) {
|
||||
$this->assertContains('No records or invalid JSON for', $e->getMessage());
|
||||
}
|
||||
@@ -93,13 +91,12 @@ class UpdaterTest extends TestCase
|
||||
public function the_json_must_contain_a_key_with_an_underscore()
|
||||
{
|
||||
try {
|
||||
$updater = new UpdaterFake(__DIR__ . '/../test-data/no-criteria');
|
||||
$updater = new UpdaterFake(__DIR__.'/../test-data/no-criteria');
|
||||
$updater->run();
|
||||
|
||||
$this->fail('exception was thrown');
|
||||
|
||||
} catch (Exception $e) {
|
||||
$this->assertEquals('No criteria/attributes detected', $e->getMessage());
|
||||
$this->assertEquals('No criteria/attributes detected', $e->getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -108,10 +105,10 @@ class UpdaterTest extends TestCase
|
||||
{
|
||||
config()->set('data-sync.order', [
|
||||
'Supervisor',
|
||||
'Roles'
|
||||
'Roles',
|
||||
]);
|
||||
|
||||
$updater = new UpdaterFake(__DIR__ . '/../test-data/ordered');
|
||||
$updater = new UpdaterFake(__DIR__.'/../test-data/ordered');
|
||||
$updater->run();
|
||||
|
||||
$this->assertDatabaseHas('roles', ['slug' => 'update-student-records']);
|
||||
@@ -123,21 +120,21 @@ class UpdaterTest extends TestCase
|
||||
{
|
||||
config()->set('data-sync.order', [
|
||||
'Roles',
|
||||
'Supervisor'
|
||||
'Supervisor',
|
||||
]);
|
||||
|
||||
$this->expectException(ErrorUpdatingModelException::class);
|
||||
|
||||
$updater = new UpdaterFake(__DIR__ . '/../test-data/ordered');
|
||||
|
||||
$updater = new UpdaterFake(__DIR__.'/../test-data/ordered');
|
||||
$updater->run();
|
||||
}
|
||||
|
||||
/** @test */
|
||||
public function it_ignores_non_json_files()
|
||||
{
|
||||
$updater = new UpdaterFake(__DIR__ . '/../test-data/not-json');
|
||||
$updater = new UpdaterFake(__DIR__.'/../test-data/not-json');
|
||||
$updater->run();
|
||||
|
||||
$this->assertDatabaseMissing('roles', ['slug' => 'update-student-records']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,15 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace distinctm\LaravelDataSync\Tests\Fakes;
|
||||
namespace nullthoughts\LaravelDataSync\Tests\Fakes;
|
||||
|
||||
use distinctm\LaravelDataSync\Updater;
|
||||
use nullthoughts\LaravelDataSync\Updater;
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
class UpdaterFake extends Updater
|
||||
{
|
||||
protected function getModel(string $name)
|
||||
{
|
||||
return '\\distinctm\\LaravelDataSync\\Tests\\' . studly_case(
|
||||
pathinfo($name, PATHINFO_FILENAME)
|
||||
);
|
||||
return '\\nullthoughts\\LaravelDataSync\\Tests\\'.Str::studly(
|
||||
pathinfo($name, PATHINFO_FILENAME)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user