Created
December 15, 2022 12:05
-
-
Save Tynael/0bd4af6d8f073e8839dac3c8bf2b69eb to your computer and use it in GitHub Desktop.
How to Set Variables in Blade Templates
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
@php | |
$name = 'John'; | |
$last = 'Doe'; | |
@endphp | |
<body> | |
<div> | |
<h1>{{ $name }}</h1> | |
<h1>{{ $last }}</h1> | |
</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example used for https://neutrondev.com/how-to-set-variables-in-blade-templates/