PHP code example of ikay / j-rh

1. Go to this page and download the library: Download ikay/j-rh library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ikay / j-rh example snippets


use Ikay\JRh\JRhPlugin;

->plugins([
    JRhPlugin::make(),
])

use Filament\Navigation\NavigationGroup;

->navigationGroups([
    NavigationGroup::make(fn () => __('j-rh::j-rh.hr_management')),
])

use Ikay\JRh\Traits\HasEmployees;

class User extends Authenticatable
{
    use HasEmployees;
}

// config/j-rh.php
return [
    'user_model' => \App\Models\User::class,
    'employee_id_prefix' => 'EMP',
    'navigation_group' => 'j-rh::j-rh.hr_management',
    'currency' => 'XAF',
];

use Ikay\JRh\Models\Employee;
use Ikay\JRh\Models\Salary;
use Ikay\JRh\Models\Advance;

$employee = Employee::factory()->create();
$salary = Salary::factory()->create(['employee_id' => $employee->id]);
$advance = Advance::factory()->approved()->create(['employee_id' => $employee->id]);
bash
php artisan migrate
bash
php artisan vendor:publish --tag=j-rh-config
bash
# Migrations
php artisan vendor:publish --tag=j-rh-migrations

# Translations
php artisan vendor:publish --tag=j-rh-translations

# Views (salary bulletin template)
php artisan vendor:publish --tag=j-rh-views
bash
php artisan test --compact tests/Feature/EmployeeTest.php tests/Feature/SalaryTest.php tests/Feature/AdvanceTest.php