Coder Social home page Coder Social logo

aire's People

Contributors

adambalint-srg avatar b1nj avatar ben221199 avatar bogdankharchenko avatar dependabot[bot] avatar gummibeer avatar inxilpro avatar joostdebruijn avatar keoghan avatar laytan avatar minthemiddle avatar mohamedsabil83 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aire's Issues

Collection::replaceRecursive does not exist

Describe the bug
I was gonna try Aire for the first time and I couldn't create my first form.

** Have you published the Aire config file? **
No

** Have you added custom Aire views? **
No

To Reproduce
Steps to reproduce the behavior:

  1. Install Aire
  2. Open an Aire form
  3. Try to insert a simple input
  4. See error

Expected behavior
Following the documentation example should give you a simple form instead of an error.

Desktop (please complete the following information):

  • OS: Win10
  • Browser Chrome
  • Latest version

defaultValue does not work with checkbox elements

Describe the bug
If the function defaultValue is called on a checkbox-element, the element's checked-attribute is not set, instead the value attribute receives the provided default value, which does nothing.

Have you published the Aire config file?
Yes

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 8.50.0
  • Aire Version: 2.1

To Reproduce
Steps to reproduce the behavior:

  1. Create a checkbox element with the following code: Aire::checkbox('test', 'test')->defaultValue(true)
  2. Open the view where said element is used
  3. Note that the checkbox is not checked
  4. Inspect the checkbox element with browser's debug-tools
  5. Note that instead the "value" attribute is set to "1"

Expected behavior
If a default value is provided for a checkbox element via defaultValue-method, the checkbox's checked-attribute should be set according to the value provided in said method.
If it is intentional that the defaultValue does not work properly on checkboxes, the documentation should be updated to reflect this and the function removed from the Galahad\Aire\Elements\Checkbox-class.

TypeError: right-hand side of 'in' should be an object, got undefined when validating _token field

Describe the bug
I get this error when adding a form with a validation rule set, i fixed it temporarily by renaming Aire.js to Aire.min.js and changing line 2251 from:
if ('errors' in refs[key] && refs[key].errors[0].childElementCount > 0) {
to:
if (refs[key] && 'errors' in refs[key] && refs[key].errors[0].childElementCount > 0) {
With some logs i saw that it failed on trying to validate the _token field.

Have you published the Aire config file?
No

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: [6.7.0]
  • Aire Version: [1.9.0]

To Reproduce
Steps to reproduce the behavior:

  1. Create a form like
{{ Aire::open()->route('galaleries.store')->rules(['title' => 'required']) }}
    {{ Aire::input('title', 'Titel')->id('title')->autocomplete('off') }}
    {{ Aire::submit('Aanmaken') }}
{{ Aire::close() }}

Expected behavior
The form validates and does not show errors in logs

Support Laravel 7

Aire does not support Laravel 7 yet.

Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - Conclusion: don't install glhd/aire 1.10.0

Add disabled attribute for select options

I think it's necesary to add this:

<option val="1" disabled>Disable Option<option>

Can be something like a function receiving an array with the values that will be disabled:

Aire::select($array,
                    'select', 
                    'Select'
               )
               ->value(1)
               ->disabledOptions([2,3,5]);

Idk it just a suggest. Btw nice work ;)

Extend my custom element

Hello,
Is there a simple way to extend aire for my customs elementst?
Like Google maps lat/lng, mardown wysiwyg, drag and drop upload file...

No error class & message appear when submitting using Livewire

Describe the bug
When submitting a form using Livewire, Aire does not apply error classes and does not show error messages within the associated input's group. It only shows the {{ Aire::summary() }}

Have you published the Aire config file?
Yes

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 8.12
  • Aire Version: 2.4

To Reproduce
Steps to reproduce the behavior:

  1. Create a Livewire component and add validation rules to the component class and a save() method
  2. Add a form to the component view and add to the form setAttribute('wire:submit.prevent', 'save')
  3. Add an input field with setAttribute('wire:model.defer', 'title')
  4. Submit the form without a value in the field

Expected behavior
Expecting an error class in the input group and an error message.

Additional context
When I remove the setAttribute('wire:submit.prevent', 'save') from the form, and handle the request in my Controller, the error class and message work fine.

Bootstrap custom form elements

Can we use Bootstrap custom form elements? Custom file input in particular.

Describe alternatives you've considered
I tried to use the available addClass method to add custom-file-input to the element, but as expected it only hides the input. Is there currently a way to add classes to the group and the label so we can achieve the same effect?

This is the bootstrap sample code for a custom file input:

<div class="custom-file">
  <input type="file" class="custom-file-input" id="customFile">
  <label class="custom-file-label" for="customFile">Choose file</label>
</div>

Resourceful Helper requires open() unlike documented

The documentation on Resourceful Helper on page https://glhd.github.io/aire/api seems to indicate that {{ Aire::resourceful(User::find(1)) }} is an alternative to {{ Aire::open()->route('users.update', 1)->bind(User::find(1))->put() }}.

However, in my case at least, {{ Aire::resourceful($user) }} does not work, while {{ Aire::open()->resourceful($user) }} does work.

It does not work because of error message

Trying to close a form that hasn't been opened.

If I remove the Aire::close(), then the form is closed immediately after _token and _method instead of after my input fields

Have you published the Aire config file?
No

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 6.0.3
  • Aire Version: 1.7.1

Default placeholder to label text

Is your feature request related to a problem? Please describe.
Currently you have to manually set a placeholder for each field. Otherwise there is no placeholder.

Describe the solution you'd like
It would be nice to have a config option to automatically set the label text as the placeholder of a field, when no placeholder is added to a field.

Validation error not displayed because of class="d-none"

Describe the bug
When there is a validation error, it displayed through Aire::summary()->verbose(), and the individual input turns red, and the individual error message is present in the HTML, which is OK, but the error message is not displayed.

This is an example HTML

<div class="d-none" data-aire-component="errors" data-aire-for="name">
  <div>
    The name field is required.
  </div>
</div>

Expected behavior
class="d-none" seems suspect. I would expect something like class="alert alert-warning"

Have you published the Aire config file?
No

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 6.0.3
  • Aire Version: 1.7.1
  • Aire Bootstrap Version: 1.0.0-beta.4

Concise notation for conditional checkbox (based on values from model)?

I want to use a checkbox to toggle the user setting optout.
Right now the only way to show the right status in the UI is with a Blade condition.

Do you know an easier way to always show the right state in Aire (unchecked if $user->optout == 0, checked if $user->optout == 1)?

@if ($user->optout == 1)

{{ Aire::checkbox('optout', 'Opt out')->checked() }}

@else
{{ Aire::checkbox('optout', 'Opt out') }}
@endif

Support for error bags

I have multiple forms on the same page and I'm using Laravel's error bags to store errors in the correct bag. It it doesn't already exist, it'd be great to specify which error bag to use for server validation.

{{ Aire::open()->withErrorBag('updatePassword') }}

Then, errors would be displayed properly.

Image component : nothing on screen with Bootstrap

Hi !
Not really a bug I think but does your Image components work fine ?
I don't find the doc for this, and when I get it a try, don't see anything on screen (with Bootstrap theme).

Is it normal ? Have you some demo of this component ? Does it include image preview for the has-to-be-uploaded image and the old one ?

Thanks !

Binding Precedence is Bound data before Old input when old == ''

Describe the bug
When I edit/update data, and the form data does not pass validation, then the bound data is displayed instead of the old input.

Have you published the Aire config file?
No

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 6.0.3
  • Aire Version: 1.7.1
  • Aire Bootstrap Version: 1.0.0-beta.4

To Reproduce

  1. function edit() in controller returns view containing model data e.g. 1234
  2. user empties the field
  3. user pushes save button
    4 function update() in controller runs $request->validate($this->rules) where rule is required and returns html with validation error
    5 user sees 1234

Expected behavior
user sees his input and the reason why it is not valid: an empty field

Change structure of the field and changing dynamically theme

Would you like to do something like this, would it be possible? any tips?

I would like to change the structure of the field. Add HTML code for example make a checkbox with that code.

<label class="kt-checkbox kt-checkbox--success">
  <input type="checkbox"> Success state
  <span></span>
</label>

image

and if you could switch between themes. For example, on one page use the default theme and another bootstrap or your own theme.

Use the same code for update/create

If I want to use the same blade file for both updating and creating a model I have to write something like this:

Aire::open()->route(isset($role) ? 'role.update' : 'role.store', $role ?? null)->bind($role ?? null)

Is there a cleaner way to do this?
Can we just give it a variable name and let Aire decide if it's set and do the rest accordingly?

Also for things like submit button text:

{{ Aire::submit( isset($role) ? __('app.update_role') : __('app.new_role') ) }}

Method Illuminate\Support\Collection::getOptions does not exist

Describe the bug

Radio Button Group, Checkbox Group or Select (multiple) are lead to error
{{ Aire::open()
            ->route('admin.update.store')
            ->method('POST')
            ->encType('multipart/form-data')
        }}

        {{ Aire::radioGroup([1 => 'One', 2 => 'Two', 3 => 'Three'], 'radio', 'Radio Group')->value(2)}}

        {{ Aire::submit('Создать')
            ->class('my-4 btn-lg btn-block')
        }}

        {{ Aire::close() }}
ErrorException thrown with message "Method Illuminate\Support\Collection::getOptions does not exist. (View: C:\laragon\www\balancestudio\vendor\glhd\aire\views\radio-group.blade.php) (View: C:\laragon\www\balancestudio\vendor\glhd\aire\views\radio-group.blade.php)"

Stacktrace:
#63 ErrorException in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Support\Traits\Macroable.php:104
#62 Illuminate\View\Engines\CompilerEngine:handleViewException in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:45
#61 ErrorException in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Support\Traits\Macroable.php:104
#60 Illuminate\View\Engines\CompilerEngine:handleViewException in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:45
#59 BadMethodCallException in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Support\Traits\Macroable.php:104
#58 Illuminate\Support\Collection:__call in C:\laragon\www\balancestudio\storage\framework\views\2d232951806c49a5e7af302a37db062c5252ee29.php:22
#57 include in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:43
#56 Illuminate\View\Engines\PhpEngine:evaluatePath in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:59
#55 Illuminate\View\Engines\CompilerEngine:get in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\View.php:143
#54 Illuminate\View\View:getContents in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\View.php:126
#53 Illuminate\View\View:renderContents in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\View.php:91
#52 Illuminate\View\View:render in C:\laragon\www\balancestudio\vendor\glhd\aire\src\Aire.php:270
#51 Galahad\Aire\Aire:render in C:\laragon\www\balancestudio\vendor\glhd\aire\src\Elements\Element.php:184
#50 Galahad\Aire\Elements\Element:render in C:\laragon\www\balancestudio\vendor\glhd\aire\src\Elements\Group.php:170
#49 Galahad\Aire\Elements\Group:viewData in C:\laragon\www\balancestudio\vendor\glhd\aire\src\Elements\Element.php:184
#48 Galahad\Aire\Elements\Element:render in C:\laragon\www\balancestudio\vendor\glhd\aire\src\Elements\Element.php:196
#47 Galahad\Aire\Elements\Element:toHtml in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Support\helpers.php:248
#46 e in C:\laragon\www\balancestudio\storage\framework\views\ef0eb5e553649df3a7224626d4c759235049abc7.php:10
#45 include in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Engines\PhpEngine.php:43
#44 Illuminate\View\Engines\PhpEngine:evaluatePath in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Engines\CompilerEngine.php:59
#43 Illuminate\View\Engines\CompilerEngine:get in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\View.php:143
#42 Illuminate\View\View:getContents in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\View.php:126
#41 Illuminate\View\View:renderContents in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\View.php:91
#40 Illuminate\View\View:render in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Http\Response.php:42
#39 Illuminate\Http\Response:setContent in C:\laragon\www\balancestudio\vendor\symfony\http-foundation\Response.php:202
#38 Symfony\Component\HttpFoundation\Response:__construct in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:748
#37 Illuminate\Routing\Router:toResponse in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:720
#36 Illuminate\Routing\Router:prepareResponse in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:680
#35 Illuminate\Routing\Router:Illuminate\Routing\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:130
#34 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Middleware\SubstituteBindings.php:41
#33 Illuminate\Routing\Middleware\SubstituteBindings:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#32 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Auth\Middleware\Authenticate.php:43
#31 Illuminate\Auth\Middleware\Authenticate:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#30 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\VerifyCsrfToken.php:75
#29 Illuminate\Foundation\Http\Middleware\VerifyCsrfToken:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#28 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\View\Middleware\ShareErrorsFromSession.php:49
#27 Illuminate\View\Middleware\ShareErrorsFromSession:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#26 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Session\Middleware\StartSession.php:56
#25 Illuminate\Session\Middleware\StartSession:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#24 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse.php:37
#23 Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#22 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Cookie\Middleware\EncryptCookies.php:66
#21 Illuminate\Cookie\Middleware\EncryptCookies:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#20 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:105
#19 Illuminate\Pipeline\Pipeline:then in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:682
#18 Illuminate\Routing\Router:runRouteWithinStack in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:657
#17 Illuminate\Routing\Router:runRoute in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:623
#16 Illuminate\Routing\Router:dispatchToRoute in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Routing\Router.php:612
#15 Illuminate\Routing\Router:dispatch in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:176
#14 Illuminate\Foundation\Http\Kernel:Illuminate\Foundation\Http\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:130
#13 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:21
#12 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#11 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\TransformsRequest.php:21
#10 Illuminate\Foundation\Http\Middleware\TransformsRequest:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#9 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\ValidatePostSize.php:27
#8 Illuminate\Foundation\Http\Middleware\ValidatePostSize:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#7 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode.php:62
#6 Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#5 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\fideloper\proxy\src\TrustProxies.php:57
#4 Fideloper\Proxy\TrustProxies:handle in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:171
#3 Illuminate\Pipeline\Pipeline:Illuminate\Pipeline\{closure} in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Pipeline\Pipeline.php:105
#2 Illuminate\Pipeline\Pipeline:then in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:151
#1 Illuminate\Foundation\Http\Kernel:sendRequestThroughRouter in C:\laragon\www\balancestudio\vendor\laravel\framework\src\Illuminate\Foundation\Http\Kernel.php:116
#0 Illuminate\Foundation\Http\Kernel:handle in C:\laragon\www\balancestudio\public\index.php:55

Have you published the Aire config file?
Yes

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 6.0
  • Aire Version: 1.7.1

To Reproduce
Steps to reproduce the behavior:
use code above

Document how to enable translations

Is your feature request related to a problem? Please describe.
It is not clear how to enable translation

Describe the solution you'd like
Document that php artisan vendor:publish --tag=aire-translations can be used

Ability to use with livewire

Is your feature request related to a problem? Please describe.
I've started using Livewire and it makes doing more complex operations with blade very nice however I can't see an obvious way to use the wire attributes on aire elements.

Describe the solution you'd like
The ability to chain something like ->wire('click', 'actionName') onto aire elements.

Additional context
I've since forked the package and have so far created a trait to allow this to be added to elements but I'm not sure if it's something that would have a place in the core package.

The inability to override default classes

The way default classes work makes it difficult to customize styling for elements. In our example template, there is a bottom margin on form groups (mb-6). Trying to override that bottom margin via something like...
{!! Aire::submit("I'm unavailable")->groupClass('mb-0') !!}
..does not work, as the mb-6 class takes precedence.

Allow of Custom ID Naming Scheme

Is your feature request related to a problem? Please describe.
Currently aire generates automatic element IDs such as id="__aire-0-street14"

Describe the solution you'd like
Would be cool to override, AutoId trait with custom ID scheme globally -- somewhere in a config or app service provider.

Describe alternatives you've considered
Manually changing ID names via ->id() is painful for many form elements.

how would you add your own component?

now I have this use case where I want an input box next to a select box
they function together

basically time select

e.g.
11:00
in one input (with mask)
and then a select with am / pm

what is the proper way of doing that?

ClientSide validation not working with vue

Describe the bug
Hello, does the client-side validation working with Laravel + Vue?

I am facing the following:

`

Vue warn]: Error compiling template:

Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.

352|  </button>
353|  	
354|  	<script defer="">
   |   ^^^^^^^^^^^^^^^^^
355|  !function(){"use strict";function a(e){if("string"==typeof e){var t=e.indexOf(".");0<t&&t<=6&&(e=e.replace(/\./g,"-"))}var r,i=new Date(e),a=i.getFullYear(),n=i.getMonth(),s=i.getDate(),u=[31,(r=a)%4==0&&r%100!=0||r%400==0?29:28,31,30,31,30,31,31,30,31,30,31];return!(a<1e3)&&(!isNaN(n)&&(!(12<n+1)&&(!isNaN(s)&&!(u[n]<s))))}var r,n={required:function(e){return null!=e&&0<String(e).replace(/\s/g,"").length},required_if:function(e,t,r){return t=this.getParameters(),this.validator._objectPath(this.validator.input,t[0])!==t[1]||this.validator.getRule("required").validate(e)},required_unless:function(e,t,r){return t=this.getParameters(),this.validator._objectPath(this.validator.input,t[0])===t[1]||this.va…
app.js:55466:15
[Vue warn]: Error compiling template:

Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <script>, as they will not be parsed.

357|  </script>
358|  
359|  			<script defer="">
   |     ^^^^^^^^^^^^^^^^^
360|  			document.addEventListener('DOMContentLoaded', function() {
   |  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
361|  				Aire.configure({"templates":{"error":{"prefix":"<li class=\"block mt-1 text-red-500 text-sm font-bold\">","suffix":"<\/li>"}},"classnames":{"none":{"input":"","select":"text-gray-900","textarea":"text-gray-900","group_errors":"hidden","group_help_text":"text-gray-600"},"valid":{"label":"text-green-600","input":"border-green-600 text-green-700","select":"border-green-600 text-green-700","textarea":"border-green-600 text-green-700","group_errors":"hidden","group_help_text":"text-green-600 opacity-50"},"invalid":{"label":"text-red-600","input":"border-red-600 text-red-700","select":"border-red-600 text-red-700","textarea":"border-

`

The problem is probably due to Vue "root" element and I have "App" container inside the body element.

Thank you.

Have you published the Aire config file?
Yes

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: 8.12
  • Aire Version: 2.4

'sometimes' in rule does not work

Describe the bug
A clear and concise description of what the bug is.
Not sure if this a bug or Laravel issue

I have a form for entering an address and have this rule in the Request

public function rules()
{
        return [
            'address_line_1' => 'required|string|max:255',
            'address_line_2' => 'sometimes|required|max:255',
            'city' => 'required|string:max:255',
            'country_id' => 'required|numeric',
        ];
}

now... if address line_2 is empty in the form the validation fails

Have you published the Aire config file?
No

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: [e.g. 8.25.0]
  • Aire Version: [e.g. 2.3.4]

To Reproduce
Steps to reproduce the behavior:

create a form and a request calls with the above rule
Expected behavior
that the form validates if the addess_line_2 is empty and everything else is ok

Additional context
Add any other context about the problem here.

I think the problem is that the data returned from the form is like this:

"address_line_1" => "street name"
  "address_line_2" => null
  "city" => "City"

which means that the 'address_line_2 is present


How to Add asterisk to required fields ?

Describe the bug
can't find a clear way to add red asterisk to input required lables

Have you published the Aire config file?
Yes

Have you added custom Aire views?
Yes

What version does this affect?
"laravel/framework": "^7.24",
"glhd/aire": "^2.3",
"glhd/aire-bootstrap": "^2.0",

To Reproduce
Steps to reproduce the behavior:

  1. Just try to show html asterisks on the required field label ' *'

Expected behavior
A way to enable html on the input labels if needed

Support Lavavel 6.1

When I try to upgrade to Laravel 6.1 I get:

Loading composer repositories with package information                                                                                                                                                             Updating dependencies (including require-dev)         
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - glhd/aire 1.8.0 requires illuminate/view 5.7.*|5.8.*|6.0.* -> satisfiable by laravel/framework[v6.0.4], illuminate/view[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.4, v5.8.8, v5.8.9, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4].
    - glhd/aire 1.8.0 requires illuminate/events 5.7.*|5.8.*|6.0.* -> satisfiable by laravel/framework[v6.0.4], illuminate/events[5.7.17, 5.7.18, 5.7.19, v5.7.0, v5.7.1, v5.7.10, v5.7.11, v5.7.15, v5.7.2, v5.7.20, v5.7.21, v5.7.22, v5.7.23, v5.7.26, v5.7.27, v5.7.28, v5.7.3, v5.7.4, v5.7.5, v5.7.6, v5.7.7, v5.7.8, v5.7.9, v5.8.0, v5.8.11, v5.8.12, v5.8.14, v5.8.15, v5.8.17, v5.8.18, v5.8.19, v5.8.2, v5.8.20, v5.8.22, v5.8.24, v5.8.27, v5.8.28, v5.8.29, v5.8.3, v5.8.30, v5.8.31, v5.8.32, v5.8.33, v5.8.34, v5.8.35, v5.8.4, v5.8.8, v5.8.9, v6.0.0, v6.0.1, v6.0.2, v6.0.3, v6.0.4].
    - Can only install one of: laravel/framework[v6.1.0, v6.0.4].
    - don't install illuminate/events 5.7.17|don't install laravel/framework v6.1.0
    - don't install illuminate/events 5.7.18|don't install laravel/framework v6.1.0
    - don't install illuminate/events 5.7.19|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.0|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.1|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.10|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.11|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.15|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.2|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.20|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.21|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.22|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.23|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.26|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.27|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.28|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.3|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.4|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.5|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.6|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.7|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.8|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.7.9|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.0|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.11|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.12|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.14|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.15|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.17|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.18|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.19|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.2|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.20|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.22|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.24|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.27|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.28|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.29|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.3|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.30|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.31|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.32|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.33|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.34|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.35|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.4|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.8|don't install laravel/framework v6.1.0
    - don't install illuminate/events v5.8.9|don't install laravel/framework v6.1.0
    - don't install illuminate/events v6.0.0|don't install laravel/framework v6.1.0
    - don't install illuminate/events v6.0.1|don't install laravel/framework v6.1.0
    - don't install illuminate/events v6.0.2|don't install laravel/framework v6.1.0
    - don't install illuminate/events v6.0.3|don't install laravel/framework v6.1.0
    - don't install illuminate/events v6.0.4|don't install laravel/framework v6.1.0
    - don't install illuminate/view 5.7.17|don't install laravel/framework v6.1.0
    - don't install illuminate/view 5.7.18|don't install laravel/framework v6.1.0
    - don't install illuminate/view 5.7.19|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.0|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.1|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.10|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.11|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.15|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.2|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.20|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.21|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.22|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.23|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.26|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.27|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.28|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.3|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.4|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.5|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.6|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.7|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.8|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.7.9|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.0|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.11|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.12|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.14|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.15|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.17|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.18|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.19|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.2|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.20|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.22|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.24|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.27|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.28|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.29|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.3|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.30|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.31|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.32|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.33|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.34|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.35|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.4|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.8|don't install laravel/framework v6.1.0
    - don't install illuminate/view v5.8.9|don't install laravel/framework v6.1.0
    - don't install illuminate/view v6.0.0|don't install laravel/framework v6.1.0
    - don't install illuminate/view v6.0.1|don't install laravel/framework v6.1.0
    - don't install illuminate/view v6.0.2|don't install laravel/framework v6.1.0
    - don't install illuminate/view v6.0.3|don't install laravel/framework v6.1.0
    - don't install illuminate/view v6.0.4|don't install laravel/framework v6.1.0
    - Installation request for laravel/framework ^6.1 -> satisfiable by laravel/framework[v6.1.0].
    - Installation request for glhd/aire ^1.8.0 -> satisfiable by glhd/aire[1.8.0].

Validation messages divs have no classes when using Bootstrap

Describe the bug
Hi there, I'm relatively new to Laravel and started using your package to generate forms in my app. I've noticed that when using the Bootstrap templates, the containers of the error messages have an empty class attribute.

This only happens when using the bootstrap template. When removed, classes appear correctly.

Any idea how to fix the issue? I did also try to publish the config file but nothing changed, still no classes.

Have you published the Aire config file?
No

Have you added custom Aire views?
No

To Reproduce
Steps to reproduce the behavior:

  1. Create a form
  2. Add some validation rules
  3. Add the bootstrap template
  4. Submit the form in a way that triggers error messages
  5. Inspect the output via browser's console to see the class attribute empty

Expected behavior
Divs should be populated with classes

default_classes won't owerride classes of element

Hi,

I was trying to change default tailwind classes of an input element in config/aire.php as explained in docs. Unfortunately, class names are only added to default once. I was expecting that these will be replaced by specified in config file.

Config file:

'default_classes' => [
        'input' => 'form-control',
        'select' => 'form-select',
        'textarea' => 'form-control',
 ],

But this is the output:

<input type="text" class="form-control p-2 text-base rounded-sm text-gray-900" data-aire-component="input" name="given_name" id="given_name" data-aire-for="given_name">
  • Laravel Version: 8
  • Aire Version: 2.4.0

Thanks,
Marek

How to add link to checkbox label?

How can I add a link to a checkbox label (see screenshot below)?

{{ Aire::input('checkbox', '<a href="#">Test</a>') }} escapes the HTML, so does it when using ->helpText('<a href>')

grafik

A placeholder for select

Is your feature request related to a problem? Please describe.
No, it's an enhancement request.

Many times we need to add a place holder, a prepend option w/ value, to the normal options list. is it already exist?

Customized button still uses default background color

Describe the bug
When I customize the button, it still applies the default background bg-blue-500

Have you published the Aire config file?
Yes

Have you added custom Aire views?
No

What version does this affect?

  • Laravel Version: v6.0.3
  • Aire Version: 1.8.0

To Reproduce
Steps to reproduce the behavior:

  1. Go to config/aire.php> default classes
  2. Customize `button``
'default_classes' => [
		'button' => 'text-secondary border-2 border-secondary bg-white',
	],

Expected behavior
Only my classes should determine the button layout

Additional context

  • *-secondary has been created in Tailwind correctly.

If this is an issue with the way Aire renders a component, please provide the following additional information:

Screenshots
If applicable, add screenshots to help explain your problem.
image

Desktop (please complete the following information):

  • OS: iOS 10.14.6
  • Browser: Brave 0.68.132 Chromium: 76.0.3809.132

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.