Skip to content

Commit

Permalink
Merge pull request #46 from Sharifur/dev
Browse files Browse the repository at this point in the history
add new field in the employee table
  • Loading branch information
Sharifur committed Jan 24, 2024
2 parents 0dabea1 + 89fa991 commit 8319b00
Show file tree
Hide file tree
Showing 84 changed files with 499 additions and 452 deletions.
1 change: 1 addition & 0 deletions app/Http/Requests/EmployeeRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ public function rules(): array
'joinDate' => 'required',
'dateOfBirth' => 'required',
'status' => 'required|numeric',
'incrementMonth' => 'required',
];
}

Expand Down
2 changes: 2 additions & 0 deletions app/Models/Employee.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ class Employee extends Model
'att_id',
'user_id',
'zktecho_user_id',
'incrementMonth',
];

public function category(){
Expand All @@ -45,6 +46,7 @@ public function attendanceLog(){
'status' => 'integer',
'imageId' => 'integer',
'joinDate' => 'datetime',
'incrementMonth' => 'datetime',
'dateOfBirth' => 'datetime'
];
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
/**
* Run the migrations.
*/
public function up(): void
{
Schema::table('employees', function (Blueprint $table) {
if (!Schema::hasColumn('employees','incrementMonth')){
$table->dateTime('incrementMonth')->nullable();
}
});
}

/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('employees', function (Blueprint $table) {
if (Schema::hasColumn('employees','incrementMonth')){
$table->dropColumn('incrementMonth');
}
});
}
};

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 8319b00

Please sign in to comment.