SeriesController.php
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class SeriesController extends Controller
{
public function index()
{
$series = [
'Breaking Bad',
'Prision Break',
'Dexter',
];
return view ('series.index', compact('series'));
}
public function create()
{
return view('series.create');
}
public function store (Request $request)
{
$nome = $request->nome;
$serie = new Serie( );
$serie->nome = $nome;
}
}
create.blade.php
@extends('layout')
@section ('cabecalho')
Adicionar Série
@endsection
@section ('conteudo')
<form method="POST">
@csrf
<div class="form-group">
<label for="nome">Nome</label>
<input type="text" class="form-control" name="nome">
</div>
<button class= "btn btn-primary">Adicionar</button>
</form>
@endsection