Fixed table migration, created api tests, created test env, added data import
This commit is contained in:
@@ -18,9 +18,11 @@ Route::post('/siswa', function (Request $request) {
|
||||
// Auto redirect on fail
|
||||
Validator::make($request->all(), [
|
||||
'nama' => 'required|string',
|
||||
'nisn' => 'required|integer',
|
||||
'nisn' => 'required|regex:/^[0-9]+$/',
|
||||
], [
|
||||
'required' => 'Kolom :attribute harus diisi.',
|
||||
'string' => 'Kolom :attribute tidak sesuai.',
|
||||
'regex' => 'Kolom :attribute tidak sesuai.',
|
||||
])->validate();
|
||||
|
||||
// Look for the given inputs in the resource
|
||||
@@ -41,7 +43,7 @@ Route::post('/siswa', function (Request $request) {
|
||||
|
||||
Route::get('/access_log', function () {
|
||||
// Get the number of unique access
|
||||
$logs = App\AccessLog()->unique()->count();
|
||||
$logs = App\AccessLog::all()->unique()->count();
|
||||
|
||||
// Get the total number of available resource
|
||||
$resources = App\Siswa::count();
|
||||
|
||||
Reference in New Issue
Block a user