oxbir
3 weeks ago
122
3
Laravel

Object of class App\SocialNetwork could not be converted to int

Posted 3 weeks ago by oxbir

I added in social_user and I want to show it with ajax.

'<select id="social_id" name="social_id[]" class="form-control">\n' +
'@foreach($socials as $social)\n'+
'<option value="{{ $social->id }}" {{ ($socialNetwork == $social->id) ? 'selected': ''}}>\n'+
'{{ $social->name }}\n' +
'</option>\n' +
'@endforeach\n ' +
'</select>\n' +

I see this error.

Object of class App\SocialNetwork could not be converted to int

table

You can see in the picture that I added two. 2 and 5. But I show both IDs number 2.

Please sign in or create an account to participate in this conversation.