RegisterController.php
class RegisterController extends Controller
{
use RegistersUsers;
protected $redirectTo = RouteServiceProvider::HOME;
public function __construct()
{
$this->middleware('guest');
}
protected function validator(array $data)
{
return Validator::make($data, [
'nis' => ['required'],
'nama_siswa' => ['required', 'string', 'min:3', 'max:50', 'unique:siswas'],
'tempat_lahir' => ['required'],
'tanggal_lahir' => ['required'],
'jenkel' => ['required'],
'alamat' => ['required'],
'no_telp' => ['required', 'int', 'min:12', 'max:12', 'unique:siswas'],
'email' => ['required', 'string', 'email', 'min:3', 'max:50', 'unique:siswas'],
'password' => ['required', 'string', 'min:5'],
'kelas_id' => ['required'],
'walas_id' => ['required'],
]);
}
protected function create(array $data)
{
return Siswa::create([
'nis' => $data['nis'],
'nama_siswa' => $data['nama_siswa'],
'tempat_lahir' => $data['tempat_lahir'],
'tanggal_lahir' => $data['tanggal_lahir'],
'jenkel' => $data['jenkel'],
'alamat' => $data['alamat'],
'no_telp' => $data['no_telp'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
'kelas_id' => $data['kelas_id'],
'walas_id' => $data['walas_id'],
]);
}
}
please someone if you know the solution to the above problems. I got it for the first time please someone if you know the solution to the above problems. It's my first time getting something like this
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2R8pjo3
via IFTTT
Aucun commentaire:
Enregistrer un commentaire