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

[10.x] add missing method to message bag class #48348

Merged

Conversation

PH7-Jack
Copy link
Contributor

@PH7-Jack PH7-Jack commented Sep 10, 2023

Hi everyone,

I've introduced a minor enhancement to the MessageBag class by adding the missing method. This change was primarily motivated by the need for a more intuitive code reading and to bring a more descriptive method name that communicates its functionality with clarity.

Changes:

  • Added the missing method in the MessageBag class.

Code Example:

Before

<div @class([
    'success-classes' => !$errors->has('some-key'),
    'error-classes'   =>  $errors->has('some-key'),
])>
    ...
</div>

After

<div @class([
    'success-classes' => $errors->missing('some-key'),
    'error-classes'   => $errors->has('some-key'),
])>
    ...
</div>

Benefits:

  • Promotes easier code reading by providing a self-explanatory method name.
  • The method name is intuitive, reducing potential confusion for developers.

I believe this addition will be of great benefit to the Laravel community and look forward to your feedback.

Thank you for considering this PR.

Feel free to adjust the wording as necessary to match your style and the specific changes you've made!

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.

None yet

2 participants