Add input validation to RegisterController
MODIFY
app/Http/Controllers/RegisterController.php
app/Http/Controllers/RegisterController.php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
+// use App\Http\Controllers\Controller;
use App\Currency;
use App\User;
@@ -16,6 +17,13 @@ class RegisterController extends Controller {
}
public function store(Request $request) {
+ $this->validate($request, [
+ 'name' => 'required',
+ 'email' => 'required|email',
+ 'password' => 'required',
+ 'currency_id' => 'required'
+ ]);
+
$user = new User;
$user->name = $request->name;

MODIFY
resources/views/register/index.blade.php
resources/views/register/index.blade.php
@section('body')
<div class="row">
<div class="column size-560 align-center">
+ @if ($errors->any())
+ @foreach ($errors->all() as $error)
+ <div class="alert spacing-bottom-large">{{ $error }}</div>
+ @endforeach
+ @endif
<h1 class="spacing-bottom-large">Register</h1>
<div class="box spacing-small">
<form method="POST">

Add input validation to RegisterController