Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[9.x] Adds compileReadonly function #42717

Merged
merged 1 commit into from
Jun 9, 2022
Merged

[9.x] Adds compileReadonly function #42717

merged 1 commit into from
Jun 9, 2022

Conversation

mahmoudmohamedramadan
Copy link
Contributor

This PR adds compileReadonly function

@taylorotwell
Copy link
Member

Hmm - I wonder how many more HTML attributes we would possibly add directives for 😨 I'm worried we will get too many.

@DarkGhostHunter
Copy link
Contributor

@if($condition) readonly @endif.

If there is minimal keystrokes saved without tackling verbosity, I reject.

At this point, I think is just better to create a package to handle forms separately.

@mahmoudmohamedramadan
Copy link
Contributor Author

@taylorotwell maybe you are right but actually, not all HTML attributes will be rendered to directives because the attributes that must be rendered must have a common use like @readonly which is similar to @disabled it's common to check about something to apply these attributes So, it'll be nice to render these attributes to directives in Laravel because Laravel tries to make everything awesome and easier.

@mahmoudmohamedramadan
Copy link
Contributor Author

@DarkGhostHunter the same thing can be applied to @disabled and @selected because we can use @if($condition) disabled @endif also the same thing with @selected but I see that it'll be nice if we use minimal keystrokes to handle these scenarios.

@taylorotwell taylorotwell merged commit c1bb5ed into laravel:9.x Jun 9, 2022
@taylorotwell
Copy link
Member

I looked over the attributes - looks like there isn't much of anything remaining after this.

@mahmoudmohamedramadan mahmoudmohamedramadan changed the title Adds compileReadonly function [9.x] Adds compileReadonly function Jun 10, 2022
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