Reviewed-on: ibnu/generic-ospro-backend#32
@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Hash;
use App\Models\User;
use App\Models\Role;
use App\Models\Company;
use Illuminate\Http\JsonResponse;
use Illuminate\Support\Facades\Password;
use Illuminate\Validation\ValidationException;
@ -58,6 +59,10 @@ class AuthController extends Controller
$dataRole = Role::find($user->role_id);
$dataHierarchy = $this->getDataHierarchy($user->divisi_id, $user->id);
$configApp = Company::where('id', $user->company_id)->first();
if ($configApp)
$user->configApp = $configApp;
if ($dataRole)
$user->role = $dataRole;
@ -12,6 +12,6 @@ class Absent extends Model
const UPDATED_AT = 'updated_at';
protected $fillable = [
'user_id', 'description', 'created_at', 'created_by', 'updated_at', 'updated_by'
'user_id', 'description', 'created_at', 'created_by', 'updated_at', 'updated_by', 'company_id'
];
}
@ -12,6 +12,6 @@ class Broadcast extends Model
'title_notif', 'message_notif', 'description', 'send_to_type', 'send_to_id', 'status_send', 'created_at', 'created_by', 'updated_at', 'updated_by'
'title_notif', 'message_notif', 'description', 'send_to_type', 'send_to_id', 'status_send', 'created_at', 'created_by', 'updated_at', 'updated_by', 'company_id'
@ -31,6 +31,7 @@ class Company extends Model
'created_at',
'created_by',
'updated_at',
'updated_by'
'updated_by',
'date_register'
@ -12,6 +12,6 @@ class PanicButton extends Model
'user_id', 'lat', 'lon', 'status_response', 'description', 'created_at', 'created_by', 'updated_at', 'updated_by'
'user_id', 'lat', 'lon', 'status_response', 'description', 'created_at', 'created_by', 'updated_at', 'updated_by', 'company_id'
@ -16,6 +16,6 @@ class Presence extends Model
'user_id', 'clock_in', 'clock_out', 'date_presence',
'clock_in_lat', 'clock_in_lng', 'clock_out_lat', 'clock_out_lng',
'clock_in_loc', 'clock_out_loc', 'clock_in_boundary', 'clock_out_boundary',
'created_at', 'created_by', 'updated_at', 'updated_by'
'created_at', 'created_by', 'updated_at', 'updated_by', 'company_id'
@ -20,6 +20,7 @@ class ReportK3 extends Model
'company_id'