Skip to content

[9.x] Adds compileReadonly function#42717

Merged
taylorotwell merged 1 commit into
laravel:9.xfrom
mahmoudmohamedramadan:9.x
Jun 9, 2022
Merged

[9.x] Adds compileReadonly function#42717
taylorotwell merged 1 commit into
laravel:9.xfrom
mahmoudmohamedramadan:9.x

Conversation

@mahmoudmohamedramadan
Copy link
Copy Markdown
Contributor

This PR adds compileReadonly function

@taylorotwell
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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