Skip to content

Conversation

owuraku-zenas
Copy link

@owuraku-zenas owuraku-zenas commented Oct 18, 2023

Summary:
This PR aims to rectify a documentation issue in the Laravel BootCamp by correcting the usage of the AuthenticatedLayout component. The current documentation suggests using <AuthenticatedLayout user={auth.user}>, which is incorrect, as the 'user' property should be accessed via the 'auth' prop.

Details:
The documentation for the Laravel BootCamp currently includes an incorrect usage of the AuthenticatedLayout component, which might cause confusion for learners. It suggests the following code:

<AuthenticatedLayout user={auth.user}>

However, in the AuthenticatedLayout component, the 'user' property is not directly accessible from the 'auth' prop. To ensure clarity and accuracy in the documentation, this PR proposes the following modification:

Before:

<AuthenticatedLayout user={auth.user}>

image

After:

<AuthenticatedLayout auth={auth}>

image

This change accurately reflects the structure of the 'auth' prop and ensures that learners are provided with the correct information.

Testing:
To verify the correctness of this documentation update, I have tested the modified code snippet in the Laravel BootCamp environment to ensure it works as expected. Additionally, I've reviewed the documentation to confirm that no other parts are affected by this change.

Closing Notes:
This update aligns the documentation with the intended usage of the AuthenticatedLayout component and improves the overall learning experience for BootCamp participants.

Checklist:

  • Documentation update.
  • Testing conducted.
  • Reviewed for consistency and accuracy.
  • No other affected areas in the documentation.

The AuthenticatedLayout has has prop auth not user.
It uses the auth prop not the user
@jessarcher
Copy link
Member

Hi @owuraku-zenas,

The prop in AuthenticatedLayout is user, not auth. See https://github.com/laravel/breeze/blob/7a3b70e7deecb426ead63763d3d6b8700e3c3c56/stubs/inertia-react/resources/js/Layouts/AuthenticatedLayout.jsx#L8. It was previously auth, but changed to user back in March.

Not sure why this wouldn't work for you - what does AuthenticatedLayout.jsx look like in your project and what version of Breeze did you install?

@owuraku-zenas
Copy link
Author

owuraku-zenas commented Oct 18, 2023

"laravel/breeze": "^1.19"

export default function Authenticated({ auth, header, children }) {
    const [showingNavigationDropdown, setShowingNavigationDropdown] = useState(false);
}

Does this mean I am using an older version?

@jessarcher
Copy link
Member

"laravel/breeze": "^1.19"

That is a constraint - what is the actual version installed? You can check this using composer show laravel/breeze.

@owuraku-zenas
Copy link
Author

"laravel/breeze": "^1.19"

That is a constraint - what is the actual version installed? You can check this using composer show laravel/breeze.

v1.19.2

@jessarcher
Copy link
Member

Does this mean I am using an older version?

Yes. What version of PHP are you using? The current version requires PHP 8.1 or greater.

@owuraku-zenas
Copy link
Author

owuraku-zenas commented Oct 18, 2023

You are right. PHP version is 8.0.28

@jessarcher
Copy link
Member

I'd recommend updating - PHP 8.0 is no longer actively supported: https://www.php.net/supported-versions.php.

All the best!

@jessarcher jessarcher closed this Oct 18, 2023
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.

2 participants