diff --git a/CHANGELOG.md b/CHANGELOG.md index 95f89ee..2c52340 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,7 +3,10 @@ All Notable changes to `EloquentMeta` will be documented in this file ## NEXT -- Make compatible with Laravel 5.4 +- More tests (especially for validation) + +## v1.6.1 - 3.30.2017 +- Use correct Translator in `validate()` ## v1.5.1 - 3.30.2017 - Replace `list()` with `pluck()` for collections diff --git a/README.md b/README.md index e9280a7..5449c89 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ Install through Composer. } ``` -Please not only php `5.6` and `7`+ are supported. +Please note only php `5.6` and `7`+ are supported. If you are using EloquentMeta and Eloquent **without** using Laravel, you will also have to setup Eloquent as detailed in its [documentation](https://github.com/illuminate/database). diff --git a/composer.json b/composer.json index c1582e3..3683ca0 100644 --- a/composer.json +++ b/composer.json @@ -16,11 +16,11 @@ ], "require": { "php": ">=5.4.0", - "illuminate/support": "5.3.*", + "illuminate/support": "5.4.*", "nesbot/carbon": "1.*", - "illuminate/database": "5.3.*", - "illuminate/validation": "5.3.*", - "illuminate/translation": "5.3.*" + "illuminate/database": "5.4.*", + "illuminate/validation": "5.4.*", + "illuminate/translation": "5.4.*" }, "require-dev": { "phpunit/phpunit": "4.4.*", diff --git a/composer.lock b/composer.lock index 0428d71..dbbe321 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "8386ed3873c5e700e6d657292d647e42", + "content-hash": "9e9aa30e597ace182f1e93ebcb64980a", "packages": [ { "name": "doctrine/inflector", @@ -75,26 +75,26 @@ }, { "name": "illuminate/container", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/container.git", - "reference": "df3f56dc573491958cc977f98dd72f39f74560d3" + "reference": "1fc0d2451e23d2ea73c10462d74add4767e2b74c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/df3f56dc573491958cc977f98dd72f39f74560d3", - "reference": "df3f56dc573491958cc977f98dd72f39f74560d3", + "url": "https://api.github.com/repos/illuminate/container/zipball/1fc0d2451e23d2ea73c10462d74add4767e2b74c", + "reference": "1fc0d2451e23d2ea73c10462d74add4767e2b74c", "shasum": "" }, "require": { - "illuminate/contracts": "5.3.*", + "illuminate/contracts": "5.4.*", "php": ">=5.6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -114,20 +114,20 @@ ], "description": "The Illuminate Container package.", "homepage": "https://laravel.com", - "time": "2016-12-23 01:26:32" + "time": "2017-03-13 14:14:19" }, { "name": "illuminate/contracts", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/contracts.git", - "reference": "ebed2e6d1203d7fad2db7184e7a6f18d636bca8d" + "reference": "ab2825726bee46a67c8cc66789852189dbef74a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/ebed2e6d1203d7fad2db7184e7a6f18d636bca8d", - "reference": "ebed2e6d1203d7fad2db7184e7a6f18d636bca8d", + "url": "https://api.github.com/repos/illuminate/contracts/zipball/ab2825726bee46a67c8cc66789852189dbef74a9", + "reference": "ab2825726bee46a67c8cc66789852189dbef74a9", "shasum": "" }, "require": { @@ -136,7 +136,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -156,41 +156,41 @@ ], "description": "The Illuminate Contracts package.", "homepage": "https://laravel.com", - "time": "2016-12-23 01:26:32" + "time": "2017-03-29 13:17:47" }, { "name": "illuminate/database", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/database.git", - "reference": "5ad7039530fdbf398a14dede631ac1ead26531fb" + "reference": "e96af249564ba9d672936b0594dd31a1f0c26ec8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/5ad7039530fdbf398a14dede631ac1ead26531fb", - "reference": "5ad7039530fdbf398a14dede631ac1ead26531fb", + "url": "https://api.github.com/repos/illuminate/database/zipball/e96af249564ba9d672936b0594dd31a1f0c26ec8", + "reference": "e96af249564ba9d672936b0594dd31a1f0c26ec8", "shasum": "" }, "require": { - "illuminate/container": "5.3.*", - "illuminate/contracts": "5.3.*", - "illuminate/support": "5.3.*", + "illuminate/container": "5.4.*", + "illuminate/contracts": "5.4.*", + "illuminate/support": "5.4.*", "nesbot/carbon": "~1.20", "php": ">=5.6.4" }, "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.4).", + "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.5).", "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "illuminate/console": "Required to use the database commands (5.3.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.3.*).", - "illuminate/filesystem": "Required to use the migrations (5.3.*).", - "illuminate/pagination": "Required to paginate the result set (5.3.*)." + "illuminate/console": "Required to use the database commands (5.4.*).", + "illuminate/events": "Required to use the observers with Eloquent (5.4.*).", + "illuminate/filesystem": "Required to use the migrations (5.4.*).", + "illuminate/pagination": "Required to paginate the result set (5.4.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -216,27 +216,27 @@ "orm", "sql" ], - "time": "2017-01-13 18:15:21" + "time": "2017-03-29 13:51:54" }, { "name": "illuminate/filesystem", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/filesystem.git", - "reference": "47cfbc9db7ffc84a959aa3d4b0c4dd3b9a89a94b" + "reference": "3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/47cfbc9db7ffc84a959aa3d4b0c4dd3b9a89a94b", - "reference": "47cfbc9db7ffc84a959aa3d4b0c4dd3b9a89a94b", + "url": "https://api.github.com/repos/illuminate/filesystem/zipball/3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1", + "reference": "3ed8b9a35880a9619141e2965fd5cbbe2e1c0da1", "shasum": "" }, "require": { - "illuminate/contracts": "5.3.*", - "illuminate/support": "5.3.*", + "illuminate/contracts": "5.4.*", + "illuminate/support": "5.4.*", "php": ">=5.6.4", - "symfony/finder": "3.1.*" + "symfony/finder": "~3.2" }, "suggest": { "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).", @@ -246,7 +246,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -266,26 +266,26 @@ ], "description": "The Illuminate Filesystem package.", "homepage": "https://laravel.com", - "time": "2017-01-03 13:57:22" + "time": "2017-03-01 21:44:04" }, { "name": "illuminate/support", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/support.git", - "reference": "18c5e857f2ee5e2ac61221b6ff444d309d170bf9" + "reference": "c7e7c9daf5044e76b46085b8351f8235a3e979c6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/18c5e857f2ee5e2ac61221b6ff444d309d170bf9", - "reference": "18c5e857f2ee5e2ac61221b6ff444d309d170bf9", + "url": "https://api.github.com/repos/illuminate/support/zipball/c7e7c9daf5044e76b46085b8351f8235a3e979c6", + "reference": "c7e7c9daf5044e76b46085b8351f8235a3e979c6", "shasum": "" }, "require": { "doctrine/inflector": "~1.0", "ext-mbstring": "*", - "illuminate/contracts": "5.3.*", + "illuminate/contracts": "5.4.*", "paragonie/random_compat": "~1.4|~2.0", "php": ">=5.6.4" }, @@ -294,13 +294,13 @@ }, "suggest": { "illuminate/filesystem": "Required to use the composer class (5.2.*).", - "symfony/process": "Required to use the composer class (3.1.*).", - "symfony/var-dumper": "Required to use the dd function (3.1.*)." + "symfony/process": "Required to use the composer class (~3.2).", + "symfony/var-dumper": "Required to use the dd function (~3.2)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -323,32 +323,32 @@ ], "description": "The Illuminate Support package.", "homepage": "https://laravel.com", - "time": "2016-12-28 19:33:33" + "time": "2017-03-28 12:49:45" }, { "name": "illuminate/translation", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/translation.git", - "reference": "6c56cc0c319bb932e7bdaeaed0c4a3f6befbb37f" + "reference": "156e7f619a36de6c9421c6ef85571859afb14fe1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/translation/zipball/6c56cc0c319bb932e7bdaeaed0c4a3f6befbb37f", - "reference": "6c56cc0c319bb932e7bdaeaed0c4a3f6befbb37f", + "url": "https://api.github.com/repos/illuminate/translation/zipball/156e7f619a36de6c9421c6ef85571859afb14fe1", + "reference": "156e7f619a36de6c9421c6ef85571859afb14fe1", "shasum": "" }, "require": { - "illuminate/filesystem": "5.3.*", - "illuminate/support": "5.3.*", - "php": ">=5.6.4", - "symfony/translation": "3.1.*" + "illuminate/contracts": "5.4.*", + "illuminate/filesystem": "5.4.*", + "illuminate/support": "5.4.*", + "php": ">=5.6.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -368,37 +368,37 @@ ], "description": "The Illuminate Translation package.", "homepage": "https://laravel.com", - "time": "2016-12-23 01:26:32" + "time": "2017-02-24 02:26:38" }, { "name": "illuminate/validation", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/validation.git", - "reference": "90bdda0988c469edfe14cdaf5fd2db4125c64c76" + "reference": "0a29849cefbec107a1c23714cec7664789d830dc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/validation/zipball/90bdda0988c469edfe14cdaf5fd2db4125c64c76", - "reference": "90bdda0988c469edfe14cdaf5fd2db4125c64c76", + "url": "https://api.github.com/repos/illuminate/validation/zipball/0a29849cefbec107a1c23714cec7664789d830dc", + "reference": "0a29849cefbec107a1c23714cec7664789d830dc", "shasum": "" }, "require": { - "illuminate/container": "5.3.*", - "illuminate/contracts": "5.3.*", - "illuminate/support": "5.3.*", + "illuminate/container": "5.4.*", + "illuminate/contracts": "5.4.*", + "illuminate/support": "5.4.*", + "illuminate/translation": "5.4.*", "php": ">=5.6.4", - "symfony/http-foundation": "3.1.*", - "symfony/translation": "3.1.*" + "symfony/http-foundation": "~3.2" }, "suggest": { - "illuminate/database": "Required to use the database presence verifier (5.3.*)." + "illuminate/database": "Required to use the database presence verifier (5.4.*)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -418,7 +418,7 @@ ], "description": "The Illuminate Validation package.", "homepage": "https://laravel.com", - "time": "2017-02-18 04:02:30" + "time": "2017-03-19 01:17:59" }, { "name": "nesbot/carbon", @@ -523,16 +523,16 @@ }, { "name": "symfony/finder", - "version": "3.1.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/finder.git", - "reference": "59687a255d1562f2c17b012418273862083d85f7" + "reference": "851a8764b99bd4173b9992d09ab91050803f0385" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/59687a255d1562f2c17b012418273862083d85f7", - "reference": "59687a255d1562f2c17b012418273862083d85f7", + "url": "https://api.github.com/repos/symfony/finder/zipball/851a8764b99bd4173b9992d09ab91050803f0385", + "reference": "851a8764b99bd4173b9992d09ab91050803f0385", "shasum": "" }, "require": { @@ -541,7 +541,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -568,20 +568,20 @@ ], "description": "Symfony Finder Component", "homepage": "https://symfony.com", - "time": "2017-01-02 20:31:54" + "time": "2017-03-20 10:06:58" }, { "name": "symfony/http-foundation", - "version": "3.1.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/http-foundation.git", - "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0" + "reference": "09aebc3dfa75367514ada6c48e992e7a2831e6bd" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/http-foundation/zipball/cef0ad49a2e90455cfc649522025b5a2929648c0", - "reference": "cef0ad49a2e90455cfc649522025b5a2929648c0", + "url": "https://api.github.com/repos/symfony/http-foundation/zipball/09aebc3dfa75367514ada6c48e992e7a2831e6bd", + "reference": "09aebc3dfa75367514ada6c48e992e7a2831e6bd", "shasum": "" }, "require": { @@ -594,7 +594,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -621,7 +621,7 @@ ], "description": "Symfony HttpFoundation Component", "homepage": "https://symfony.com", - "time": "2017-01-08 20:43:43" + "time": "2017-03-27 14:57:37" }, { "name": "symfony/polyfill-mbstring", @@ -684,16 +684,16 @@ }, { "name": "symfony/translation", - "version": "3.1.x-dev", + "version": "3.2.x-dev", "source": { "type": "git", "url": "https://github.com/symfony/translation.git", - "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45" + "reference": "c740eee70783d2af4d3d6b70d5146f209e6b4d13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/d5a20fab5f63f44c233c69b3041c3cb1d4945e45", - "reference": "d5a20fab5f63f44c233c69b3041c3cb1d4945e45", + "url": "https://api.github.com/repos/symfony/translation/zipball/c740eee70783d2af4d3d6b70d5146f209e6b4d13", + "reference": "c740eee70783d2af4d3d6b70d5146f209e6b4d13", "shasum": "" }, "require": { @@ -706,7 +706,7 @@ "require-dev": { "psr/log": "~1.0", "symfony/config": "~2.8|~3.0", - "symfony/intl": "~2.8|~3.0", + "symfony/intl": "^2.8.18|^3.2.5", "symfony/yaml": "~2.8|~3.0" }, "suggest": { @@ -717,7 +717,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.2-dev" } }, "autoload": { @@ -744,7 +744,7 @@ ], "description": "Symfony Translation Component", "homepage": "https://symfony.com", - "time": "2017-01-21 17:01:39" + "time": "2017-03-21 21:44:32" } ], "packages-dev": [ @@ -800,38 +800,38 @@ "constructor", "instantiate" ], - "time": "2017-02-16T16:15:51+00:00" + "time": "2017-02-16 16:15:51" }, { "name": "illuminate/console", - "version": "5.3.x-dev", + "version": "5.4.x-dev", "source": { "type": "git", "url": "https://github.com/illuminate/console.git", - "reference": "92e04079327e9634053b06d5003a00906be6f966" + "reference": "8ea19d470cdc0d6ab88269b1841dfd234cf308b8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/illuminate/console/zipball/92e04079327e9634053b06d5003a00906be6f966", - "reference": "92e04079327e9634053b06d5003a00906be6f966", + "url": "https://api.github.com/repos/illuminate/console/zipball/8ea19d470cdc0d6ab88269b1841dfd234cf308b8", + "reference": "8ea19d470cdc0d6ab88269b1841dfd234cf308b8", "shasum": "" }, "require": { - "illuminate/contracts": "5.3.*", - "illuminate/support": "5.3.*", + "illuminate/contracts": "5.4.*", + "illuminate/support": "5.4.*", "nesbot/carbon": "~1.20", "php": ">=5.6.4", - "symfony/console": "3.1.*" + "symfony/console": "~3.2" }, "suggest": { - "guzzlehttp/guzzle": "Required to use the ping methods on schedules (~5.3|~6.0).", + "guzzlehttp/guzzle": "Required to use the ping methods on schedules (~6.0).", "mtdowling/cron-expression": "Required to use scheduling component (~1.0).", - "symfony/process": "Required to use scheduling component (3.1.*)." + "symfony/process": "Required to use scheduling component (~3.2)." }, "type": "library", "extra": { "branch-alias": { - "dev-master": "5.3-dev" + "dev-master": "5.4-dev" } }, "autoload": { @@ -851,7 +851,7 @@ ], "description": "The Illuminate Console package.", "homepage": "https://laravel.com", - "time": "2017-01-06T14:26:42+00:00" + "time": "2017-03-23T15:59:01+00:00" }, { "name": "phpunit/php-code-coverage", @@ -913,7 +913,7 @@ "testing", "xunit" ], - "time": "2015-10-06T15:47:00+00:00" + "time": "2015-10-06 15:47:00" }, { "name": "phpunit/php-file-iterator", @@ -1048,7 +1048,7 @@ "keywords": [ "timer" ], - "time": "2017-03-07T15:42:04+00:00" + "time": "2017-03-07 15:42:04" }, { "name": "phpunit/php-token-stream", @@ -1097,7 +1097,7 @@ "keywords": [ "tokenizer" ], - "time": "2017-03-07T08:21:50+00:00" + "time": "2017-03-07 08:21:50" }, { "name": "phpunit/phpunit", @@ -1169,7 +1169,7 @@ "testing", "xunit" ], - "time": "2015-02-09T06:34:32+00:00" + "time": "2015-02-09 06:34:32" }, { "name": "phpunit/phpunit-mock-objects", @@ -1225,7 +1225,7 @@ "mock", "xunit" ], - "time": "2015-10-02T06:51:40+00:00" + "time": "2015-10-02 06:51:40" }, { "name": "psr/log", @@ -1272,7 +1272,7 @@ "psr", "psr-3" ], - "time": "2016-10-10T12:19:37+00:00" + "time": "2016-10-10 12:19:37" }, { "name": "sebastian/comparator", @@ -1336,7 +1336,7 @@ "compare", "equality" ], - "time": "2017-03-07T10:34:43+00:00" + "time": "2017-03-07 10:34:43" }, { "name": "sebastian/diff", @@ -1388,7 +1388,7 @@ "keywords": [ "diff" ], - "time": "2017-03-07T07:26:53+00:00" + "time": "2017-03-07 07:26:53" }, { "name": "sebastian/environment", @@ -1438,7 +1438,7 @@ "environment", "hhvm" ], - "time": "2017-02-28T08:18:59+00:00" + "time": "2017-02-28 08:18:59" }, { "name": "sebastian/exporter", @@ -1505,7 +1505,7 @@ "export", "exporter" ], - "time": "2017-02-26T13:09:30+00:00" + "time": "2017-02-26 13:09:30" }, { "name": "sebastian/global-state", @@ -1556,7 +1556,7 @@ "keywords": [ "global state" ], - "time": "2017-02-23T14:11:06+00:00" + "time": "2017-02-23 14:11:06" }, { "name": "sebastian/recursion-context", @@ -1609,7 +1609,7 @@ ], "description": "Provides functionality to recursively process PHP variables", "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "time": "2016-10-03T07:41:43+00:00" + "time": "2016-10-03 07:41:43" }, { "name": "sebastian/version", @@ -1648,16 +1648,16 @@ }, { "name": "symfony/console", - "version": "3.1.x-dev", + "version": "dev-master", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52" + "reference": "1030e321ade9b3cd5b9294262a27656ff06896c4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/047f16485d68c083bd5d9b73ff16f9cb9c1a9f52", - "reference": "047f16485d68c083bd5d9b73ff16f9cb9c1a9f52", + "url": "https://api.github.com/repos/symfony/console/zipball/1030e321ade9b3cd5b9294262a27656ff06896c4", + "reference": "1030e321ade9b3cd5b9294262a27656ff06896c4", "shasum": "" }, "require": { @@ -1665,20 +1665,27 @@ "symfony/debug": "~2.8|~3.0", "symfony/polyfill-mbstring": "~1.0" }, + "conflict": { + "symfony/dependency-injection": "<3.3" + }, "require-dev": { "psr/log": "~1.0", + "symfony/dependency-injection": "~3.3", "symfony/event-dispatcher": "~2.8|~3.0", + "symfony/filesystem": "~2.8|~3.0", + "symfony/http-kernel": "~2.8|~3.0", "symfony/process": "~2.8|~3.0" }, "suggest": { "psr/log": "For using the console logger", "symfony/event-dispatcher": "", + "symfony/filesystem": "", "symfony/process": "" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "3.1-dev" + "dev-master": "3.3-dev" } }, "autoload": { @@ -1705,7 +1712,7 @@ ], "description": "Symfony Console Component", "homepage": "https://symfony.com", - "time": "2017-01-08T20:43:43+00:00" + "time": "2017-03-27T14:51:00+00:00" }, { "name": "symfony/debug", @@ -1761,7 +1768,7 @@ ], "description": "Symfony Debug Component", "homepage": "https://symfony.com", - "time": "2017-02-18T17:35:19+00:00" + "time": "2017-02-18 17:35:19" }, { "name": "symfony/yaml", @@ -1810,7 +1817,7 @@ ], "description": "Symfony Yaml Component", "homepage": "https://symfony.com", - "time": "2017-03-20T09:41:44+00:00" + "time": "2017-03-20 09:41:44" } ], "aliases": [], diff --git a/src/Phoenix/EloquentMeta/Meta.php b/src/Phoenix/EloquentMeta/Meta.php index 0c4c1da..1dc08eb 100644 --- a/src/Phoenix/EloquentMeta/Meta.php +++ b/src/Phoenix/EloquentMeta/Meta.php @@ -3,8 +3,9 @@ use Illuminate\Container\Container; use Illuminate\Support\MessageBag; use Illuminate\Database\Eloquent\Model; +use Illuminate\Translation\ArrayLoader; +use Illuminate\Translation\Translator; use Illuminate\Validation\Factory; -use Symfony\Component\Translation\Translator; class Meta extends Model { @@ -74,7 +75,7 @@ protected static function boot() */ public function validate() { - $validatorFactory = new Factory(new Translator('en'), new Container()); + $validatorFactory = new Factory(new Translator(new ArrayLoader(), 'en'), new Container()); $validator = $validatorFactory->make($this->attributes, static::$rules); if ($validator->passes()) { diff --git a/src/Phoenix/EloquentMeta/MetaTrait.php b/src/Phoenix/EloquentMeta/MetaTrait.php index 13c2bde..9cb0c62 100644 --- a/src/Phoenix/EloquentMeta/MetaTrait.php +++ b/src/Phoenix/EloquentMeta/MetaTrait.php @@ -1,6 +1,7 @@ meta_model) ? $this->meta_model : 'Phoenix\EloquentMeta\Meta'; + $meta_model = isset($this->meta_model) ? $this->meta_model : Meta::class; return $this->morphMany($meta_model, 'metable'); } }