klasss Posted October 3, 2021 at 02:30 PM Report Share #624002 Posted October 3, 2021 at 02:30 PM Olá a todos, Estou com uma pequena dificuldade em mostrar os dados no meu index. index.blade.php <table id="example1" class="table table-bordered table-striped"> <thead> <tr> <th>Fotografia</th> <th>Nome</th> <th>Email</th> <th>Função</th> <th>Data Entrada</th> </tr> </thead> <tbody> @foreach($funcionarios as $funcionario) <tr> <td>{{$funcionario->id}}</td> </tr> @endforeach </tbody> <tfoot> <tr> <th>Fotografia</th> <th>Nome</th> <th>Email</th> <th>Função</th> <th>Data Entrada</th> </tr> </tfoot> </table> FuncionarioController. public function index(){ $tabela = funcionario::orderby('id', 'desc'); return view('painel-admin.utilizadores.index', ['funcionarios' => $tabela]); } Mostra a estrutura da tabela mas os dados não aparecem. Link to comment Share on other sites More sharing options...
Solution bioshock Posted October 4, 2021 at 12:45 PM Solution Report Share #624010 Posted October 4, 2021 at 12:45 PM $tabela = funcionario::orderby('id', 'desc')->get(); Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now