does someone has an idea on how to create a leave credits that will Accrued every month base on the day of Employee hired. like for example when the employee hired on February 24 then on March 24 the leave credits will start to accrued of 1.5 and then on April 24 another 1.5 credits will add.
this is my leave controller by the way
//leave Employee
public function leavesEmployee()
{
$user = Auth::User()->rec_id;
$credits = 0;
$leaves = DB::table('leaves_admin')
->where('rec_id',Auth::user()->rec_id)
->get();
return view('Leave.leaveEmployee', compact('leaves','user','credits'));
}
employee or user migration
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->id();
$table->string('name');
$table->string('rec_id');
$table->string('email')->unique();
$table->string('join_date')->unique();
$table->string('status')->nullable();
$table->string('role_name')->nullable();
$table->string('avatar')->nullable();
$table->timestamp('email_verified_at')->nullable();
$table->boolean('needs_password')->default(false);
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
the join_date is the hire date.