diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ab91c28 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,41 @@ +version: 2 +jobs: + build: + docker: + # specify the version you desire here + - image: circleci/php:7.1.8-browsers + - image: circleci/mysql:5.7.22 + working_directory: ~/repo + steps: + - checkout + - restore_cache: + keys: + - v1-dependencies-{{ checksum "composer.json" }} + # fallback to using the latest cache if no exact match is found + - v1-dependencies- + - run: + name: Install and enable PHP extensions + command: sudo docker-php-ext-install pdo_mysql && sudo docker-php-ext-enable xdebug + - run: + name: Install composer packages + command: | + composer install -n --prefer-dist --no-interaction --no-plugins --no-scripts + - save_cache: + paths: + - ./vendor + key: v1-dependencies-{{ checksum "composer.json" }} + + - run: + name: Wait for mysql launch + command: | + dockerize -wait tcp://localhost:3306 -timeout 1m + nc -z 127.0.0.1 3306 + - run: + name: Tests + command: | + vendor/bin/phpunit --verbose --configuration phpunit.xml --coverage-clover=coverage.xml + + - run: + name: Coverage Report + command: | + bash <(curl -s https://codecov.io/bash) -t $CODECOV_TOKEN \ No newline at end of file diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..45918b0 --- /dev/null +++ b/.gitignore @@ -0,0 +1,27 @@ +vendor/ +node_modules/ +npm-debug.log + +# Laravel 4 specific +bootstrap/compiled.php +app/storage/ + +# Laravel 5 & Lumen specific +public/storage +public/hot +storage/*.key +.env.*.php +.env.php +.env +Homestead.yaml +Homestead.json + +# Rocketeer PHP task runner and deployment package. https://github.com/rocketeers/rocketeer +.rocketeer/ + +# ide-helpers +.phpstorm.meta.php +_ide_helper.php + +# package +composer.lock \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..07b8f17 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 Maksim Martianov + +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. diff --git a/README.md b/README.md new file mode 100644 index 0000000..3857441 --- /dev/null +++ b/README.md @@ -0,0 +1,14 @@ +[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/maksimru/composite-primary-keys/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/maksimru/composite-primary-keys/?branch=master) +[![codecov](https://codecov.io/gh/maksimru/composite-primary-keys/branch/master/graph/badge.svg)](https://codecov.io/gh/maksimru/composite-primary-keys) +[![StyleCI](https://github.styleci.io/repos/163864737/shield?branch=master)](https://github.styleci.io/repos/143376291) +[![CircleCI](https://circleci.com/gh/maksimru/composite-primary-keys.svg?style=svg)](https://circleci.com/gh/maksimru/composite-primary-keys) + +## About + +Library extends Laravel's Eloquent ORM with full support of composite keys + +## Usage + +No installation required + +Simply add HasCompositePrimaryKey trait into your models \ No newline at end of file