nominee changes
This commit is contained in:
@@ -30,13 +30,13 @@ class AddController extends Controller
|
||||
$query->where('election_id', Util::getCurrentElection());
|
||||
})
|
||||
],
|
||||
'student_id' => [
|
||||
'no_anggota' => [
|
||||
'required',
|
||||
Rule::unique('nominee')->where(function($query){
|
||||
$query->where('election_id', Util::getCurrentElection());
|
||||
})
|
||||
],
|
||||
'course' => 'required',
|
||||
'unit' => 'required',
|
||||
'position_id' => 'required|exists:position,id',
|
||||
'partylist_id' => 'nullable|exists:partylist,id',
|
||||
'image' => 'nullable|image'
|
||||
|
||||
@@ -29,7 +29,7 @@ class UpdateController extends Controller
|
||||
$query->where('election_id', Util::getCurrentElection());
|
||||
})
|
||||
],
|
||||
'student_id' => [
|
||||
'no_anggota' => [
|
||||
'required',
|
||||
Rule::unique('nominee')->ignore($id)->where(function($query){
|
||||
$query->where('election_id', Util::getCurrentElection());
|
||||
@@ -48,7 +48,7 @@ class UpdateController extends Controller
|
||||
|
||||
$nominee->name = $request->name;
|
||||
$nominee->unit = $request->unit;
|
||||
$nominee->student_id = $request->student_id;
|
||||
$nominee->no_anggota = $request->no_anggota;
|
||||
$nominee->position_id = $request->position_id;
|
||||
$nominee->partylist_id = $request->partylist_id;
|
||||
$nominee->motto = $request->motto;
|
||||
|
||||
+2
-2
@@ -9,8 +9,8 @@ class Nominee extends Model
|
||||
protected $table = 'nominee';
|
||||
protected $fillable = [
|
||||
'name',
|
||||
'course',
|
||||
'student_id',
|
||||
'unit',
|
||||
'no_anggota',
|
||||
'position_id',
|
||||
'partylist_id',
|
||||
'election_id',
|
||||
|
||||
Reference in New Issue
Block a user