user9085794
user9085794

Reputation:

A non-numeric value encountered laravel 5.5

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

Answers (1)

Ghlen
Ghlen

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

Related Questions