From 500004012006a35bc7a155a898ad2a647c843e88 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Thu, 10 May 2018 11:03:19 -0500 Subject: [PATCH 01/24] modified composer.json --- composer.json | 3 +- composer.lock | 862 -------------------------------------------------- 2 files changed, 1 insertion(+), 864 deletions(-) delete mode 100644 composer.lock diff --git a/composer.json b/composer.json index 09623c5..0ac919e 100644 --- a/composer.json +++ b/composer.json @@ -13,8 +13,7 @@ "fzaninotto/faker": "^1.4", "illuminate/filesystem": "^5.4", "illuminate/pagination": "^5.4", - "nesbot/carbon": "^1.27", - "doctrine/inflector": "1.1" + "nesbot/carbon": "^1.27" }, "autoload": { "classmap": [ diff --git a/composer.lock b/composer.lock deleted file mode 100644 index fff05ff..0000000 --- a/composer.lock +++ /dev/null @@ -1,862 +0,0 @@ -{ - "_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", - "This file is @generated automatically" - ], - "content-hash": "96dd6f5669b143afca2e57c563a16624", - "packages": [ - { - "name": "doctrine/inflector", - "version": "v1.1.0", - "source": { - "type": "git", - "url": "https://github.com/doctrine/inflector.git", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/inflector/zipball/90b2128806bfde671b6952ab8bea493942c1fdae", - "reference": "90b2128806bfde671b6952ab8bea493942c1fdae", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "4.*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.1.x-dev" - } - }, - "autoload": { - "psr-0": { - "Doctrine\\Common\\Inflector\\": "lib/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Roman Borschel", - "email": "roman@code-factory.org" - }, - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" - }, - { - "name": "Guilherme Blanco", - "email": "guilhermeblanco@gmail.com" - }, - { - "name": "Jonathan Wage", - "email": "jonwage@gmail.com" - }, - { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com" - } - ], - "description": "Common String Manipulations with regard to casing and singular/plural rules.", - "homepage": "http://www.doctrine-project.org", - "keywords": [ - "inflection", - "pluralize", - "singularize", - "string" - ], - "time": "2015-11-06T14:35:42+00:00" - }, - { - "name": "fzaninotto/faker", - "version": "v1.7.1", - "source": { - "type": "git", - "url": "https://github.com/fzaninotto/Faker.git", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/fzaninotto/Faker/zipball/d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "reference": "d3ed4cc37051c1ca52d22d76b437d14809fc7e0d", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "ext-intl": "*", - "phpunit/phpunit": "^4.0 || ^5.0", - "squizlabs/php_codesniffer": "^1.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "Faker\\": "src/Faker/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "François Zaninotto" - } - ], - "description": "Faker is a PHP library that generates fake data for you.", - "keywords": [ - "data", - "faker", - "fixtures" - ], - "time": "2017-08-15T16:48:10+00:00" - }, - { - "name": "illuminate/container", - "version": "v5.6.21", - "source": { - "type": "git", - "url": "https://github.com/illuminate/container.git", - "reference": "4a42d667a05ec6d31f05b532cdac7e8e68e5ea2a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/container/zipball/4a42d667a05ec6d31f05b532cdac7e8e68e5ea2a", - "reference": "4a42d667a05ec6d31f05b532cdac7e8e68e5ea2a", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.6.*", - "php": "^7.1.3", - "psr/container": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.6-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Container\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Container package.", - "homepage": "https://laravel.com", - "time": "2018-01-21T02:13:38+00:00" - }, - { - "name": "illuminate/contracts", - "version": "v5.6.21", - "source": { - "type": "git", - "url": "https://github.com/illuminate/contracts.git", - "reference": "6a11fbccbc7da16a85fcd1d4b08e51b5658de0d4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/contracts/zipball/6a11fbccbc7da16a85fcd1d4b08e51b5658de0d4", - "reference": "6a11fbccbc7da16a85fcd1d4b08e51b5658de0d4", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "psr/container": "~1.0", - "psr/simple-cache": "~1.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.6-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Contracts\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Contracts package.", - "homepage": "https://laravel.com", - "time": "2018-05-08T13:22:33+00:00" - }, - { - "name": "illuminate/database", - "version": "v5.6.21", - "source": { - "type": "git", - "url": "https://github.com/illuminate/database.git", - "reference": "7ab07d133ece8098b6f5f872ec95d080087236c0" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/database/zipball/7ab07d133ece8098b6f5f872ec95d080087236c0", - "reference": "7ab07d133ece8098b6f5f872ec95d080087236c0", - "shasum": "" - }, - "require": { - "illuminate/container": "5.6.*", - "illuminate/contracts": "5.6.*", - "illuminate/support": "5.6.*", - "php": "^7.1.3" - }, - "suggest": { - "doctrine/dbal": "Required to rename columns and drop SQLite columns (~2.6).", - "fzaninotto/faker": "Required to use the eloquent factory builder (~1.4).", - "illuminate/console": "Required to use the database commands (5.6.*).", - "illuminate/events": "Required to use the observers with Eloquent (5.6.*).", - "illuminate/filesystem": "Required to use the migrations (5.6.*).", - "illuminate/pagination": "Required to paginate the result set (5.6.*)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.6-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Database\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Database package.", - "homepage": "https://laravel.com", - "keywords": [ - "database", - "laravel", - "orm", - "sql" - ], - "time": "2018-05-07T14:20:13+00:00" - }, - { - "name": "illuminate/filesystem", - "version": "v5.6.21", - "source": { - "type": "git", - "url": "https://github.com/illuminate/filesystem.git", - "reference": "a4ca4a9c2f969ec227748ab334693144995ba0ce" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/filesystem/zipball/a4ca4a9c2f969ec227748ab334693144995ba0ce", - "reference": "a4ca4a9c2f969ec227748ab334693144995ba0ce", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.6.*", - "illuminate/support": "5.6.*", - "php": "^7.1.3", - "symfony/finder": "~4.0" - }, - "suggest": { - "league/flysystem": "Required to use the Flysystem local and FTP drivers (~1.0).", - "league/flysystem-aws-s3-v3": "Required to use the Flysystem S3 driver (~1.0).", - "league/flysystem-cached-adapter": "Required to use the Flysystem cache (~1.0).", - "league/flysystem-rackspace": "Required to use the Flysystem Rackspace driver (~1.0).", - "league/flysystem-sftp": "Required to use the Flysystem SFTP driver (~1.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.6-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Filesystem\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Filesystem package.", - "homepage": "https://laravel.com", - "time": "2018-05-02T16:10:37+00:00" - }, - { - "name": "illuminate/pagination", - "version": "v5.6.21", - "source": { - "type": "git", - "url": "https://github.com/illuminate/pagination.git", - "reference": "ee3177bd380ea2be7c0330d8ef8b0ab858be8947" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/pagination/zipball/ee3177bd380ea2be7c0330d8ef8b0ab858be8947", - "reference": "ee3177bd380ea2be7c0330d8ef8b0ab858be8947", - "shasum": "" - }, - "require": { - "illuminate/contracts": "5.6.*", - "illuminate/support": "5.6.*", - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.6-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Pagination\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Pagination package.", - "homepage": "https://laravel.com", - "time": "2018-05-06T14:22:45+00:00" - }, - { - "name": "illuminate/support", - "version": "v5.6.21", - "source": { - "type": "git", - "url": "https://github.com/illuminate/support.git", - "reference": "6e84d4140310246ace38fdb0909da5b2fb22eadf" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/illuminate/support/zipball/6e84d4140310246ace38fdb0909da5b2fb22eadf", - "reference": "6e84d4140310246ace38fdb0909da5b2fb22eadf", - "shasum": "" - }, - "require": { - "doctrine/inflector": "~1.1", - "ext-mbstring": "*", - "illuminate/contracts": "5.6.*", - "nesbot/carbon": "^1.24.1", - "php": "^7.1.3" - }, - "conflict": { - "tightenco/collect": "<5.5.33" - }, - "suggest": { - "illuminate/filesystem": "Required to use the composer class (5.6.*).", - "symfony/process": "Required to use the composer class (~4.0).", - "symfony/var-dumper": "Required to use the dd function (~4.0)." - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.6-dev" - } - }, - "autoload": { - "psr-4": { - "Illuminate\\Support\\": "" - }, - "files": [ - "helpers.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Taylor Otwell", - "email": "taylor@laravel.com" - } - ], - "description": "The Illuminate Support package.", - "homepage": "https://laravel.com", - "time": "2018-05-07T14:12:37+00:00" - }, - { - "name": "laracasts/flash", - "version": "3.0.2", - "source": { - "type": "git", - "url": "https://github.com/laracasts/flash.git", - "reference": "10cd420ab63fd0796bf5e1e5b99f87636d2f4333" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/laracasts/flash/zipball/10cd420ab63fd0796bf5e1e5b99f87636d2f4333", - "reference": "10cd420ab63fd0796bf5e1e5b99f87636d2f4333", - "shasum": "" - }, - "require": { - "illuminate/support": "~5.0", - "php": ">=5.4.0" - }, - "require-dev": { - "mockery/mockery": "dev-master", - "phpunit/phpunit": "^6.1" - }, - "type": "library", - "extra": { - "laravel": { - "providers": [ - "Laracasts\\Flash\\FlashServiceProvider" - ], - "aliases": { - "Flash": "Laracasts\\Flash\\Flash" - } - } - }, - "autoload": { - "psr-0": { - "Laracasts\\Flash": "src/" - }, - "files": [ - "src/Laracasts/Flash/functions.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jeffrey Way", - "email": "jeffrey@laracasts.com" - } - ], - "description": "Easy flash notifications", - "time": "2017-06-22T19:01:19+00:00" - }, - { - "name": "nesbot/carbon", - "version": "1.27.0", - "source": { - "type": "git", - "url": "https://github.com/briannesbitt/Carbon.git", - "reference": "ef81c39b67200dcd7401c24363dcac05ac3a4fe9" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/briannesbitt/Carbon/zipball/ef81c39b67200dcd7401c24363dcac05ac3a4fe9", - "reference": "ef81c39b67200dcd7401c24363dcac05ac3a4fe9", - "shasum": "" - }, - "require": { - "php": ">=5.3.9", - "symfony/translation": "~2.6 || ~3.0 || ~4.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~2", - "phpunit/phpunit": "^4.8.35 || ^5.7" - }, - "type": "library", - "autoload": { - "psr-4": { - "": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Brian Nesbitt", - "email": "brian@nesbot.com", - "homepage": "http://nesbot.com" - } - ], - "description": "A simple API extension for DateTime.", - "homepage": "http://carbon.nesbot.com", - "keywords": [ - "date", - "datetime", - "time" - ], - "time": "2018-04-23T09:02:57+00:00" - }, - { - "name": "psr/container", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/php-fig/container.git", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/container/zipball/b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "reference": "b7ce3b176482dbbc1245ebf52b181af44c2cf55f", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Container\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common Container Interface (PHP FIG PSR-11)", - "homepage": "https://github.com/php-fig/container", - "keywords": [ - "PSR-11", - "container", - "container-interface", - "container-interop", - "psr" - ], - "time": "2017-02-14T16:28:37+00:00" - }, - { - "name": "psr/simple-cache", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/simple-cache.git", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "reference": "408d5eafb83c57f6365a3ca330ff23aa4a5fa39b", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\SimpleCache\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interfaces for simple caching", - "keywords": [ - "cache", - "caching", - "psr", - "psr-16", - "simple-cache" - ], - "time": "2017-10-23T01:57:42+00:00" - }, - { - "name": "symfony/finder", - "version": "v4.0.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/finder.git", - "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/finder/zipball/ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", - "reference": "ca27c02b7a3fef4828c998c2ff9ba7aae1641c49", - "shasum": "" - }, - "require": { - "php": "^7.1.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Finder\\": "" - }, - "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": "Symfony Finder Component", - "homepage": "https://symfony.com", - "time": "2018-04-04T05:10:37+00:00" - }, - { - "name": "symfony/polyfill-mbstring", - "version": "v1.8.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "3296adf6a6454a050679cde90f95350ad604b171" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/3296adf6a6454a050679cde90f95350ad604b171", - "reference": "3296adf6a6454a050679cde90f95350ad604b171", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-mbstring": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.8-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Polyfill\\Mbstring\\": "" - }, - "files": [ - "bootstrap.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for the Mbstring extension", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "mbstring", - "polyfill", - "portable", - "shim" - ], - "time": "2018-04-26T10:06:28+00:00" - }, - { - "name": "symfony/translation", - "version": "v4.0.9", - "source": { - "type": "git", - "url": "https://github.com/symfony/translation.git", - "reference": "ad3abf08eb3450491d8d76513100ef58194cd13e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/translation/zipball/ad3abf08eb3450491d8d76513100ef58194cd13e", - "reference": "ad3abf08eb3450491d8d76513100ef58194cd13e", - "shasum": "" - }, - "require": { - "php": "^7.1.3", - "symfony/polyfill-mbstring": "~1.0" - }, - "conflict": { - "symfony/config": "<3.4", - "symfony/dependency-injection": "<3.4", - "symfony/yaml": "<3.4" - }, - "require-dev": { - "psr/log": "~1.0", - "symfony/config": "~3.4|~4.0", - "symfony/dependency-injection": "~3.4|~4.0", - "symfony/finder": "~2.8|~3.0|~4.0", - "symfony/intl": "~3.4|~4.0", - "symfony/yaml": "~3.4|~4.0" - }, - "suggest": { - "psr/log-implementation": "To use logging capability in translator", - "symfony/config": "", - "symfony/yaml": "" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0-dev" - } - }, - "autoload": { - "psr-4": { - "Symfony\\Component\\Translation\\": "" - }, - "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": "Symfony Translation Component", - "homepage": "https://symfony.com", - "time": "2018-04-30T01:23:47+00:00" - } - ], - "packages-dev": [ - { - "name": "squizlabs/php_codesniffer", - "version": "3.2.3", - "source": { - "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", - "reference": "4842476c434e375f9d3182ff7b89059583aa8b27" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/4842476c434e375f9d3182ff7b89059583aa8b27", - "reference": "4842476c434e375f9d3182ff7b89059583aa8b27", - "shasum": "" - }, - "require": { - "ext-simplexml": "*", - "ext-tokenizer": "*", - "ext-xmlwriter": "*", - "php": ">=5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0" - }, - "bin": [ - "bin/phpcs", - "bin/phpcbf" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Greg Sherwood", - "role": "lead" - } - ], - "description": "PHP_CodeSniffer tokenizes PHP, JavaScript and CSS files and detects violations of a defined set of coding standards.", - "homepage": "http://www.squizlabs.com/php-codesniffer", - "keywords": [ - "phpcs", - "standards" - ], - "time": "2018-02-20T21:35:23+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": [], - "platform-dev": [] -} From e86b23448e5d6ff50d5b0aab03314e8e18b7b12d Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Thu, 10 May 2018 11:35:19 -0500 Subject: [PATCH 02/24] updated bash script to add the service provider manually --- build-test-project.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/build-test-project.sh b/build-test-project.sh index de2a650..8145a5d 100644 --- a/build-test-project.sh +++ b/build-test-project.sh @@ -22,6 +22,7 @@ sed -i '' "s/DB_DATABASE=homestead/DB_DATABASE=$db_database/g" .env sed -i '' "s/DB_USERNAME=homestead/DB_USERNAME=$db_username/g" .env sed -i '' "s/DB_PASSWORD=secret/DB_PASSWORD=$db_password/g" .env sed -i '' "s|// \$this->call(UsersTableSeeder::class);|\$this->call(UsersTableSeeder::class);|" ./database/seeds/DatabaseSeeder.php +sed -i '' "s|Laravel\\Tinker\\TinkerServiceProvider::class,|Laravel\\Tinker\\TinkerServiceProvider::class,\nShowcase\\App\\Providers\\ShowcaseProvider::class,|" ./config/app.php cp ../UsersTableSeeder.php ./database/seeds/ php artisan make:auth composer require brokerexchange/showcase=dev-feature/1.0 From dc64faff453fe4b544afbf0b2928a1f029b22356 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Fri, 11 May 2018 08:46:22 -0500 Subject: [PATCH 03/24] build test project works with 5.4 now --- build-test-project.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/build-test-project.sh b/build-test-project.sh index 8145a5d..cc35ead 100644 --- a/build-test-project.sh +++ b/build-test-project.sh @@ -22,10 +22,17 @@ sed -i '' "s/DB_DATABASE=homestead/DB_DATABASE=$db_database/g" .env sed -i '' "s/DB_USERNAME=homestead/DB_USERNAME=$db_username/g" .env sed -i '' "s/DB_PASSWORD=secret/DB_PASSWORD=$db_password/g" .env sed -i '' "s|// \$this->call(UsersTableSeeder::class);|\$this->call(UsersTableSeeder::class);|" ./database/seeds/DatabaseSeeder.php -sed -i '' "s|Laravel\\Tinker\\TinkerServiceProvider::class,|Laravel\\Tinker\\TinkerServiceProvider::class,\nShowcase\\App\\Providers\\ShowcaseProvider::class,|" ./config/app.php + +sed -i '' 's/Laravel\\Tinker\\TinkerServiceProvider::class,/Laravel\\Tinker\\TinkerServiceProvider::class,\ + Showcase\\App\\Providers\\ShowcaseProvider::class,\ + Laracasts\\Flash\\FlashServiceProvider::class,/' ./config/app.php + cp ../UsersTableSeeder.php ./database/seeds/ -php artisan make:auth composer require brokerexchange/showcase=dev-feature/1.0 +composer dump-autoload +echo "Pre auth" +php artisan make:auth +echo "Post auth" npm install cd .. bash update-test-project.sh --migrations --rundev From fda9d4ab8e4ecc9c580b661da75cf50ea47f6ecc Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Mon, 14 May 2018 15:24:30 -0500 Subject: [PATCH 04/24] added mass assignment for trophies to the display create/edit forms --- .../Http/Controllers/DisplayController.php | 21 ++++++++++++++----- .../views/app/display/create.blade.php | 8 +++++++ .../views/app/display/edit.blade.php | 8 +++++++ 3 files changed, 32 insertions(+), 5 deletions(-) diff --git a/src/app/Http/Controllers/DisplayController.php b/src/app/Http/Controllers/DisplayController.php index b4853fa..a9a00d4 100644 --- a/src/app/Http/Controllers/DisplayController.php +++ b/src/app/Http/Controllers/DisplayController.php @@ -3,6 +3,7 @@ namespace Showcase\App\Http\Controllers; use Showcase\App\Display; +use Showcase\App\Trophy; use Illuminate\Http\Request; use Showcase\App\Http\Requests\DisplayRequest; @@ -25,7 +26,9 @@ public function index() */ public function create() { - return view('showcase::app.display.create'); + $trophies = Trophy::all(); + + return view('showcase::app.display.create', compact('trophies')); } /** @@ -38,9 +41,12 @@ public function store(DisplayRequest $request) { $request->merge(['force_trophy_default' => isset($request->force_trophy_default) ? true : false]); - Display::create($request->all()); + $display = Display::create($request->except('trophies')); - return redirect()->route('displays.index'); + $display->trophies()->detach(); + $display->trophies()->attach($request->trophies); + + return redirect()->route('displays.show', compact('display')); } /** @@ -62,7 +68,9 @@ public function show(Display $display) */ public function edit(Display $display) { - return view('showcase::app.display.edit', compact('display')); + $trophies = Trophy::all(); + + return view('showcase::app.display.edit', compact('display', 'trophies')); } /** @@ -76,7 +84,10 @@ public function update(DisplayRequest $request, Display $display) { $request->merge(['force_trophy_default' => isset($request->force_trophy_default) ? true : false]); - $display->update($request->all()); + $display->update($request->except('trophies')); + + $display->trophies()->detach(); + $display->trophies()->attach($request->trophies); return redirect()->route('displays.show', compact('display')); } diff --git a/src/resources/views/app/display/create.blade.php b/src/resources/views/app/display/create.blade.php index bcc1296..42484a4 100644 --- a/src/resources/views/app/display/create.blade.php +++ b/src/resources/views/app/display/create.blade.php @@ -21,6 +21,14 @@ +
+ + +
diff --git a/src/resources/views/app/display/edit.blade.php b/src/resources/views/app/display/edit.blade.php index 58f67c4..1569fc1 100644 --- a/src/resources/views/app/display/edit.blade.php +++ b/src/resources/views/app/display/edit.blade.php @@ -21,6 +21,14 @@ force_trophy_default ? 'checked' : ''}}> +
+ + +
From 29eef935bb1cc3efcf1e5d8f678e1f3af7d29f24 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Mon, 14 May 2018 15:41:06 -0500 Subject: [PATCH 05/24] fixed broken delete form on admin index pages --- src/resources/views/app/display/index.blade.php | 2 +- src/resources/views/app/trophy/index.blade.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/resources/views/app/display/index.blade.php b/src/resources/views/app/display/index.blade.php index 5ef4765..ae8ca71 100644 --- a/src/resources/views/app/display/index.blade.php +++ b/src/resources/views/app/display/index.blade.php @@ -17,7 +17,7 @@
{{csrf_field()}} - {{method_field('PUT')}} + {{method_field('DELETE')}}
diff --git a/src/resources/views/app/trophy/index.blade.php b/src/resources/views/app/trophy/index.blade.php index 8ce6035..8d56611 100644 --- a/src/resources/views/app/trophy/index.blade.php +++ b/src/resources/views/app/trophy/index.blade.php @@ -17,7 +17,7 @@
{{csrf_field()}} - {{method_field('PUT')}} + {{method_field('DELETE')}}
From 11487d193d9d30fda8e97e07be9512334a3fa4b9 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 10:28:56 -0500 Subject: [PATCH 06/24] added validation for displays and trophies to make sure their template file exists --- .DS_Store | Bin 0 -> 6148 bytes src/app/Http/Requests/DisplayRequest.php | 4 ++-- src/app/Http/Requests/TrophyRequest.php | 2 +- src/app/Providers/ShowcaseProvider.php | 10 ++++++++++ 4 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .DS_Store diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..5008ddfcf53c02e82d7eee2e57c38e5672ef89f6 GIT binary patch literal 6148 zcmeH~Jr2S!425mzP>H1@V-^m;4Wg<&0T*E43hX&L&p$$qDprKhvt+--jT7}7np#A3 zem<@ulZcFPQ@L2!n>{z**++&mCkOWA81W14cNZlEfg7;MkzE(HCqgga^y>{tEnwC%0;vJ&^%eQ zLs35+`xjp>T0 $name, - 'component_view' => 'required|string', - 'default_trophy_component_view' => 'required|string', + 'component_view' => 'required|string|display_exists', + 'default_trophy_component_view' => 'required|string|trophy_exists', 'force_trophy_default' => 'nullable|boolean' ]; } diff --git a/src/app/Http/Requests/TrophyRequest.php b/src/app/Http/Requests/TrophyRequest.php index 126fc22..8e0790d 100644 --- a/src/app/Http/Requests/TrophyRequest.php +++ b/src/app/Http/Requests/TrophyRequest.php @@ -29,7 +29,7 @@ public function rules() return [ 'name' => $name, - 'component_view' => 'string', + 'component_view' => 'string|trophy_exists', 'link' => 'nullable|url', 'image_url' => 'nullable|url', 'description' => 'nullable|string|max:'.config('showcase.description_length', 55) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 930d52c..456f3c9 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -47,6 +47,16 @@ public function boot() return "startComponent(\"showcase::public.components.trophy.\".($showcaseStr), ['trophy' => {$trophy}, 'display' => $displayStr]); ?>renderComponent(); ?>"; }); + Validator::extend('display_exists', function ($attribute, $value, $parameters, $validator) { + return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/display' . $value . '.blade.php') + ?: file_exists('../../resources/views/public/components/display/' . $value . '.blade.php'); + }); + + Validator::extend('trophy_exists', function ($attribute, $value, $parameters, $validator) { + return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/trophy' . $value . '.blade.php') + ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); + }); + if (count(\DB::select(\DB::raw('SHOW TABLES LIKE "' . config('showcase.table_prefix', 'showcase_').'displays"'))) > 0) { $displays = \Showcase\App\Display::with('trophies')->get(); $trophies = \Showcase\App\Trophy::all(); From bcf54609121a425a42ce969138beb247359d04fc Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 10:30:54 -0500 Subject: [PATCH 07/24] forgot to include the validator --- src/app/Providers/ShowcaseProvider.php | 1 + 1 file changed, 1 insertion(+) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 456f3c9..15ef771 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -3,6 +3,7 @@ namespace Showcase\App\Providers; use Illuminate\Support\Facades\Blade; +use Illuminate\Support\Facades\Validator; use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; From 45f867baa7a50150d2d7b7d60f2a93c393fffc9b Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 10:54:38 -0500 Subject: [PATCH 08/24] added error messages for the display and trophy file validators --- src/app/Providers/ShowcaseProvider.php | 1 + src/resources/lang/en/validation.php | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 src/resources/lang/en/validation.php diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 15ef771..c3f338f 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -18,6 +18,7 @@ public function boot() { $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); $this->loadRoutesFrom(__DIR__.'/../../routes.php'); + $this->loadTranslationsFrom(__DIR__.'/../../resources/lang'); $this->loadViewsFrom(__DIR__.'/../../resources/views', 'showcase'); $this->publishes([ diff --git a/src/resources/lang/en/validation.php b/src/resources/lang/en/validation.php new file mode 100644 index 0000000..d28e6d0 --- /dev/null +++ b/src/resources/lang/en/validation.php @@ -0,0 +1,6 @@ + 'The display :attribute component file does not exist.', + 'trophy_exists' => 'The trophy :attribute component file does not exist.', +]; From 0754554a31754052a541e4f45e0ba9e2ee76aaed Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 10:56:04 -0500 Subject: [PATCH 09/24] forgot argument for loadTranslationsFrom --- src/app/Providers/ShowcaseProvider.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index c3f338f..4843bda 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -18,7 +18,7 @@ public function boot() { $this->loadMigrationsFrom(__DIR__.'/../../database/migrations'); $this->loadRoutesFrom(__DIR__.'/../../routes.php'); - $this->loadTranslationsFrom(__DIR__.'/../../resources/lang'); + $this->loadTranslationsFrom(__DIR__.'/../../resources/lang', 'showcase'); $this->loadViewsFrom(__DIR__.'/../../resources/views', 'showcase'); $this->publishes([ From 552fc87b2f24d0fd0d0db2c9f11fc0b4dd414836 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:12:50 -0500 Subject: [PATCH 10/24] added a validator after hook for display and trophy validator extensions --- src/app/Providers/ShowcaseProvider.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 4843bda..d3d2772 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -50,11 +50,17 @@ public function boot() }); Validator::extend('display_exists', function ($attribute, $value, $parameters, $validator) { + $validator->after(function ($validator) { + $validator->messages()->add(['display_exists' => 'The display component file :attribute does not exist.']); + }); return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/display' . $value . '.blade.php') ?: file_exists('../../resources/views/public/components/display/' . $value . '.blade.php'); }); Validator::extend('trophy_exists', function ($attribute, $value, $parameters, $validator) { + $validator->after(function ($validator) { + $validator->messages()->add(['trophy_exists' => 'The trophy component file :attribute does not exist.']); + }); return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/trophy' . $value . '.blade.php') ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); }); From 029687a5b8f45a83093c977f56f15c7bba0c5bbe Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:14:28 -0500 Subject: [PATCH 11/24] fixed validator add syntax error --- src/app/Providers/ShowcaseProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index d3d2772..4c01c47 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -51,7 +51,7 @@ public function boot() Validator::extend('display_exists', function ($attribute, $value, $parameters, $validator) { $validator->after(function ($validator) { - $validator->messages()->add(['display_exists' => 'The display component file :attribute does not exist.']); + $validator->messages()->add('display_exists', 'The display component file :attribute does not exist.'); }); return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/display' . $value . '.blade.php') ?: file_exists('../../resources/views/public/components/display/' . $value . '.blade.php'); @@ -59,7 +59,7 @@ public function boot() Validator::extend('trophy_exists', function ($attribute, $value, $parameters, $validator) { $validator->after(function ($validator) { - $validator->messages()->add(['trophy_exists' => 'The trophy component file :attribute does not exist.']); + $validator->messages()->add('trophy_exists', 'The trophy component file :attribute does not exist.'); }); return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/trophy' . $value . '.blade.php') ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); From 95e45a3f60efc57e0cf43dabf9ad56cc83e09a2d Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:20:25 -0500 Subject: [PATCH 12/24] another update to get custom validation messages working --- src/app/Http/Requests/DisplayRequest.php | 10 ++++++++++ src/app/Http/Requests/TrophyRequest.php | 10 ++++++++++ src/app/Providers/ShowcaseProvider.php | 6 ------ 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/src/app/Http/Requests/DisplayRequest.php b/src/app/Http/Requests/DisplayRequest.php index a061fcb..7a89e78 100644 --- a/src/app/Http/Requests/DisplayRequest.php +++ b/src/app/Http/Requests/DisplayRequest.php @@ -49,4 +49,14 @@ public function withValidator($validator) }); }); } + + /** + * Add custom error messages. + */ + public function messages() + { + return [ + 'display_exists' => 'The display component file :attribute.php does not exist.' + ]; + } } diff --git a/src/app/Http/Requests/TrophyRequest.php b/src/app/Http/Requests/TrophyRequest.php index 8e0790d..a3fcbbc 100644 --- a/src/app/Http/Requests/TrophyRequest.php +++ b/src/app/Http/Requests/TrophyRequest.php @@ -50,4 +50,14 @@ public function withValidator($validator) }); }); } + + /** + * Add custom error messages. + */ + public function messages() + { + return [ + 'trophy_exists' => 'The trophy component file :attribute.php does not exist.' + ]; + } } diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 4c01c47..4843bda 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -50,17 +50,11 @@ public function boot() }); Validator::extend('display_exists', function ($attribute, $value, $parameters, $validator) { - $validator->after(function ($validator) { - $validator->messages()->add('display_exists', 'The display component file :attribute does not exist.'); - }); return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/display' . $value . '.blade.php') ?: file_exists('../../resources/views/public/components/display/' . $value . '.blade.php'); }); Validator::extend('trophy_exists', function ($attribute, $value, $parameters, $validator) { - $validator->after(function ($validator) { - $validator->messages()->add('trophy_exists', 'The trophy component file :attribute does not exist.'); - }); return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/trophy' . $value . '.blade.php') ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); }); From 5c4ad4cd7cde33a4ce0db9f0ad0e09f166a80de5 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:23:16 -0500 Subject: [PATCH 13/24] fixing validation messages --- src/app/Http/Requests/DisplayRequest.php | 3 ++- src/app/Http/Requests/TrophyRequest.php | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/app/Http/Requests/DisplayRequest.php b/src/app/Http/Requests/DisplayRequest.php index 7a89e78..ef773a2 100644 --- a/src/app/Http/Requests/DisplayRequest.php +++ b/src/app/Http/Requests/DisplayRequest.php @@ -56,7 +56,8 @@ public function withValidator($validator) public function messages() { return [ - 'display_exists' => 'The display component file :attribute.php does not exist.' + 'display_exists' => 'The display component file :value.php does not exist.', + 'trophy_exists' => 'The trophy component file :value.php does not exist.' ]; } } diff --git a/src/app/Http/Requests/TrophyRequest.php b/src/app/Http/Requests/TrophyRequest.php index a3fcbbc..a1ba671 100644 --- a/src/app/Http/Requests/TrophyRequest.php +++ b/src/app/Http/Requests/TrophyRequest.php @@ -57,7 +57,7 @@ public function withValidator($validator) public function messages() { return [ - 'trophy_exists' => 'The trophy component file :attribute.php does not exist.' + 'trophy_exists' => 'The trophy component file :value.php does not exist.' ]; } } From 514aba0805b530649eb7f5a988e1bdeac59784ba Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:26:40 -0500 Subject: [PATCH 14/24] added custom validator replacers for display and trophy validation --- src/app/Providers/ShowcaseProvider.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 4843bda..0744319 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -59,6 +59,14 @@ public function boot() ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); }); + Validator::replacer('display_exists', function ($message, $attribute, $rule, $parameters) { + return str_replace(['value'], [$this->data[$attribute]], $message); + }); + + Validator::replacer('trophy_exists', function ($message, $attribute, $rule, $parameters) { + return str_replace(['value'], [$this->data[$attribute]], $message); + }); + if (count(\DB::select(\DB::raw('SHOW TABLES LIKE "' . config('showcase.table_prefix', 'showcase_').'displays"'))) > 0) { $displays = \Showcase\App\Display::with('trophies')->get(); $trophies = \Showcase\App\Trophy::all(); From 8c0a2a7cfb5d11f48e8c5fe9f9f5720acf28a542 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:32:38 -0500 Subject: [PATCH 15/24] fixed errors in validator replacer implementation --- src/app/Http/Requests/DisplayRequest.php | 4 ++-- src/app/Providers/ShowcaseProvider.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/Http/Requests/DisplayRequest.php b/src/app/Http/Requests/DisplayRequest.php index ef773a2..d608fed 100644 --- a/src/app/Http/Requests/DisplayRequest.php +++ b/src/app/Http/Requests/DisplayRequest.php @@ -56,8 +56,8 @@ public function withValidator($validator) public function messages() { return [ - 'display_exists' => 'The display component file :value.php does not exist.', - 'trophy_exists' => 'The trophy component file :value.php does not exist.' + 'display_exists' => 'The display component file ":value.php" does not exist.', + 'trophy_exists' => 'The trophy component file ":value.php" does not exist.' ]; } } diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 0744319..ed5d40e 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -60,11 +60,11 @@ public function boot() }); Validator::replacer('display_exists', function ($message, $attribute, $rule, $parameters) { - return str_replace(['value'], [$this->data[$attribute]], $message); + return str_replace(['value'], [$validator->getData()[$attribute]], $message); }); Validator::replacer('trophy_exists', function ($message, $attribute, $rule, $parameters) { - return str_replace(['value'], [$this->data[$attribute]], $message); + return str_replace(['value'], [$validator->getData()[$attribute]], $message); }); if (count(\DB::select(\DB::raw('SHOW TABLES LIKE "' . config('showcase.table_prefix', 'showcase_').'displays"'))) > 0) { From 7bce37ad6a3e49e441c501efe7e772ff83c9f4a6 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:33:29 -0500 Subject: [PATCH 16/24] fixed previous fix --- src/app/Providers/ShowcaseProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index ed5d40e..bb1b499 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -59,11 +59,11 @@ public function boot() ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); }); - Validator::replacer('display_exists', function ($message, $attribute, $rule, $parameters) { + Validator::replacer('display_exists', function ($message, $attribute, $rule, $parameters, $validator) { return str_replace(['value'], [$validator->getData()[$attribute]], $message); }); - Validator::replacer('trophy_exists', function ($message, $attribute, $rule, $parameters) { + Validator::replacer('trophy_exists', function ($message, $attribute, $rule, $parameters, $validator) { return str_replace(['value'], [$validator->getData()[$attribute]], $message); }); From 2e8dfc093c2752e6e92b2fcec32c3ebfd1303310 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:34:34 -0500 Subject: [PATCH 17/24] tweaked trophy validation string --- src/app/Http/Requests/TrophyRequest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/Http/Requests/TrophyRequest.php b/src/app/Http/Requests/TrophyRequest.php index a1ba671..e8cccd1 100644 --- a/src/app/Http/Requests/TrophyRequest.php +++ b/src/app/Http/Requests/TrophyRequest.php @@ -57,7 +57,7 @@ public function withValidator($validator) public function messages() { return [ - 'trophy_exists' => 'The trophy component file :value.php does not exist.' + 'trophy_exists' => 'The trophy component file ":value.php" does not exist.' ]; } } From cc65d391a77036e4ca2e83d9624751541a0bc66b Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:41:14 -0500 Subject: [PATCH 18/24] fixed validator replacer formatting --- src/app/Providers/ShowcaseProvider.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index bb1b499..9569494 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -60,11 +60,11 @@ public function boot() }); Validator::replacer('display_exists', function ($message, $attribute, $rule, $parameters, $validator) { - return str_replace(['value'], [$validator->getData()[$attribute]], $message); + return str_replace([':value'], [$validator->getData()[$attribute]], $message); }); Validator::replacer('trophy_exists', function ($message, $attribute, $rule, $parameters, $validator) { - return str_replace(['value'], [$validator->getData()[$attribute]], $message); + return str_replace([':value'], [$validator->getData()[$attribute]], $message); }); if (count(\DB::select(\DB::raw('SHOW TABLES LIKE "' . config('showcase.table_prefix', 'showcase_').'displays"'))) > 0) { From 7eaf3f3e2a98af9f9fab520135f55c9481eb05f9 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 11:44:08 -0500 Subject: [PATCH 19/24] updated custom validation messages to use package lang --- src/app/Http/Requests/DisplayRequest.php | 4 ++-- src/app/Http/Requests/TrophyRequest.php | 2 +- src/resources/lang/en/validation.php | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/app/Http/Requests/DisplayRequest.php b/src/app/Http/Requests/DisplayRequest.php index d608fed..b7fa17d 100644 --- a/src/app/Http/Requests/DisplayRequest.php +++ b/src/app/Http/Requests/DisplayRequest.php @@ -56,8 +56,8 @@ public function withValidator($validator) public function messages() { return [ - 'display_exists' => 'The display component file ":value.php" does not exist.', - 'trophy_exists' => 'The trophy component file ":value.php" does not exist.' + 'display_exists' => __('showcase::validation.display_exists'), + 'trophy_exists' => __('showcase::validation.trophy_exists') ]; } } diff --git a/src/app/Http/Requests/TrophyRequest.php b/src/app/Http/Requests/TrophyRequest.php index e8cccd1..4d6c13e 100644 --- a/src/app/Http/Requests/TrophyRequest.php +++ b/src/app/Http/Requests/TrophyRequest.php @@ -57,7 +57,7 @@ public function withValidator($validator) public function messages() { return [ - 'trophy_exists' => 'The trophy component file ":value.php" does not exist.' + 'trophy_exists' => __('showcase::validation.trophy_exists') ]; } } diff --git a/src/resources/lang/en/validation.php b/src/resources/lang/en/validation.php index d28e6d0..6270b5e 100644 --- a/src/resources/lang/en/validation.php +++ b/src/resources/lang/en/validation.php @@ -1,6 +1,6 @@ 'The display :attribute component file does not exist.', - 'trophy_exists' => 'The trophy :attribute component file does not exist.', + 'display_exists' => 'The display component file ":value.blade.php" does not exist.', + 'trophy_exists' => 'The trophy component file ":value.blade.php" does not exist.', ]; From 7e805d7d21235caf4a46c89de3f3ed0808371385 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 13:41:38 -0500 Subject: [PATCH 20/24] abstracting the template file check to an external file --- src/Showcase.php | 19 +++++++++++++++++++ .../Http/Controllers/DisplayController.php | 4 +++- src/app/Providers/ShowcaseProvider.php | 6 ++---- 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/src/Showcase.php b/src/Showcase.php index 284bb7a..a4f3cf7 100644 --- a/src/Showcase.php +++ b/src/Showcase.php @@ -26,4 +26,23 @@ public static function display($display) return $display; } + + /** + * Check to see if a template file exists. + * + * Check to see if a template file exists, either in the vendor path or the + * published user path. + * + * @param string $file + * @param string $type + * @return boolean + */ + public static function templateFileExists($file, $type) + { + if ($type !== 'display' && $type !== 'trophy') { + throw new \Exception("Invalid type ($type)."); + } + return file_exists(base_path() . "resources/views/vendor/showcase/public/components/$type/$value.blade.php") + ?: file_exists("../../resources/views/public/components/$type/$value.blade.php"); + } } \ No newline at end of file diff --git a/src/app/Http/Controllers/DisplayController.php b/src/app/Http/Controllers/DisplayController.php index a9a00d4..354355b 100644 --- a/src/app/Http/Controllers/DisplayController.php +++ b/src/app/Http/Controllers/DisplayController.php @@ -26,7 +26,9 @@ public function index() */ public function create() { - $trophies = Trophy::all(); + $trophies = Trophy::all()->filter(function ($trophy) { + return \Showcase\Showcase::templateFileExists($trophy->component_view, 'trophy'); + }); return view('showcase::app.display.create', compact('trophies')); } diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index 9569494..fb9e731 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -50,13 +50,11 @@ public function boot() }); Validator::extend('display_exists', function ($attribute, $value, $parameters, $validator) { - return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/display' . $value . '.blade.php') - ?: file_exists('../../resources/views/public/components/display/' . $value . '.blade.php'); + return \Showcase\Showcase::templateFileExists($value, 'display'); }); Validator::extend('trophy_exists', function ($attribute, $value, $parameters, $validator) { - return file_exists(base_path() . 'resources/views/vendor/showcase/public/components/trophy' . $value . '.blade.php') - ?: file_exists('../../resources/views/public/components/trophy/' . $value . '.blade.php'); + return \Showcase\Showcase::templatefileExists($value, 'trophy'); }); Validator::replacer('display_exists', function ($message, $attribute, $rule, $parameters, $validator) { From ca82e15c1af777c5d12604c7d507f47f087b1a0c Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 13:43:28 -0500 Subject: [PATCH 21/24] fixed bug from previous commit --- src/Showcase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Showcase.php b/src/Showcase.php index a4f3cf7..78623e7 100644 --- a/src/Showcase.php +++ b/src/Showcase.php @@ -42,7 +42,7 @@ public static function templateFileExists($file, $type) if ($type !== 'display' && $type !== 'trophy') { throw new \Exception("Invalid type ($type)."); } - return file_exists(base_path() . "resources/views/vendor/showcase/public/components/$type/$value.blade.php") - ?: file_exists("../../resources/views/public/components/$type/$value.blade.php"); + return file_exists(base_path() . "resources/views/vendor/showcase/public/components/$type/$file.blade.php") + ?: file_exists("../../resources/views/public/components/$type/$file.blade.php"); } } \ No newline at end of file From 8825426b130e64652d731c2280abb5706fa002ba Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 13:44:58 -0500 Subject: [PATCH 22/24] fixed typoes in the create form for trophies --- src/resources/views/app/trophy/create.blade.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/resources/views/app/trophy/create.blade.php b/src/resources/views/app/trophy/create.blade.php index 0d5ddae..3be3aa6 100644 --- a/src/resources/views/app/trophy/create.blade.php +++ b/src/resources/views/app/trophy/create.blade.php @@ -11,19 +11,19 @@
- +
- +
- +
- +
From 74e4ec546d7b24960941fb82aeb23cbe3f1310d0 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 14:15:29 -0500 Subject: [PATCH 23/24] fixed path check for templateFileExists --- src/Showcase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Showcase.php b/src/Showcase.php index 78623e7..20ea3b6 100644 --- a/src/Showcase.php +++ b/src/Showcase.php @@ -42,7 +42,7 @@ public static function templateFileExists($file, $type) if ($type !== 'display' && $type !== 'trophy') { throw new \Exception("Invalid type ($type)."); } - return file_exists(base_path() . "resources/views/vendor/showcase/public/components/$type/$file.blade.php") - ?: file_exists("../../resources/views/public/components/$type/$file.blade.php"); + return file_exists(base_path() . "/resources/views/vendor/showcase/public/components/$type/$file.blade.php") + ?: file_exists(__DIR__."/resources/views/public/components/$type/$file.blade.php"); } } \ No newline at end of file From 3f67c3e19e786e34fa7114142f324dbba3a395a9 Mon Sep 17 00:00:00 2001 From: Josh Anthony Date: Tue, 15 May 2018 14:33:31 -0500 Subject: [PATCH 24/24] updated display and trophy view includes to filter out entities without an existing template file --- src/app/Http/Controllers/DisplayController.php | 6 ------ src/app/Providers/ShowcaseProvider.php | 8 ++++++-- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/app/Http/Controllers/DisplayController.php b/src/app/Http/Controllers/DisplayController.php index 354355b..774388f 100644 --- a/src/app/Http/Controllers/DisplayController.php +++ b/src/app/Http/Controllers/DisplayController.php @@ -26,10 +26,6 @@ public function index() */ public function create() { - $trophies = Trophy::all()->filter(function ($trophy) { - return \Showcase\Showcase::templateFileExists($trophy->component_view, 'trophy'); - }); - return view('showcase::app.display.create', compact('trophies')); } @@ -70,8 +66,6 @@ public function show(Display $display) */ public function edit(Display $display) { - $trophies = Trophy::all(); - return view('showcase::app.display.edit', compact('display', 'trophies')); } diff --git a/src/app/Providers/ShowcaseProvider.php b/src/app/Providers/ShowcaseProvider.php index fb9e731..a2eb99a 100644 --- a/src/app/Providers/ShowcaseProvider.php +++ b/src/app/Providers/ShowcaseProvider.php @@ -66,8 +66,12 @@ public function boot() }); if (count(\DB::select(\DB::raw('SHOW TABLES LIKE "' . config('showcase.table_prefix', 'showcase_').'displays"'))) > 0) { - $displays = \Showcase\App\Display::with('trophies')->get(); - $trophies = \Showcase\App\Trophy::all(); + $displays = \Showcase\App\Display::with('trophies')->get()->filter(function ($display) { + return \Showcase\Showcase::templateFileExists($display->component_view, 'display'); + }); + $trophies = \Showcase\App\Trophy::all()->filter(function ($trophy) { + return \Showcase\Showcase::templateFileExists($trophy->component_view, 'trophy'); + }); View::share('displays', $displays); View::share('trophies', $trophies); }