Reputation:
What is this error?
A non-numeric value encountered (View: C:\xampp\htdocs\project\students\resources\views\layouts\header\header.blade.php) (View: C:\xampp\htdocs\project\students\resources\views\layouts\header\header.blade.php)
in my blade
<span clas="username">{{ auth()->user()->firstnames + ' ' + auth()->user()->lastname }}</span>
Upvotes: 0
Views: 2901
Reputation: 659
You are appending string with the addition characters. When using the plus symbol php need numeric input.
You should just use the string concatenations symbol: the dot character:
<span clas="username">{{ auth()->user()->firstnames . ' ' . auth()->user()->lastname }}</span>
Upvotes: 2