diff --git a/composer.json b/composer.json index 495b7ab0..cc3b2b18 100644 --- a/composer.json +++ b/composer.json @@ -15,8 +15,8 @@ "illuminate/validation": "5.*@dev" }, "require-dev": { - "phpunit/phpunit": "~4.0", - "orchestra/testbench": "~3.0" + "phpunit/phpunit": "~5.0", + "orchestra/testbench": "~3.4" }, "extra": { "branch-alias": { diff --git a/src/Kris/LaravelFormBuilder/Form.php b/src/Kris/LaravelFormBuilder/Form.php index bd53be24..f3a5df9d 100644 --- a/src/Kris/LaravelFormBuilder/Form.php +++ b/src/Kris/LaravelFormBuilder/Form.php @@ -3,7 +3,7 @@ use Illuminate\Contracts\Events\Dispatcher as EventDispatcher; use Illuminate\Contracts\Validation\Factory as ValidatorFactory; use Illuminate\Contracts\Validation\Validator; -use Illuminate\Http\Exception\HttpResponseException; +use Illuminate\Http\Exceptions\HttpResponseException; use Illuminate\Http\Request; use Illuminate\Support\Arr; use Kris\LaravelFormBuilder\Events\AfterFieldCreation; diff --git a/src/Kris/LaravelFormBuilder/FormBuilderServiceProvider.php b/src/Kris/LaravelFormBuilder/FormBuilderServiceProvider.php index 5770ac2c..8a77c1fa 100644 --- a/src/Kris/LaravelFormBuilder/FormBuilderServiceProvider.php +++ b/src/Kris/LaravelFormBuilder/FormBuilderServiceProvider.php @@ -89,7 +89,10 @@ private function registerFormIfHeeded() // LaravelCollective\HtmlBuilder 5.2 is not backward compatible and will throw an exception $version = substr(Application::VERSION, 0, 3); - if (str_is('5.0', $version) || str_is('5.1', $version)) { + if(str_is('5.4', $version)) { + $form = new LaravelForm($app[ 'html' ], $app[ 'url' ], $app[ 'view' ], $app[ 'session.store' ]->token()); + } + else if (str_is('5.0', $version) || str_is('5.1', $version)) { $form = new LaravelForm($app[ 'html' ], $app[ 'url' ], $app[ 'session.store' ]->getToken()); } else { diff --git a/src/Kris/LaravelFormBuilder/FormHelper.php b/src/Kris/LaravelFormBuilder/FormHelper.php index 264d720b..3598690a 100644 --- a/src/Kris/LaravelFormBuilder/FormHelper.php +++ b/src/Kris/LaravelFormBuilder/FormHelper.php @@ -7,7 +7,7 @@ use Illuminate\Support\Collection; use Kris\LaravelFormBuilder\Fields\FormField; use Kris\LaravelFormBuilder\Form; -use Symfony\Component\Translation\TranslatorInterface; +use Illuminate\Translation\Translator; class FormHelper { @@ -87,10 +87,10 @@ class FormHelper /** * @param View $view - * @param TranslatorInterface $translator + * @param Translator $translator * @param array $config */ - public function __construct(View $view, TranslatorInterface $translator, array $config = []) + public function __construct(View $view, Translator $translator, array $config = []) { $this->view = $view; $this->translator = $translator; diff --git a/tests/Fields/CollectionTypeTest.php b/tests/Fields/CollectionTypeTest.php index c0f33d28..21e360cd 100644 --- a/tests/Fields/CollectionTypeTest.php +++ b/tests/Fields/CollectionTypeTest.php @@ -4,9 +4,12 @@ use Kris\LaravelFormBuilder\Fields\CollectionType; use Kris\LaravelFormBuilder\Fields\SelectType; use Kris\LaravelFormBuilder\Form; +use Illuminate\Foundation\Testing\Concerns\InteractsWithSession; class CollectionTypeTest extends FormBuilderTestCase { + use InteractsWithSession; + /** @test */ public function it_creates_collection() { diff --git a/tests/FormBuilderTestCase.php b/tests/FormBuilderTestCase.php index d992098f..e4e52348 100644 --- a/tests/FormBuilderTestCase.php +++ b/tests/FormBuilderTestCase.php @@ -77,7 +77,7 @@ public function setUp() $this->view = $this->app['view']; $this->translator = $this->app['translator']; $this->request = $this->app['request']; - $this->request->setSession($this->app['session.store']); + $this->request->setLaravelSession($this->app['session.store']); $this->validatorFactory = $this->app['validator']; $this->eventDispatcher = $this->app['events']; $this->model = new TestModel(); diff --git a/tests/FormTest.php b/tests/FormTest.php index a44ee2dc..7214099d 100644 --- a/tests/FormTest.php +++ b/tests/FormTest.php @@ -1,6 +1,6 @@