Object of class stdClass could not be converted to string (View: C:wamp64wwwApplication 1resourcesviewsadminsoutenancethemeValide.blade.php)

for the past few days I have been blocking part of my code. Indeed I want to retrieve information from my database in order to display them in a table.

web.php

     Route::get('admin/soutenance/themeValide', '[email protected]')->name('admin.soutenance.themeValide');

soutenanceController.php

     public function index()
{
$themes = DB::table('themes')

->join('soutenances', 'themes.id', '<>', 'soutenances.theme_id')
->join('profs', 'profs.id', '=', 'themes.prof_id')
->join('users', 'users.id', '=', 'themes.user_id')
->select('themes.id', 'themes.title', 'profs.name AS prof_name', 'users.name AS user_name')
->where('themes.validated', '=', true)
->get();
// dd($themes);

return view('admin.soutenance.themeValide', compact('themes'));
}

themeValide.blade.php

<div class="box-body">
<div class="table-responsive">
<table class="table no-margin">
<thead>
<tr>
<th> ID </th>
<th> titre </th>
<th> Encadreur </th>
<th> Etudiant </th>
<th> Action </th>
</tr>
</thead>
<tbody>

@forelse($themes as $theme)

<tr>
<td> </td>
<td></td>
<td></td>
<td></td>
<td><span class="tools"><a href=""><i class="fa fa-edit"></i></a>
|
<i class="fa fa-trash-o"></i></span></td>

</tr>
@empty
<tr>
<td></td>
<td> pas de Theme validé </td>
</tr>

@endforelse

</tbody>
</table>
</div>
</div>

when i do in soutenanceController

dd($themes);

I get the desired result but when I want it displayed in my page themeValide.blade.php, it shows me this error

Object of class stdClass could not be converted to string (View: C:wamp64wwwApplication 1resourcesviewsadminsoutenancethemeValide.blade.php)

I would like you to enlighten me, please.

from Newest questions tagged laravel-5 – Stack Overflow https://ift.tt/36mcPNh
via IFTTT

Related Posts

Codeigniter : Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE) in Laravel project

I’m getting following error: **Parse error: syntax error, unexpected ‘const’ (T_CONST), expecting variable (T_VARIABLE)** Note : It’s working in local but facing issue in production server. private…

Firebase receive notification while tab is active or on focus

What i want is to be able to perform an action when a user receives a notification while the browser is open and tab is active or…

Laravel’s alias loader does not find class

We have a legacy project that we cannot update and we need to make some changes in symfony’s Response.php in vendor. We have solved this by copying…

Laravel 5 – generic document management

I have a system where you can create different types of unique documents. For instance, one document is called Project Identified and this expects certain inputs. Originally,…

Laravel Nova limit the results in indexQuery

I ran intro a situation where I need to limit the results of a resource to only 3 results. To be more specific, based on the logged…

Auditoria en laravel 5.8 [closed]

Cómo puedo automatizar el registro de actividades de un usuario en laravel? Si un usuario ingresa a un app de laravel, debo guardar toda su actividas, a…

Leave a Reply

Your email address will not be published.