diff --git a/bootstrap/app.php b/bootstrap/app.php old mode 100644 new mode 100755 diff --git a/bootstrap/autoload.php b/bootstrap/autoload.php old mode 100644 new mode 100755 diff --git a/bootstrap/cache/.gitignore b/bootstrap/cache/.gitignore old mode 100644 new mode 100755 diff --git a/composer.json b/composer.json index eadeda1..725eb97 100644 --- a/composer.json +++ b/composer.json @@ -8,7 +8,7 @@ "php": ">=5.6.4", "laravel/browser-kit-testing": "^1.0", "laravel/framework": "5.4.*", - "laravel/tinker": "~1.0" + "luthfi/formfield": "dev-master" }, "require-dev": { "fzaninotto/faker": "~1.4", diff --git a/composer.lock b/composer.lock index fe9d1cc..5469957 100644 --- a/composer.lock +++ b/composer.lock @@ -4,42 +4,9 @@ "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": "84e5d69e0c52b9e0be3312d687b8482e", + "content-hash": "368165fbcebe846c9c2075a5c891d081", "packages": [ { - "name": "dnoegel/php-xdg-base-dir", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/dnoegel/php-xdg-base-dir.git", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/dnoegel/php-xdg-base-dir/zipball/265b8593498b997dc2d31e75b89f053b5cc9621a", - "reference": "265b8593498b997dc2d31e75b89f053b5cc9621a", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "phpunit/phpunit": "@stable" - }, - "type": "project", - "autoload": { - "psr-4": { - "XdgBaseDir\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "implementation of xdg base directory specification for php", - "time": "2014-10-24T07:27:01+00:00" - }, - { "name": "doctrine/inflector", "version": "v1.1.0", "source": { @@ -149,93 +116,6 @@ "time": "2017-03-29T16:04:15+00:00" }, { - "name": "jakub-onderka/php-console-color", - "version": "0.1", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Color.git", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Color/zipball/e0b393dacf7703fc36a4efc3df1435485197e6c1", - "reference": "e0b393dacf7703fc36a4efc3df1435485197e6c1", - "shasum": "" - }, - "require": { - "php": ">=5.3.2" - }, - "require-dev": { - "jakub-onderka/php-code-style": "1.0", - "jakub-onderka/php-parallel-lint": "0.*", - "jakub-onderka/php-var-dump-check": "0.*", - "phpunit/phpunit": "3.7.*", - "squizlabs/php_codesniffer": "1.*" - }, - "type": "library", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleColor": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "jakub.onderka@gmail.com", - "homepage": "http://www.acci.cz" - } - ], - "time": "2014-04-08T15:00:19+00:00" - }, - { - "name": "jakub-onderka/php-console-highlighter", - "version": "v0.3.2", - "source": { - "type": "git", - "url": "https://github.com/JakubOnderka/PHP-Console-Highlighter.git", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/JakubOnderka/PHP-Console-Highlighter/zipball/7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "reference": "7daa75df45242c8d5b75a22c00a201e7954e4fb5", - "shasum": "" - }, - "require": { - "jakub-onderka/php-console-color": "~0.1", - "php": ">=5.3.0" - }, - "require-dev": { - "jakub-onderka/php-code-style": "~1.0", - "jakub-onderka/php-parallel-lint": "~0.5", - "jakub-onderka/php-var-dump-check": "~0.1", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~1.5" - }, - "type": "library", - "autoload": { - "psr-0": { - "JakubOnderka\\PhpConsoleHighlighter": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jakub Onderka", - "email": "acci@acci.cz", - "homepage": "http://www.acci.cz/" - } - ], - "time": "2015-04-20T18:58:01+00:00" - }, - { "name": "laravel/browser-kit-testing", "version": "v1.0.3", "source": { @@ -284,16 +164,16 @@ }, { "name": "laravel/framework", - "version": "v5.4.17", + "version": "v5.4.19", "source": { "type": "git", "url": "https://github.com/laravel/framework.git", - "reference": "f7675d59e3863a58ecdff1a5ee1dcd0cff788f4b" + "reference": "02444b7450350db17a7607c8a52f7268ebdb0dad" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/framework/zipball/f7675d59e3863a58ecdff1a5ee1dcd0cff788f4b", - "reference": "f7675d59e3863a58ecdff1a5ee1dcd0cff788f4b", + "url": "https://api.github.com/repos/laravel/framework/zipball/02444b7450350db17a7607c8a52f7268ebdb0dad", + "reference": "02444b7450350db17a7607c8a52f7268ebdb0dad", "shasum": "" }, "require": { @@ -409,46 +289,43 @@ "framework", "laravel" ], - "time": "2017-04-03T13:07:39+00:00" + "time": "2017-04-16T13:33:34+00:00" }, { - "name": "laravel/tinker", - "version": "v1.0.0", + "name": "laravelcollective/html", + "version": "v5.4.1", "source": { "type": "git", - "url": "https://github.com/laravel/tinker.git", - "reference": "3d5b675b55b24ccbf86395964042dbe061d5a965" + "url": "https://github.com/LaravelCollective/html.git", + "reference": "7570f25d58a00fd6909c0563808590f9cdb14d47" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/laravel/tinker/zipball/3d5b675b55b24ccbf86395964042dbe061d5a965", - "reference": "3d5b675b55b24ccbf86395964042dbe061d5a965", + "url": "https://api.github.com/repos/LaravelCollective/html/zipball/7570f25d58a00fd6909c0563808590f9cdb14d47", + "reference": "7570f25d58a00fd6909c0563808590f9cdb14d47", "shasum": "" }, "require": { - "illuminate/console": "~5.1", - "illuminate/contracts": "~5.1", - "illuminate/support": "~5.1", - "php": ">=5.5.9", - "psy/psysh": "0.7.*|0.8.*", - "symfony/var-dumper": "~3.0" + "illuminate/http": "5.4.*", + "illuminate/routing": "5.4.*", + "illuminate/session": "5.4.*", + "illuminate/support": "5.4.*", + "illuminate/view": "5.4.*", + "php": ">=5.6.4" }, "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "suggest": { - "illuminate/database": "The Illuminate Database package (~5.1)." + "illuminate/database": "5.4.*", + "mockery/mockery": "~0.9.4", + "phpunit/phpunit": "~5.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, "autoload": { "psr-4": { - "Laravel\\Tinker\\": "src/" - } + "Collective\\Html\\": "src/" + }, + "files": [ + "src/helpers.php" + ] }, "notification-url": "https://packagist.org/downloads/", "license": [ @@ -457,17 +334,16 @@ "authors": [ { "name": "Taylor Otwell", - "email": "taylor@laravel.com" + "email": "taylorotwell@gmail.com" + }, + { + "name": "Adam Engebretson", + "email": "adam@laravelcollective.com" } ], - "description": "Powerful REPL for the Laravel framework.", - "keywords": [ - "REPL", - "Tinker", - "laravel", - "psysh" - ], - "time": "2016-12-30T18:13:17+00:00" + "description": "HTML and Form Builders for the Laravel Framework", + "homepage": "http://laravelcollective.com", + "time": "2017-01-26T19:27:05+00:00" }, { "name": "league/flysystem", @@ -553,6 +429,46 @@ "time": "2017-03-22T15:43:14+00:00" }, { + "name": "luthfi/formfield", + "version": "dev-master", + "source": { + "type": "git", + "url": "https://github.com/nafiesl/FormField.git", + "reference": "1042513145c227eaf2325e7be83c8c193e1b3955" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nafiesl/FormField/zipball/1042513145c227eaf2325e7be83c8c193e1b3955", + "reference": "1042513145c227eaf2325e7be83c8c193e1b3955", + "shasum": "" + }, + "require": { + "illuminate/support": "5.3.* || 5.4.*", + "laravelcollective/html": "5.3.* || 5.4.*" + }, + "require-dev": { + "orchestra/testbench": "~3.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Luthfi\\FormField\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nafies Luthfi", + "email": "nafiesl@gmail.com" + } + ], + "description": "Form Field helper class for Laravel 5.3 with Twitter Bootstrap", + "time": "2017-04-18 15:38:34" + }, + { "name": "monolog/monolog", "version": "1.22.1", "source": { @@ -728,57 +644,6 @@ "time": "2017-01-16T07:55:07+00:00" }, { - "name": "nikic/php-parser", - "version": "v3.0.5", - "source": { - "type": "git", - "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/2b9e2f71b722f7c53918ab0c25f7646c2013f17d", - "reference": "2b9e2f71b722f7c53918ab0c25f7646c2013f17d", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "~4.0|~5.0" - }, - "bin": [ - "bin/php-parse" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.0-dev" - } - }, - "autoload": { - "psr-4": { - "PhpParser\\": "lib/PhpParser" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Nikita Popov" - } - ], - "description": "A PHP parser written in PHP", - "keywords": [ - "parser", - "php" - ], - "time": "2017-03-05T18:23:57+00:00" - }, - { "name": "paragonie/random_compat", "version": "v2.0.10", "source": { @@ -874,79 +739,6 @@ "time": "2016-10-10T12:19:37+00:00" }, { - "name": "psy/psysh", - "version": "v0.8.3", - "source": { - "type": "git", - "url": "https://github.com/bobthecow/psysh.git", - "reference": "1dd4bbbc64d71e7ec075ffe82b42d9e096dc8d5e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/bobthecow/psysh/zipball/1dd4bbbc64d71e7ec075ffe82b42d9e096dc8d5e", - "reference": "1dd4bbbc64d71e7ec075ffe82b42d9e096dc8d5e", - "shasum": "" - }, - "require": { - "dnoegel/php-xdg-base-dir": "0.1", - "jakub-onderka/php-console-highlighter": "0.3.*", - "nikic/php-parser": "~1.3|~2.0|~3.0", - "php": ">=5.3.9", - "symfony/console": "~2.3.10|^2.4.2|~3.0", - "symfony/var-dumper": "~2.7|~3.0" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "~1.11", - "hoa/console": "~3.16|~1.14", - "phpunit/phpunit": "~4.4|~5.0", - "symfony/finder": "~2.1|~3.0" - }, - "suggest": { - "ext-pcntl": "Enabling the PCNTL extension makes PsySH a lot happier :)", - "ext-pdo-sqlite": "The doc command requires SQLite to work.", - "ext-posix": "If you have PCNTL, you'll want the POSIX extension as well.", - "ext-readline": "Enables support for arrow-key history navigation, and showing and manipulating command history.", - "hoa/console": "A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit." - }, - "bin": [ - "bin/psysh" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-develop": "0.9.x-dev" - } - }, - "autoload": { - "files": [ - "src/Psy/functions.php" - ], - "psr-4": { - "Psy\\": "src/Psy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Justin Hileman", - "email": "justin@justinhileman.info", - "homepage": "http://justinhileman.com" - } - ], - "description": "An interactive shell for modern PHP.", - "homepage": "http://psysh.org", - "keywords": [ - "REPL", - "console", - "interactive", - "shell" - ], - "time": "2017-03-19T21:40:44+00:00" - }, - { "name": "ramsey/uuid", "version": "3.6.1", "source": { @@ -2119,12 +1911,12 @@ "version": "0.9.9", "source": { "type": "git", - "url": "https://github.com/padraic/mockery.git", + "url": "https://github.com/mockery/mockery.git", "reference": "6fdb61243844dc924071d3404bb23994ea0b6856" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/padraic/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", + "url": "https://api.github.com/repos/mockery/mockery/zipball/6fdb61243844dc924071d3404bb23994ea0b6856", "reference": "6fdb61243844dc924071d3404bb23994ea0b6856", "shasum": "" }, @@ -2181,16 +1973,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.6.0", + "version": "1.6.1", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe" + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/5a5a9fc8025a08d8919be87d6884d5a92520cefe", - "reference": "5a5a9fc8025a08d8919be87d6884d5a92520cefe", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/8e6e04167378abf1ddb4d3522d8755c5fd90d102", + "reference": "8e6e04167378abf1ddb4d3522d8755c5fd90d102", "shasum": "" }, "require": { @@ -2219,7 +2011,7 @@ "object", "object graph" ], - "time": "2017-01-26T22:05:40+00:00" + "time": "2017-04-12T18:52:22+00:00" }, { "name": "phpdocumentor/reflection-common", @@ -3441,7 +3233,9 @@ ], "aliases": [], "minimum-stability": "stable", - "stability-flags": [], + "stability-flags": { + "luthfi/formfield": 20 + }, "prefer-stable": false, "prefer-lowest": false, "platform": { diff --git a/config/app.php b/config/app.php index b162354..3b783f8 100644 --- a/config/app.php +++ b/config/app.php @@ -166,7 +166,7 @@ return [ /* * Package Service Providers... */ - Laravel\Tinker\TinkerServiceProvider::class, + Luthfi\FormField\FormFieldServiceProvider::class, /* * Application Service Providers... @@ -226,6 +226,9 @@ return [ 'Validator' => Illuminate\Support\Facades\Validator::class, 'View' => Illuminate\Support\Facades\View::class, + 'Form' => Collective\Html\FormFacade::class, + 'Html' => Collective\Html\HtmlFacade::class, + 'FormField' => Luthfi\FormField\FormFieldFacade::class, ], ]; diff --git a/resources/views/cart/index.blade.php b/resources/views/cart/index.blade.php index fc238dc..28ca51f 100644 --- a/resources/views/cart/index.blade.php +++ b/resources/views/cart/index.blade.php @@ -66,47 +66,46 @@ @endif - - - - - - - - - - - - - @forelse($draft->items() as $key => $item) - - - - - - - {{-- - - {{ csrf_field() }} {{ method_field('patch') }} - - - - --}} - - - - @empty - @endforelse -
#Nama ItemHarga SatuanQtyDiskonSubtotalAction
{{ $key + 1 }}{{ $item->name }}{{ formatRp($item->price) }}{{ $item->qty }}{{ $item->item_discount }}
{{ formatRp($item->subtotal) }} -
- {{ csrf_field() }} {{ method_field('delete') }} - - -
-
+
+

Items

+ + + + + + + + + + + + + @forelse($draft->items() as $key => $item) + + + + + {!! Form::open(['route' => ['cart.update-draft-item', $draft->draftKey], 'method' => 'patch']) !!} + + + + {!! Form::close() !!} + + + + @empty + @endforelse +
#Nama ItemHarga SatuanQtyDiskonSubtotalAction
{{ $key + 1 }}{{ $item->name }}{{ formatRp($item->price) }}{!! FormField::text('qty', ['value' => $item->qty, 'id' => 'qty-' . $key, 'style' => 'width:50px', 'label' => false]) !!}{{ Form::text('item_discount', $item->item_discount, ['id' => 'item_discount-' . $key]) }}{{ formatRp($item->subtotal) }} +
+ {{ csrf_field() }} {{ method_field('delete') }} + + +
+
+
@endif @endsection \ No newline at end of file diff --git a/tests/Feature/TransactionEntryTest.php b/tests/Feature/TransactionEntryTest.php index e6edbd0..8c0724e 100644 --- a/tests/Feature/TransactionEntryTest.php +++ b/tests/Feature/TransactionEntryTest.php @@ -93,8 +93,8 @@ class TransactionEntryTest extends BrowserKitTestCase $this->assertEquals(800, $draft->getTotal()); $this->see(formatRp(800)); - // $this->seeElement('input', ['id' => 'qty' . 0]); - // $this->seeElement('input', ['id' => 'item_discount-' . 0]); + $this->seeElement('input', ['id' => 'qty-' . 0]); + $this->seeElement('input', ['id' => 'item_discount-' . 0]); $this->seeElement('input', ['id' => 'remove-item-' . 0]); } }