@@ -75,7 +75,7 @@ |
||
| 75 | 75 | if ($field->getType() == 'form') |
| 76 | 76 | {
|
| 77 | 77 | |
| 78 | - $validation = Validator::make($this->formHelper->getRequest()->get($field->getName(),[]), $field->getClass()->getRules()); |
|
| 78 | + $validation = Validator::make($this->formHelper->getRequest()->get($field->getName(), []), $field->getClass()->getRules()); |
|
| 79 | 79 | |
| 80 | 80 | if ($validation->fails()) |
| 81 | 81 | {
|
@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(empty($formOptions['url'])){ |
|
| 3 | +if (empty($formOptions['url'])) { |
|
| 4 | 4 | $formOptions['url'] = config('app.url').'/'.request()->path(); |
| 5 | 5 | } |
| 6 | 6 | |
@@ -86,6 +86,9 @@ |
||
| 86 | 86 | $this->registerAliasIfNotExists('Redirect', \Illuminate\Support\Facades\Redirect::class); |
| 87 | 87 | } |
| 88 | 88 | |
| 89 | + /** |
|
| 90 | + * @param string $alias |
|
| 91 | + */ |
|
| 89 | 92 | private function registerAliasIfNotExists($alias, $class) |
| 90 | 93 | { |
| 91 | 94 | if (! array_key_exists($alias, AliasLoader::getInstance()->getAliases())) { |
@@ -15,13 +15,13 @@ discard block |
||
| 15 | 15 | { |
| 16 | 16 | parent::boot(); |
| 17 | 17 | |
| 18 | - $this->loadViewsFrom(__DIR__ . '/../../views', 'form-builder'); |
|
| 19 | - $this->loadTranslationsFrom(__DIR__ . '/../../lang', 'form-builder'); |
|
| 18 | + $this->loadViewsFrom(__DIR__.'/../../views', 'form-builder'); |
|
| 19 | + $this->loadTranslationsFrom(__DIR__.'/../../lang', 'form-builder'); |
|
| 20 | 20 | |
| 21 | - $this->publishes([__DIR__ . '/../../config/config.php' => config_path('form-builder.php')]); |
|
| 22 | - $this->publishes([__DIR__ . '/../../views' => base_path('resources/views/vendor/form-builder')], 'views'); |
|
| 21 | + $this->publishes([__DIR__.'/../../config/config.php' => config_path('form-builder.php')]); |
|
| 22 | + $this->publishes([__DIR__.'/../../views' => base_path('resources/views/vendor/form-builder')], 'views'); |
|
| 23 | 23 | |
| 24 | - $this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'form-builder'); |
|
| 24 | + $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'form-builder'); |
|
| 25 | 25 | } |
| 26 | 26 | |
| 27 | 27 | public function register() |
@@ -31,11 +31,11 @@ discard block |
||
| 31 | 31 | $this->registerHtmlIfNeeded(); |
| 32 | 32 | $this->registerFormIfHeeded(); |
| 33 | 33 | |
| 34 | - $this->mergeConfigFrom(__DIR__ . '/../../config/config.php', 'laravel-form-builder'); |
|
| 34 | + $this->mergeConfigFrom(__DIR__.'/../../config/config.php', 'laravel-form-builder'); |
|
| 35 | 35 | |
| 36 | 36 | $this->registerFormHelper(); |
| 37 | 37 | |
| 38 | - $this->app->singleton('laravel-form-builder', function ($app) { |
|
| 38 | + $this->app->singleton('laravel-form-builder', function($app) { |
|
| 39 | 39 | return new FormBuilder($app, $app['laravel-form-helper']); |
| 40 | 40 | }); |
| 41 | 41 | |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | protected function registerFormHelper() |
| 48 | 48 | { |
| 49 | - $this->app->singleton('laravel-form-helper', function ($app) { |
|
| 49 | + $this->app->singleton('laravel-form-helper', function($app) { |
|
| 50 | 50 | $config = $app['config']->get('form-builder'); |
| 51 | 51 | return new FormHelper($app['view'], $app['request'], $config); |
| 52 | 52 | }); |
@@ -56,8 +56,8 @@ discard block |
||
| 56 | 56 | |
| 57 | 57 | private function registerHtmlIfNeeded() |
| 58 | 58 | { |
| 59 | - if (! $this->app->offsetExists('html')) { |
|
| 60 | - $this->app->singleton('html', function ($app) { |
|
| 59 | + if (!$this->app->offsetExists('html')) { |
|
| 60 | + $this->app->singleton('html', function($app) { |
|
| 61 | 61 | return new LaravelHtml($app['url'], $app['view']); |
| 62 | 62 | }); |
| 63 | 63 | |
@@ -67,8 +67,8 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | private function registerFormIfHeeded() |
| 69 | 69 | { |
| 70 | - if (! $this->app->offsetExists('form')) { |
|
| 71 | - $this->app->singleton('form', function ($app) { |
|
| 70 | + if (!$this->app->offsetExists('form')) { |
|
| 71 | + $this->app->singleton('form', function($app) { |
|
| 72 | 72 | $form = new LaravelForm($app['html'], $app['url'], $app['view'], $app['session.store']->getToken()); |
| 73 | 73 | return $form->setSessionStore($app['session.store']); |
| 74 | 74 | }); |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | private function registerAliasIfNotExists($alias, $class) |
| 90 | 90 | { |
| 91 | - if (! array_key_exists($alias, AliasLoader::getInstance()->getAliases())) { |
|
| 91 | + if (!array_key_exists($alias, AliasLoader::getInstance()->getAliases())) { |
|
| 92 | 92 | AliasLoader::getInstance()->alias($alias, $class); |
| 93 | 93 | } |
| 94 | 94 | } |
@@ -14,7 +14,7 @@ discard block |
||
| 14 | 14 | @if ($showField) |
| 15 | 15 | @if (isset($noEdit) and $noEdit === true) |
| 16 | 16 | <?php |
| 17 | - if (! empty($options['default_value'])) { |
|
| 17 | + if (!empty($options['default_value'])) { |
|
| 18 | 18 | $options['default_value'] = is_string($options['default_value']) ? explode(',', $options['default_value']) : $options['default_value']; |
| 19 | 19 | } |
| 20 | 20 | ?> |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | @endforeach |
| 25 | 25 | @endif |
| 26 | 26 | @else |
| 27 | - <?php $options['class'] = isset($options['class']) ? $options['class'] . ' tags ' : ' tags '; ?> |
|
| 27 | + <?php $options['class'] = isset($options['class']) ? $options['class'].' tags ' : ' tags '; ?> |
|
| 28 | 28 | {!! Form::input($type, $name, $options['default_value'], $options['attr']) !!} |
| 29 | 29 | @endif |
| 30 | 30 | @endif |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | @endif |
| 11 | 11 | |
| 12 | 12 | <div class="col-md-8"> |
| 13 | - <?php $options['attr']['class'] .= ' ' . $id; ?> |
|
| 13 | + <?php $options['attr']['class'] .= ' '.$id; ?> |
|
| 14 | 14 | @if ($showField) |
| 15 | 15 | @if (isset($noEdit) && ($noEdit === true)) |
| 16 | 16 | {!! $options['default_value'] !!}
|