Laravel table pivot
Fermé
anthonyr_25
Messages postés
165
Date d'inscription
mercredi 5 janvier 2022
Statut
Membre
Dernière intervention
6 juillet 2022
-
Modifié le 1 juil. 2022 à 11:44
anthonyr_25 Messages postés 165 Date d'inscription mercredi 5 janvier 2022 Statut Membre Dernière intervention 6 juillet 2022 - 6 juil. 2022 à 13:59
anthonyr_25 Messages postés 165 Date d'inscription mercredi 5 janvier 2022 Statut Membre Dernière intervention 6 juillet 2022 - 6 juil. 2022 à 13:59
A voir également:
- Pivot laravel
- Table pivot excel - Guide
- C'Pivot - Télécharger - Comptabilité & Facturation
- Power pivot libreoffice - Guide
- Annuler une boucle en modifiant variable $pivot ✓ - Forum PowerShell
- Cannot access offset of type string on string laravel - Forum PHP
1 réponse
anthonyr_25
Messages postés
165
Date d'inscription
mercredi 5 janvier 2022
Statut
Membre
Dernière intervention
6 juillet 2022
6
1 juil. 2022 à 16:22
1 juil. 2022 à 16:22
j'ai modifier un peu ma function dans mon controller :
et j'ai modifier mon blade :
Il me sort l'erreur suivante :
Attempt to read property "name" on null
public function index() { $inflows = Inflow::with('category', 'user')->get(); $categories = Category::get(); return view('stage.inflow', compact('inflows', 'categories')); }
et j'ai modifier mon blade :
@foreach ($inflows as $inflow) <tr class="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> <th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap"> {{ $inflow->user->name }} </th> <td class="px-6 py-4"> {{ Str::limit($inflow->name, 25) }} </td> <td class="px-6 py-4"> {{ $inflow->created_at }} </td> <td class="px-6 py-4"> {{ $inflow->value }} </td> <td class="px-6 py-4"> {{ $inflow->category->name }} </td> <td class="px-6 py-4 text-right"> <a href="#" class="font-medium text-blue-600 dark:text-blue-500 hover:underline">Edit</a> </td> </tr> @endforeach
Il me sort l'erreur suivante :
Attempt to read property "name" on null
6 juil. 2022 à 13:59