How do I send a bank appointment to a View in the Laravel?

Asked

Viewed 228 times

0

I have a model (table)called Member. I want to do the id count that exists in the bank. I have well managed to do it with Member::Count(?id'). It returns me all pretty the total id that I have on the table. More when I play in the view it gives an error: Saying I’m trying to get property and not object Trying to get Property of non-object How I make an appointment and send her to View?

Error: Erro que da quando eu mando a consulta para a view

Controller
 public function create()
{
   
    $membro = new Membro();
    $ficha = $membro->countID();
    $data = array(
        'titulo'        =>  'Lista de membros',
        'localizador'   =>  'Listagem de membro',
        'info'          =>  'Listas de Membros',
        'avatar'        =>  Auth()->user(), 
        'ficha'         =>  $ficha,       
              
    );


    
    return view('dashboard.cadastroMembros.create', $data);
  • The code of the control?

  • I edited the code

  • Add the view. To find where it cannot retrieve information

  • membro->count() change this in the code in your controller.

  • this model now worked out vlw man obg

1 answer

1


Try to make:

return view('dashboard.cadastroMembros.create', compact('data'));

And when printing in the view something like {{ $data['title'] }}

Browser other questions tagged

You are not signed in. Login or sign up in order to post.