Skip to content

[9.x] Add disabled directive#40900

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
belzaaron:feature/disabled-directive
Feb 10, 2022
Merged

[9.x] Add disabled directive#40900
taylorotwell merged 1 commit into
laravel:9.xfrom
belzaaron:feature/disabled-directive

Conversation

@belzaaron

@belzaaron belzaaron commented Feb 9, 2022

Copy link
Copy Markdown
Contributor

This PR provides the use of the common HTML directive disabled through a shorthand syntax via a Blade directive. Allowing developers to have a more enjoyable method of disabling a button, for example, could improve the smooth flow that we Laravel developers are consistently being treated too. Simple yet, effective.

<button type="submit" @disabled($errors->isNotEmpty())>Submit</button>

Editing for documentation PR: laravel/docs#7690

@belzaaron belzaaron changed the title [9.x] Added disabled directive [9.x] Add disabled directive Feb 9, 2022
@bogdankharchenko

bogdankharchenko commented Feb 10, 2022

Copy link
Copy Markdown
Contributor

I feel like I've been seeing a few of these new form related blade helpers -- but sometimes I wonder is this ultimately becoming a form builder?

I'm not strongly opposed to this but I wonder if we need these additional blade helpers... @readonly next week?

This is a form builder for example, which uses components/functions to define the form structure in an elegant way instead - maybe this is the solution for some people and it could perhaps could prevent a dozen more PR's for form related directives.
https://github.com/glhd/aire#blade-components

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants