Skip to content

Commit

Permalink
Lista de conceitos ok
Browse files Browse the repository at this point in the history
  • Loading branch information
diegolinkk committed May 25, 2022
1 parent d5fb88f commit 716f60e
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
9 changes: 8 additions & 1 deletion app/Http/Controllers/ConceitoController.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,14 @@ public function cadastro(Request $request)
$conceito->pontos = 0;
$conceito->save();


return back();
}

public function listar()
{
$conceitos = Conceito::all();
return view('conceito/index',[
'conceitos' => $conceitos,
]);
}
}
13 changes: 13 additions & 0 deletions resources/views/conceito/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@extends('template')

@section('titulo')
Lista de conceitos
@endsection

@section('conteudo')
<ul>
@foreach($conceitos as $conceito)
<li> {{$conceito->nome}} </li>
@endforeach
</ul>
@endsection
4 changes: 4 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@

//agrupando por controller
Route::controller(ConceitoController::class)->group(function(){

Route::get('/conceito/index','listar')->name('listar_conceitos');
Route::get('/conceito/','listar');

Route::get('/conceito/cadastro','cadastro_form')->name('cadastro_de_conceito');
Route::post('/conceito/cadastro','cadastro');
});
Expand Down

0 comments on commit 716f60e

Please sign in to comment.