I'm using Laravel 5.5. I wanted to store my data in the DB, but when i try to do it - nothing is happening. Here is my MarketController code
public function store(Request $request)
{
$this->validate($request, [
'name' => 'required|unique:markets|max:255',
'website' => 'required',
'city' => 'required',
]);
Market::create($request->all());
return redirect('markets');
}
My save.blade.php code
<!DOCTYPE html>
<html>
<head>
<title>Create Market</title>
</head>
<body>
@extends('layouts.app')
@section('main')
<form action="" method="post">
<input type="hidden" name="_token" value="DaBSErIRWPPI">
<label for="name">Name</label>
<input type="text" name="name" id="name">
<label for="city">Location</label>
<input type="text" name="city" id="city">
<label for="website">Market's website</label>
<input type="text" name="website" id="website">
<button type="submit"><a href="">Add Market</a>
</button>
</form>
</form>
And here is index.blade.php code
<h1><a href="">Add Market</a></h1>
Nothing happens. Please, help. Thank U!
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2lyprNj
via IFTTT
Aucun commentaire:
Enregistrer un commentaire