Uploaded From CV. Swandhana Server
This commit is contained in:
No files matched your search
@@ -0,0 +1,18 @@
|
||||
root = true
|
||||
|
||||
[*]
|
||||
charset = utf-8
|
||||
end_of_line = lf
|
||||
indent_size = 4
|
||||
indent_style = space
|
||||
insert_final_newline = true
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.md]
|
||||
trim_trailing_whitespace = false
|
||||
|
||||
[*.{yml,yaml}]
|
||||
indent_size = 2
|
||||
|
||||
[docker-compose.yml]
|
||||
indent_size = 4
|
||||
@@ -0,0 +1,66 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=base64:kK/3kFWIu/qiax+zB5T9vUcBkazYe6GThmoFXjfHJzU=
|
||||
APP_DEBUG=true
|
||||
APP_URL=https://lis.swandhana.test
|
||||
|
||||
LOG_CHANNEL=daily
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=db_lis
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=bismillah
|
||||
|
||||
BROADCAST_DRIVER=pusher
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
QUEUE_DRIVER=sync
|
||||
SESSION_DRIVER=database
|
||||
SESSION_LIFETIME=1440
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_DRIVER=smtp
|
||||
MAIL_HOST=smtp.gmail.com
|
||||
MAIL_PORT=587
|
||||
MAIL_USERNAME=[email protected]
|
||||
MAIL_PASSWORD=ysnraxskgxfkeszm
|
||||
MAIL_ENCRYPTION=tls
|
||||
QUEUE_DRIVER=sync
|
||||
MAIL_FROM_NAME="Duidev Mailler"
|
||||
MAIL_FROM_ADDRESS=[email protected]
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=878723
|
||||
PUSHER_APP_KEY=461fe095afe037987c11
|
||||
PUSHER_APP_SECRET=c03b22f3d6c148426f67
|
||||
PUSHER_APP_CLUSTER=ap1
|
||||
PUSHER_HOST=
|
||||
PUSHER_PORT=443
|
||||
PUSHER_SCHEME=https
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
|
||||
BPJS_CONSID="2112121"
|
||||
BPJS_SECRET_KEY="121212121"
|
||||
BPJS_BASE_URL="https://new-api.bpjs-kesehatan.go.id:8080"
|
||||
BPJS_SERVICE_NAME="new-vclaim-rest"
|
||||
@@ -0,0 +1,59 @@
|
||||
APP_NAME=Laravel
|
||||
APP_ENV=local
|
||||
APP_KEY=
|
||||
APP_DEBUG=true
|
||||
APP_URL=http://localhost
|
||||
|
||||
LOG_CHANNEL=stack
|
||||
LOG_DEPRECATIONS_CHANNEL=null
|
||||
LOG_LEVEL=debug
|
||||
|
||||
DB_CONNECTION=mysql
|
||||
DB_HOST=127.0.0.1
|
||||
DB_PORT=3306
|
||||
DB_DATABASE=laravel
|
||||
DB_USERNAME=root
|
||||
DB_PASSWORD=
|
||||
|
||||
BROADCAST_DRIVER=log
|
||||
CACHE_DRIVER=file
|
||||
FILESYSTEM_DISK=local
|
||||
QUEUE_CONNECTION=sync
|
||||
SESSION_DRIVER=file
|
||||
SESSION_LIFETIME=120
|
||||
|
||||
MEMCACHED_HOST=127.0.0.1
|
||||
|
||||
REDIS_HOST=127.0.0.1
|
||||
REDIS_PASSWORD=null
|
||||
REDIS_PORT=6379
|
||||
|
||||
MAIL_MAILER=smtp
|
||||
MAIL_HOST=mailpit
|
||||
MAIL_PORT=1025
|
||||
MAIL_USERNAME=null
|
||||
MAIL_PASSWORD=null
|
||||
MAIL_ENCRYPTION=null
|
||||
MAIL_FROM_ADDRESS="[email protected]"
|
||||
MAIL_FROM_NAME="${APP_NAME}"
|
||||
|
||||
AWS_ACCESS_KEY_ID=
|
||||
AWS_SECRET_ACCESS_KEY=
|
||||
AWS_DEFAULT_REGION=us-east-1
|
||||
AWS_BUCKET=
|
||||
AWS_USE_PATH_STYLE_ENDPOINT=false
|
||||
|
||||
PUSHER_APP_ID=
|
||||
PUSHER_APP_KEY=
|
||||
PUSHER_APP_SECRET=
|
||||
PUSHER_HOST=
|
||||
PUSHER_PORT=443
|
||||
PUSHER_SCHEME=https
|
||||
PUSHER_APP_CLUSTER=mt1
|
||||
|
||||
VITE_APP_NAME="${APP_NAME}"
|
||||
VITE_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
|
||||
VITE_PUSHER_HOST="${PUSHER_HOST}"
|
||||
VITE_PUSHER_PORT="${PUSHER_PORT}"
|
||||
VITE_PUSHER_SCHEME="${PUSHER_SCHEME}"
|
||||
VITE_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
|
||||
@@ -0,0 +1,18 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 dwi_vendor
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
@@ -0,0 +1,72 @@
|
||||
<<<<<<< HEAD
|
||||
# lis
|
||||
|
||||
Laboratory Information System
|
||||
=======
|
||||
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>
|
||||
|
||||
<p align="center">
|
||||
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
|
||||
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
|
||||
</p>
|
||||
|
||||
## About Laravel
|
||||
|
||||
Laravel is a web application framework with expressive, elegant syntax. We believe development must be an enjoyable and creative experience to be truly fulfilling. Laravel takes the pain out of development by easing common tasks used in many web projects, such as:
|
||||
|
||||
- [Simple, fast routing engine](https://laravel.com/docs/routing).
|
||||
- [Powerful dependency injection container](https://laravel.com/docs/container).
|
||||
- Multiple back-ends for [session](https://laravel.com/docs/session) and [cache](https://laravel.com/docs/cache) storage.
|
||||
- Expressive, intuitive [database ORM](https://laravel.com/docs/eloquent).
|
||||
- Database agnostic [schema migrations](https://laravel.com/docs/migrations).
|
||||
- [Robust background job processing](https://laravel.com/docs/queues).
|
||||
- [Real-time event broadcasting](https://laravel.com/docs/broadcasting).
|
||||
|
||||
Laravel is accessible, powerful, and provides tools required for large, robust applications.
|
||||
|
||||
## Learning Laravel
|
||||
|
||||
Laravel has the most extensive and thorough [documentation](https://laravel.com/docs) and video tutorial library of all modern web application frameworks, making it a breeze to get started with the framework.
|
||||
|
||||
You may also try the [Laravel Bootcamp](https://bootcamp.laravel.com), where you will be guided through building a modern Laravel application from scratch.
|
||||
|
||||
If you don't feel like reading, [Laracasts](https://laracasts.com) can help. Laracasts contains over 2000 video tutorials on a range of topics including Laravel, modern PHP, unit testing, and JavaScript. Boost your skills by digging into our comprehensive video library.
|
||||
|
||||
## Laravel Sponsors
|
||||
|
||||
We would like to extend our thanks to the following sponsors for funding Laravel development. If you are interested in becoming a sponsor, please visit the [Laravel Partners program](https://partners.laravel.com).
|
||||
|
||||
### Premium Partners
|
||||
|
||||
- **[Vehikl](https://vehikl.com/)**
|
||||
- **[Tighten Co.](https://tighten.co)**
|
||||
- **[WebReinvent](https://webreinvent.com/)**
|
||||
- **[Kirschbaum Development Group](https://kirschbaumdevelopment.com)**
|
||||
- **[64 Robots](https://64robots.com)**
|
||||
- **[Curotec](https://www.curotec.com/services/technologies/laravel/)**
|
||||
- **[Cyber-Duck](https://cyber-duck.co.uk)**
|
||||
- **[DevSquad](https://devsquad.com/hire-laravel-developers)**
|
||||
- **[Jump24](https://jump24.co.uk)**
|
||||
- **[Redberry](https://redberry.international/laravel/)**
|
||||
- **[Active Logic](https://activelogic.com)**
|
||||
- **[byte5](https://byte5.de)**
|
||||
- **[OP.GG](https://op.gg)**
|
||||
|
||||
## Contributing
|
||||
|
||||
Thank you for considering contributing to the Laravel framework! The contribution guide can be found in the [Laravel documentation](https://laravel.com/docs/contributions).
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
In order to ensure that the Laravel community is welcoming to all, please review and abide by the [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct).
|
||||
|
||||
## Security Vulnerabilities
|
||||
|
||||
If you discover a security vulnerability within Laravel, please send an e-mail to Taylor Otwell via [[email protected]](mailto:[email protected]). All security vulnerabilities will be promptly addressed.
|
||||
|
||||
## License
|
||||
|
||||
The Laravel framework is open-sourced software licensed under the [MIT license](https://opensource.org/licenses/MIT).
|
||||
>>>>>>> afc9cdf (Unggahan Awal)
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use App\Services\AstmMessageService;
|
||||
use App\DataListiner;
|
||||
|
||||
class ProcessAstmMessages extends Command
|
||||
{
|
||||
protected $signature = 'astm:process-messages';
|
||||
protected $description = 'Process pending ASTM messages';
|
||||
|
||||
private $astmMessageService;
|
||||
|
||||
public function __construct(AstmMessageService $astmMessageService)
|
||||
{
|
||||
parent::__construct();
|
||||
$this->astmMessageService = $astmMessageService;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
// Ambil data dari DataListener
|
||||
$dataListener = DataListiner::whereNull('processed')->get();
|
||||
if ($dataListener) {
|
||||
$jumlah = count($dataListener);
|
||||
$pesan = $this->astmMessageService->processAstmMessages($dataListener);
|
||||
$this->info($jumlah.' Message processed '.$pesan.' at '.date('Y-m-d H:i:s'));
|
||||
} else {
|
||||
$this->info('Skipped Proses at '.date('Y-m-d H:i:s'));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use GuzzleHttp\Client;
|
||||
use App\Models\TestResult;
|
||||
use App\Pasien;
|
||||
|
||||
class SyncLabResults extends Command
|
||||
{
|
||||
// Nama dan deskripsi command
|
||||
protected $signature = 'lab:sync-results';
|
||||
protected $description = 'Sync lab results from external instruments';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
// Instance Guzzle client
|
||||
$client = new Client();
|
||||
|
||||
// URL endpoint API dari alat (ganti dengan URL alat kamu)
|
||||
$url = 'https://api.examplelab.com/results';
|
||||
|
||||
// Contoh request ke API alat untuk mengambil hasil tes
|
||||
try {
|
||||
$response = $client->request('GET', $url, [
|
||||
'headers' => [
|
||||
'Authorization' => 'Bearer your_api_token', // Jika alat memerlukan token API
|
||||
'Accept' => 'application/json'
|
||||
]
|
||||
]);
|
||||
|
||||
// Parsing data JSON yang diterima dari API
|
||||
$data = json_decode($response->getBody()->getContents(), true);
|
||||
|
||||
// Menyimpan hasil tes ke database
|
||||
foreach ($data as $result) {
|
||||
// Mencari pasien berdasarkan ID
|
||||
$patient = Pasien::find($result['patient_id']);
|
||||
if ($patient) {
|
||||
TestResult::create([
|
||||
'patient_id' => $patient->id,
|
||||
'test_id' => $result['test_id'],
|
||||
'result_value' => $result['result_value'],
|
||||
'result_status' => $result['status'],
|
||||
'timestamp' => $result['timestamp']
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
$this->info('Lab results synchronized successfully.');
|
||||
} catch (\Exception $e) {
|
||||
$this->error('Error syncing lab results: ' . $e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
class SyncLabResultsFTP extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:sync-lab-results-f-t-p';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
// Mengakses file di FTP server
|
||||
$ftpDisk = Storage::disk('ftp'); // Pastikan konfigurasi FTP ada di config/filesystems.php
|
||||
|
||||
// Mendapatkan daftar file di FTP server
|
||||
$files = $ftpDisk->files('results'); // Misalnya folder 'results'
|
||||
|
||||
foreach ($files as $file) {
|
||||
// Mengambil file dari FTP dan membaca isinya
|
||||
$fileContents = $ftpDisk->get($file);
|
||||
|
||||
// Proses konten file (misalnya parsing CSV atau XML)
|
||||
$this->processFileContents($fileContents);
|
||||
}
|
||||
|
||||
$this->info('Lab results synchronized from FTP.');
|
||||
}
|
||||
protected function processFileContents($contents)
|
||||
{
|
||||
// Misalnya, jika konten dalam format CSV
|
||||
$rows = str_getcsv($contents, "\n");
|
||||
|
||||
foreach ($rows as $row) {
|
||||
$data = str_getcsv($row);
|
||||
|
||||
// Menyimpan hasil tes ke database
|
||||
TestResult::create([
|
||||
'patient_id' => $data[0], // Misal, data pasien ada di kolom pertama
|
||||
'test_id' => $data[1], // Misal, data tes ada di kolom kedua
|
||||
'result_value' => $data[2],// Nilai hasil tes ada di kolom ketiga
|
||||
'timestamp' => now(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console\Commands;
|
||||
|
||||
use Illuminate\Console\Command;
|
||||
|
||||
class SyncLabResultsSerial extends Command
|
||||
{
|
||||
/**
|
||||
* The name and signature of the console command.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $signature = 'app:sync-lab-results-serial';
|
||||
|
||||
/**
|
||||
* The console command description.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $description = 'Command description';
|
||||
|
||||
/**
|
||||
* Execute the console command.
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$host = '192.168.1.100'; // IP alat
|
||||
$port = 4000; // Port alat
|
||||
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
socket_connect($socket, $host, $port);
|
||||
|
||||
$response = socket_read($socket, 1024);
|
||||
|
||||
// Proses response dari alat
|
||||
$this->processSocketData($response);
|
||||
|
||||
socket_close($socket);
|
||||
}
|
||||
protected function processSocketData($data)
|
||||
{
|
||||
// Proses data yang diterima (misalnya parsing atau format hasil tes)
|
||||
$testResult = json_decode($data, true);
|
||||
|
||||
// Simpan hasil tes ke database
|
||||
TestResult::create([
|
||||
'patient_id' => $testResult['patient_id'],
|
||||
'test_id' => $testResult['test_id'],
|
||||
'result_value' => $testResult['result_value'],
|
||||
'timestamp' => $testResult['timestamp']
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Console;
|
||||
|
||||
use Illuminate\Console\Scheduling\Schedule;
|
||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||
|
||||
class Kernel extends ConsoleKernel
|
||||
{
|
||||
/**
|
||||
* Define the application's command schedule.
|
||||
*/
|
||||
protected function schedule(Schedule $schedule): void
|
||||
{
|
||||
// $schedule->command('inspire')->hourly();
|
||||
//$schedule->command('lab:sync-results')->everyThirtyMinutes();
|
||||
//$schedule->command('app:sync-lab-results-f-t-p')->everyThirtyMinutes();
|
||||
//$schedule->command('app:sync-lab-results-serial')->everyThirtyMinutes();
|
||||
$schedule->command('astm:process-messages')->everyFiveMinutes();
|
||||
}
|
||||
|
||||
/**
|
||||
* Register the commands for the application.
|
||||
*/
|
||||
protected function commands(): void
|
||||
{
|
||||
$this->load(__DIR__.'/Commands');
|
||||
|
||||
require base_path('routes/console.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class DataListiner extends Model
|
||||
{
|
||||
protected $connection = 'mysqllistener';
|
||||
protected $table = "lis_phoenix";
|
||||
public $timestamps = false;
|
||||
protected $guarded = [];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Dokter extends Model
|
||||
{
|
||||
protected $table = "dokter";
|
||||
protected $fillable = [
|
||||
'id',
|
||||
'nama',
|
||||
'jk',
|
||||
'tgl_lahir',
|
||||
'kota',
|
||||
'alamat',
|
||||
'poli_id'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
<?php
|
||||
|
||||
namespace App\Events;
|
||||
|
||||
use Illuminate\Broadcasting\Channel;
|
||||
use Illuminate\Broadcasting\InteractsWithSockets;
|
||||
use Illuminate\Broadcasting\PresenceChannel;
|
||||
use Illuminate\Broadcasting\PrivateChannel;
|
||||
use Illuminate\Contracts\Broadcasting\ShouldBroadcast;
|
||||
use Illuminate\Foundation\Events\Dispatchable;
|
||||
use Illuminate\Queue\SerializesModels;
|
||||
|
||||
class DesaUpdated implements ShouldBroadcast
|
||||
{
|
||||
use Dispatchable, InteractsWithSockets, SerializesModels;
|
||||
public $message;
|
||||
public function __construct($message)
|
||||
{
|
||||
$this->message = $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the channels the event should broadcast on.
|
||||
*
|
||||
* @return array<int, \Illuminate\Broadcasting\Channel>
|
||||
*/
|
||||
public function broadcastOn(): array
|
||||
{
|
||||
return ['my-channel'];
|
||||
}
|
||||
public function broadcastAs() {
|
||||
return 'my-event';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\Exceptions;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
|
||||
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
|
||||
use Throwable;
|
||||
|
||||
class Handler extends ExceptionHandler
|
||||
{
|
||||
/**
|
||||
* The list of the inputs that are never flashed to the session on validation exceptions.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $dontFlash = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
|
||||
/**
|
||||
* Register the exception handling callbacks for the application.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
$this->reportable(function (Throwable $e) {
|
||||
//
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Filefoto extends Model
|
||||
{
|
||||
protected $table = "db_file";
|
||||
protected $fillable = [
|
||||
'nofoto','namafile','jenisfile','judul'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Filetemp extends Model
|
||||
{
|
||||
protected $table = "temp";
|
||||
protected $fillable = [
|
||||
'tanggal', 'nomor', 'nama', 'usia', 'l', 'p', 'foto', 'ruang', 'keterangan', 'poli', 'jkn', 'umum', 'tag', 'gcu', 'cito', 'daftar', 'status'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use App\Http\Controllers\Controller;
|
||||
use App\User;
|
||||
use App\Pegawai;
|
||||
use App\Periksa;
|
||||
use App\ResultSample;
|
||||
|
||||
use Session;
|
||||
use Auth;
|
||||
use Validator;
|
||||
|
||||
class AuthController extends Controller
|
||||
{
|
||||
public function login() {
|
||||
$data = [];
|
||||
$previlage = Session('previlage');
|
||||
if ($previlage == '' OR $previlage === null) {
|
||||
$getdomain = url()->current();
|
||||
$data['getdomain'] = $getdomain;
|
||||
return view('login', $data);
|
||||
} else {
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
public function authenticate(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'username' => 'required',
|
||||
'password' => 'required',
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
Session::flash('message', 'Username dan Password Harus diisi');
|
||||
return back();
|
||||
} else {
|
||||
$username = $request->username;
|
||||
$password = $request->password;
|
||||
$firebaseid = $request->firebaseid;
|
||||
if (is_null($firebaseid)){ $firebaseid = ''; }
|
||||
$auth = Auth::attempt([
|
||||
'username' => $username,
|
||||
'password' => $password
|
||||
]);
|
||||
|
||||
if(!$auth) {
|
||||
$cekada = User::whereNotNull('username')->count();
|
||||
if ($cekada == 0){
|
||||
User::create([
|
||||
'nama' => 'Administrator',
|
||||
'username' => 'admin',
|
||||
'password' => bcrypt('semangat'),
|
||||
'previlage' => 'developer'
|
||||
]);
|
||||
}
|
||||
Session::flash('message', 'Username atau password anda salah');
|
||||
return back();
|
||||
}
|
||||
$user = Auth::user();
|
||||
$photo = $user->getPhoto->xfile ?? '/doctor.png';
|
||||
if ($firebaseid != ''){
|
||||
User::where('username', $request->username)->update([
|
||||
'firebase' => $firebaseid
|
||||
]);
|
||||
}
|
||||
|
||||
Session::put('id', $user->id);
|
||||
Session::put('nama', $user->nama);
|
||||
Session::put('username', $user->username);
|
||||
Session::put('previlage', $user->previlage);
|
||||
Session::put('photo', $photo);
|
||||
Session::save();
|
||||
User::where('id', $user->id)->update([
|
||||
'active_status' => 1,
|
||||
]);
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
public function cekandroid($firebaseid){
|
||||
$cekperiksa = Periksa::all();
|
||||
if (!empty($cekperiksa)){
|
||||
$tahun = date('y');
|
||||
$getdata = ResultSample::where('accession_number', 'LIKE', $tahun.'.%')->get();
|
||||
foreach($getdata as $rows){
|
||||
$norm = $rows->patient_id;
|
||||
$nama2 = $rows->patient_name_last;
|
||||
$nama1 = $rows->patient_name_first;
|
||||
$nama = $nama1.' '.$nama2;
|
||||
$alamat = $rows->address_street;
|
||||
$nofoto = $rows->accession_number;
|
||||
|
||||
Pasien::updateOrCreate(
|
||||
[
|
||||
'norm' => $norm,
|
||||
],
|
||||
[
|
||||
'nama' => $nama,
|
||||
'jk' => $jk,
|
||||
'tgl_lahir' => $tgllahir,
|
||||
'kota' => config('global.subdomainapps'),
|
||||
'telpon' => $telpon,
|
||||
'alamat' => $alamat,
|
||||
'nik' => $nik,
|
||||
'bpjs' => $bpjs,
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
$cekuser = User::where('firebase', $firebaseid)->count();
|
||||
if ($cekuser != 0){
|
||||
$user = User::where('firebase', $firebaseid)->first();
|
||||
$photo = $user->getPhoto->xfile ?? '/doctor.png';
|
||||
Session::put('id', $user->id);
|
||||
Session::put('nama', $user->nama);
|
||||
Session::put('username', $user->username);
|
||||
Session::put('previlage', $user->previlage);
|
||||
Session::put('photo', $photo);
|
||||
Session::save();
|
||||
User::where('id', $user->id)->update([
|
||||
'active_status' => 1,
|
||||
]);
|
||||
return redirect('/');
|
||||
|
||||
} else {
|
||||
Session::flash('message', 'Firebase ID Not Saved, Please Login');
|
||||
Session::flash('status', $firebaseid);
|
||||
return redirect('/login');
|
||||
}
|
||||
}
|
||||
public function logout(Request $request) {
|
||||
Auth::logout();
|
||||
$request->session()->regenerate();
|
||||
$request->session()->flush();
|
||||
session()->flush();
|
||||
return redirect('/');
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load diff
@@ -0,0 +1,264 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Poli;
|
||||
use App\Periksa;
|
||||
use App\Dokter;
|
||||
use App\Ruangan;
|
||||
use App\Subjawaban;
|
||||
use App\Jawaban;
|
||||
use App\Pasien;
|
||||
use App\User;
|
||||
use App\Jadwalperiksa;
|
||||
use Carbon\Carbon;
|
||||
use DateTime;
|
||||
use Session;
|
||||
|
||||
class ListController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
$polis = Poli::all();
|
||||
$ruangans = Ruangan::all();
|
||||
$dokters = Dokter::all();
|
||||
$answers = Jawaban::all();
|
||||
$details = Subjawaban::all();
|
||||
$ruangpolis = Ruangan::groupBy('poli')->select('poli')->get();
|
||||
$data = [];
|
||||
$i = 0;
|
||||
foreach ($ruangpolis as $ruangpoli) {
|
||||
$j = 0;
|
||||
$ruangpoli = $ruangpoli->poli;
|
||||
$rooms = Ruangan::where('poli', $ruangpoli)->get();
|
||||
foreach ($rooms as $room) {
|
||||
$data['ruangans'][$i][$j]['id'] = $room->id;
|
||||
$data['ruangans'][$i][$j]['ruangan'] = $room->ruangan;
|
||||
$j++;
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
$x = 0;
|
||||
foreach ($ruangpolis as $ruangpoli) {
|
||||
$data['ruangpolis'][$x] = $ruangpoli->poli;
|
||||
$x++;
|
||||
}
|
||||
|
||||
$data['polis'] = $polis;
|
||||
$data['dokters'] = $dokters;
|
||||
$data['answers'] = $answers;
|
||||
$data['details'] = $details;
|
||||
|
||||
return view('admin.list', $data);
|
||||
}
|
||||
|
||||
}
|
||||
public function getList(Request $request) {
|
||||
$jenis = $request->input('jenis');
|
||||
$mulai = $request->input('mulai');
|
||||
$akhir = $request->input('akhir');
|
||||
$lokasi = $request->input('poli');
|
||||
$valcari = $request->input('valcari');
|
||||
$master = $request->input('master');
|
||||
if ($jenis == 'verificationppds'){
|
||||
$valcari = $request->input('poli');
|
||||
}
|
||||
$total = 0;
|
||||
$data = $this->getDataBasedOnMaster($master, $jenis, $mulai, $akhir, $valcari);
|
||||
if (!empty($data)){
|
||||
$dataArray = $data->get()->toArray();
|
||||
$total = count($dataArray);
|
||||
$arraylist = array_map(function ($list) use ($master) {
|
||||
$tgl = $list['tgllahirpasien'];
|
||||
$poli_id = $list['poli_id'];
|
||||
$foto = $list['foto'];
|
||||
$baca = $list['baca'];
|
||||
$export = $list['export'];
|
||||
$nofoto = $list['nofoto'];
|
||||
$noregister = $list['noregister'];
|
||||
$usia = $list['usia'];
|
||||
$urgensi = $list['urgensi'];
|
||||
$reques = $list['reques'];
|
||||
$ruangan = $list['ruangan'];
|
||||
$daftar = $list['daftar'];
|
||||
$status = $list['status'];
|
||||
$asalpasien = $list['asalpasien'];
|
||||
$dokter_id = $list['dokter_id'];
|
||||
$ppdssenior = $list['ppdssenior'];
|
||||
$middleppds = $list['middleppds'];
|
||||
$ppdsjunior = $list['ppdsjunior'];
|
||||
$middleppds2= $list['ppdsmiddle2'];
|
||||
$ppdsjunior2= $list['ppdsjunior2'];
|
||||
$pasiedin = $list['pasien_id'];
|
||||
$keterangan = $list['keterangan'];
|
||||
$kesimpulan = $list['kesimpulan'];
|
||||
$verifikasi = $list['verifikasi'];
|
||||
$nama = $list['nmpasien'];
|
||||
$jk = $list['jkpasien'];
|
||||
$telpon = $list['tlppasien'];
|
||||
$alamat = $list['alamatpasien'];
|
||||
$tgllahir = $list['tgllahirpasien'];
|
||||
$ktp = $list['ktp'];
|
||||
$bpjs = $list['bpjs'];
|
||||
$nmpendaftar= $list['pendaftar'];
|
||||
if ($nmpendaftar == 'supervisor' OR $nmpendaftar == 'admin' OR $nmpendaftar == 'analis' OR $nmpendaftar == 'ppds' OR $nmpendaftar == 'developer'){
|
||||
$nmpendaftar = $list['nmpendaftar'];
|
||||
} else {
|
||||
$nmpendaftar = 'SIMRS';
|
||||
}
|
||||
$from = $verifikasi ? \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $verifikasi) : null;
|
||||
$to = $verifikasi ? \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $verifikasi)->toString() : '';
|
||||
if ($from && $from->isValid()) {
|
||||
$durasi = $verifikasi ? \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $verifikasi)->diffForHumans($from) : 'On Progress';
|
||||
} else {
|
||||
$durasi = 'On Progress';
|
||||
}
|
||||
if ($middleppds2 != 0){
|
||||
$ppdsas = 'Middle';
|
||||
$otherppds = $list['nmppdsmiddle2'];
|
||||
} else {
|
||||
$ppdsas = 'Junior';
|
||||
$otherppds = $ppdsjunior2;
|
||||
$otherppds = $list['nmppdsjunior2'];
|
||||
}
|
||||
|
||||
$arrdaftar = explode(" ", $daftar);
|
||||
$tgldaftar = $arrdaftar[0];
|
||||
$jamdaftar = $arrdaftar[1];
|
||||
$daftar = $tgldaftar;
|
||||
$tglfoto = $foto ?: date("Y-m-d H:i:s");
|
||||
$datatampilan = $this->setStatusStyles($status, $nofoto, $noregister, $nama, $telpon, $jk, $usia, $urgensi, $reques, $ruangan, $daftar, $asalpasien);
|
||||
return [
|
||||
'asalpasien' => $list['asalpasien'],
|
||||
'tlsnofoto' => $datatampilan['nofoto'],
|
||||
'tlsnoregister' => $datatampilan['noregister'],
|
||||
'tlsnama' => $datatampilan['nama'],
|
||||
'tlsjk' => $datatampilan['jk'],
|
||||
'tlsusia' => $datatampilan['usia'],
|
||||
'tlsurgensi' => ($list['urgensi'] == 'CITO') ? '<span style="background-color: red;">C I T O</span>' : $datatampilan['urgensi'],
|
||||
'tlsreques' => $datatampilan['reques'],
|
||||
'tlsruangan' => $list['ruangan'],
|
||||
'tlsdaftar' => $datatampilan['daftar'],
|
||||
'tlsstatus' => $datatampilan['status'],
|
||||
'id' => $list['id'],
|
||||
'nofoto' => $nofoto,
|
||||
'noregister' => $noregister,
|
||||
'nama' => $nama,
|
||||
'jk' => $jk,
|
||||
'usia' => $usia,
|
||||
'urgensi' => $urgensi,
|
||||
'poli' => $reques,
|
||||
'idpasien' => $pasiedin,
|
||||
'ruangan' => $ruangan,
|
||||
'daftar' => $list['daftar'],
|
||||
'daftartgl' => $daftar,
|
||||
'daftarjam' => $jamdaftar,
|
||||
'status' => $status,
|
||||
'dokter' => $master != 'kiriman' ? $list['nmdokter'] : '',
|
||||
'ppds1' => $master != 'kiriman' ? $list['nmppdssenior'] : '',
|
||||
'ppds2' => $master != 'kiriman' ? $list['nmmiddleppds'] : '',
|
||||
'ppds3' => $master != 'kiriman' ? $list['nmppdsjunior'] : '',
|
||||
'keterangan' => $keterangan,
|
||||
'kesimpulan' => $kesimpulan,
|
||||
'noloket' => $list['noloket'],
|
||||
'idruangan' => $list['ruangan_id'],
|
||||
'iddokter' => $list['dokter_id'],
|
||||
'ppdssenior' => $list['ppdssenior'],
|
||||
'middleppds' => $list['middleppds'],
|
||||
'ppdsjunior' => $list['ppdsjunior'],
|
||||
'diagnosa' => $list['diagnosa'],
|
||||
'diagnosa2' => $list['diagnosa2'],
|
||||
'kd_spesimen' => $list['kd_spesimen'],
|
||||
'nm_spesimen' => $list['nm_spesimen'],
|
||||
'berat' => $list['berat'],
|
||||
'klinis' => $list['klinis'],
|
||||
'klinisi' => $list['klinisi'],
|
||||
'filefoto' => $list['filefoto'],
|
||||
'dlp' => $list['dlp'],
|
||||
'analis' => $list['analis'],
|
||||
'excutor' => $list['excutor'],
|
||||
'modality' => $list['modality'],
|
||||
'viewfoto' => $list['foto'],
|
||||
'tglfoto' => $tglfoto,
|
||||
'nmppdssenior' => $list['nmppdssenior'],
|
||||
'nmmiddleppds' => $list['nmmiddleppds'],
|
||||
'nmppdsjunior' => $list['nmppdsjunior'],
|
||||
'nmppdsmiddle2' => $list['nmppdsmiddle2'],
|
||||
'nmppdsjunior2' => $list['nmppdsjunior2'],
|
||||
'nmanalis' => $list['nmanalis'],
|
||||
'nmexcutor' => $list['nmexcutor'],
|
||||
'telpon' => $list['tlppasien'],
|
||||
'asuransi' => $list['asuransi'],
|
||||
'tgllahir' => $list['tgllahirpasien'],
|
||||
'alamat' => $list['alamatpasien'],
|
||||
'poli_id' => $list['poli_id'],
|
||||
'nmpendaftar' => $nmpendaftar,
|
||||
'timestamp1' => $from ? $from->toString() : null,
|
||||
'timestamp2' => $to,
|
||||
'durasi' => $durasi,
|
||||
'ppdsas' => $ppdsas,
|
||||
'otherppds' => $otherppds,
|
||||
'ktp' => $ktp,
|
||||
'bpjs' => $bpjs,
|
||||
];
|
||||
}, $dataArray);
|
||||
}
|
||||
$response = [
|
||||
'message' => 'List Laporan',
|
||||
'data' => $arraylist,
|
||||
'total' => $total
|
||||
];
|
||||
return response()->json($response, 200);
|
||||
}
|
||||
public function listDetail(Request $request) {
|
||||
$id = $request->input('id');
|
||||
$periksa = DB::table('periksa')->where('id', $id)->first();
|
||||
echo json_encode($periksa);
|
||||
}
|
||||
public function delete(Request $request) {
|
||||
$id = $request->input('val01');
|
||||
$alasan = $request->input('val02');
|
||||
$tabel = $request->input('val03');
|
||||
if ($alasan == ''){
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'Mohon isi semua form']);
|
||||
return back();
|
||||
} else {
|
||||
if ($tabel == 'aktif'){
|
||||
$alasan = 'Dibatalkan dengan alasan '.$alasan;
|
||||
$input = Periksa::where('id', $id)->update([
|
||||
'noloket' => null,
|
||||
'status' => $alasan
|
||||
]);
|
||||
$pesan = 'Order Expertise Canceled';
|
||||
} else if ($tabel == 'arsip'){
|
||||
$total = 0;
|
||||
$input = Periksa::whereIn('id', $id)->update([
|
||||
'status'=> 'Arsip'
|
||||
]);
|
||||
if ($input){
|
||||
$total++;
|
||||
}
|
||||
$pesan = 'Expertise Archieved '.$total;
|
||||
} else {
|
||||
$alasan = 'Dibatalkan dengan alasan '.$alasan;
|
||||
$input = Jadwalperiksa::where('id', $id)->update([
|
||||
'noloket' => null,
|
||||
'status' => $alasan
|
||||
]);
|
||||
$pesan = 'Schedulling Canceled';
|
||||
}
|
||||
if ($input){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Sukses', 'message' => $pesan]);
|
||||
return back();
|
||||
}else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Gagal', 'message' => 'System Down, please try again in a few years...']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load diff
@@ -0,0 +1,225 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Filetemp;
|
||||
use App\User;
|
||||
use App\Periksa;
|
||||
use App\Pasien;
|
||||
use GuzzleHttp\Client;
|
||||
use Validator;
|
||||
use DateTime;
|
||||
use Carbon\Carbon;
|
||||
use Session;
|
||||
|
||||
class PasienController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
$data = [];
|
||||
return view('admin.pasien', $data);
|
||||
}
|
||||
}
|
||||
public function store(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'nama' => 'required',
|
||||
'jk' => 'required',
|
||||
'tgl_lahir' => 'required',
|
||||
'kota' => 'required',
|
||||
'alamat' => 'required',
|
||||
'telpon' => 'required'
|
||||
]);
|
||||
$old_date = $request->input('tgl_lahir');
|
||||
$date = date("Y-m-d", strtotime($old_date));
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$norm = $request->input('norm');
|
||||
$norm = strtoupper($norm);
|
||||
Pasien::create([
|
||||
'norm' => $norm,
|
||||
'nama' => $request->input('nama'),
|
||||
'jk' => $request->input('jk'),
|
||||
'tgl_lahir' => $date,
|
||||
'telpon' => $request->input('telpon'),
|
||||
'kota' => $request->input('kota'),
|
||||
'alamat' => $request->input('alamat')
|
||||
]);
|
||||
Session::flash('message', 'Data berhasil disimpan');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
return back();
|
||||
}
|
||||
}
|
||||
public function getPasien(Request $request) {
|
||||
$id = $request->input('id');
|
||||
$result = DB::table('pasien')->where('id', $id)->first();
|
||||
$tgllahir = $result->tgl_lahir;
|
||||
$arrtgl = explode('-', $tgllahir);
|
||||
$yy = $arrtgl[0];
|
||||
$mm = $arrtgl[1];
|
||||
$dd = $arrtgl[2];
|
||||
$tgllahir = $dd.'-'.$mm.'-'.$yy;
|
||||
$arrayfnk[] = array(
|
||||
'telpon' => $result->telpon,
|
||||
'nama' => $result->nama,
|
||||
'tgl_lahir' => $result->tgl_lahir,
|
||||
'alamat' => $result->alamat,
|
||||
'id' => $result->id,
|
||||
'norm' => $result->norm,
|
||||
'jk' => $result->jk,
|
||||
'kota' => $result->kota,
|
||||
'nik' => $result->nik,
|
||||
'bpjs' => $result->bpjs,
|
||||
);
|
||||
echo json_encode($arrayfnk);
|
||||
}
|
||||
public function getPatienalllist(Request $request) {
|
||||
$data = Pasien::all();
|
||||
echo json_encode($data);
|
||||
}
|
||||
public function getPasienbynorm(Request $request) {
|
||||
$norm = $request->input('id');
|
||||
$getdatalokal = Pasien::where('norm', $norm)->first();
|
||||
if (isset($getdatalokal->nama)){
|
||||
$tgl_lahir = $getdatalokal->tgl_lahir;
|
||||
$arrdate = explode('-', $tgl_lahir);
|
||||
$yy = $arrdate[0];
|
||||
$mm = $arrdate[1];
|
||||
$dd = $arrdate[2];
|
||||
$tgl_lahir = $dd.'-'.$mm.'-'.$yy;
|
||||
return response()->json([
|
||||
'id' => $getdatalokal->id,
|
||||
'norm' => $getdatalokal->norm,
|
||||
'telpon' => $getdatalokal->telpon,
|
||||
'nama' => $getdatalokal->nama,
|
||||
'tgl_lahir' => $getdatalokal->tgl_lahir,
|
||||
'jk' => $getdatalokal->jk,
|
||||
'alamat' => $getdatalokal->alamat,
|
||||
'kota' => $getdatalokal->kota,
|
||||
'nik' => $getdatalokal->nik,
|
||||
'bpjs' => $getdatalokal->bpjs,
|
||||
]);
|
||||
} else {
|
||||
try {
|
||||
$client = new Client();
|
||||
$res = $client->request('GET', 'http://10.10.123.51:8000/mr/'.$norm);
|
||||
$response_data = json_decode($res->getBody()->getContents());
|
||||
if (isset($response_data[0])) {
|
||||
$hasil = $response_data[0];
|
||||
$nama = $hasil->Nama;
|
||||
$alamat = $hasil->Alamat;
|
||||
$telpon = $hasil->Telp;
|
||||
$kota = $hasil->Kota;
|
||||
$kelamin = $hasil->JenisKelamin;
|
||||
$tgllahir = $hasil->tanggal_lahir;
|
||||
$nik = $hasil->nik;
|
||||
$bpjs = $hasil->bpjs;
|
||||
if ($kelamin == 'WANITA'){
|
||||
$kelamin = 'P';
|
||||
} else { $kelamin = 'L'; }
|
||||
return response()->json([
|
||||
'id' => 'new',
|
||||
'norm' => $norm,
|
||||
'telpon' => $telpon,
|
||||
'nama' => $nama,
|
||||
'tgl_lahir' => $tgllahir,
|
||||
'jk' => $kelamin,
|
||||
'alamat' => $alamat,
|
||||
'kota' => $kota,
|
||||
'nik' => $nik,
|
||||
'bpjs' => $bpjs,
|
||||
]);
|
||||
} else {
|
||||
return response()->json([
|
||||
'id' => '',
|
||||
'telpon' => '000000000',
|
||||
'norm' => $norm,
|
||||
'nama' => '',
|
||||
'tgl_lahir' => date("d-m-Y"),
|
||||
'jk' => 'L',
|
||||
'alamat' => 'Malang',
|
||||
'kota' => 'Malang',
|
||||
'nik' => '',
|
||||
'bpjs' => '',
|
||||
]);
|
||||
}
|
||||
}catch (Exception $e) {
|
||||
return response()->json([
|
||||
'id' => '',
|
||||
'telpon' => '000000000',
|
||||
'norm' => $norm,
|
||||
'nama' => '',
|
||||
'tgl_lahir' => date("d-m-Y"),
|
||||
'jk' => 'L',
|
||||
'alamat' => $e->getMessage(),
|
||||
'kota' => 'Malang',
|
||||
'nik' => '',
|
||||
'bpjs' => '',
|
||||
]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
public function update(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'nama' => 'required',
|
||||
'jk' => 'required',
|
||||
'tgl_lahir' => 'required',
|
||||
'kota' => 'required',
|
||||
'telpon' => 'required',
|
||||
'alamat' => 'required'
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('id_pasien');
|
||||
$old_date = $request->input('tgl_lahir');
|
||||
$date = date("Y-m-d", strtotime($old_date));
|
||||
$norm = $request->input('norm');
|
||||
$norm = strtoupper($norm);
|
||||
$siapa = Session('nama');
|
||||
$kapan = date('Y-m-d H:i:s');
|
||||
$keterangan = 'Diupdate Oleh '.$siapa.' Pada '.$kapan;
|
||||
try {
|
||||
Pasien::updateOrCreate(
|
||||
[
|
||||
'norm' => $norm,
|
||||
],
|
||||
[
|
||||
'nama' => $request->input('nama'),
|
||||
'jk' => $request->input('jk'),
|
||||
'tgl_lahir' => $date,
|
||||
'telpon' => $request->input('telpon'),
|
||||
'kota' => $request->input('kota'),
|
||||
'alamat' => $request->input('alamat'),
|
||||
'keterangan' => $keterangan
|
||||
]
|
||||
);
|
||||
Session::flash('message', 'Data berhasil disimpan');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
return back();
|
||||
} catch (\Exception $e) {
|
||||
Session::flash('message', $e->getMessage());
|
||||
Session::flash('alert-class', 'alert-succdangeress');
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
public function delete(Request $request) {
|
||||
$id = $request->pasien_id;
|
||||
$pasien = Pasien::find($id);
|
||||
$hapus = $pasien->delete();
|
||||
if ($hapus) {
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Data Deleted..!!!']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'System Down, please try again in a few years....']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Poli;
|
||||
use App\Ruangan;
|
||||
use App\Organisms;
|
||||
|
||||
use Validator;
|
||||
use Session;
|
||||
|
||||
class PoliController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
$data = [];
|
||||
$data['polis'] = Poli::all();
|
||||
$data['ruangans'] = Ruangan::all();
|
||||
return view('admin.poli', $data);
|
||||
}
|
||||
}
|
||||
public function storePoli(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'poli' => 'required',
|
||||
'poli' => 'required',
|
||||
'modaliti' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$poli = $request->input('poli');
|
||||
$subpoli = $request->input('subpoli');
|
||||
$subsubpoli = $request->input('subsubpoli');
|
||||
$modaliti = $request->input('modaliti');
|
||||
Poli::create([
|
||||
'poli' => $request->input('poli'),
|
||||
'subpoli' => $request->input('subpoli'),
|
||||
'subsubpoli'=> $request->input('subsubpoli'),
|
||||
'modaliti' => $request->input('modaliti'),
|
||||
'modaliti2' => $request->input('modaliti2')
|
||||
]);
|
||||
$tulis = 'Data '.$poli.' '.$subpoli.' '.$subsubpoli.' Saved..!!';
|
||||
return response()->json(['status' => 'success', 'message' => $tulis]);
|
||||
}
|
||||
}
|
||||
public function getListPoli() {
|
||||
$results = Poli::orderBy('subpoli', 'ASC')->get();
|
||||
echo json_encode($results);
|
||||
}
|
||||
public function updatePoli(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'id' => 'required',
|
||||
'poli' => 'required',
|
||||
'subpoli' => 'required',
|
||||
'modaliti' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('id');
|
||||
$poli = $request->input('poli');
|
||||
$subpoli = $request->input('subpoli');
|
||||
$subsubpoli = $request->input('subsubpoli');
|
||||
Poli::where('id', $id)->update([
|
||||
'poli' => $poli,
|
||||
'subpoli' => $subpoli,
|
||||
'subsubpoli'=> $subsubpoli,
|
||||
'modaliti' => $request->input('modaliti'),
|
||||
'modaliti2' => $request->input('modaliti2')
|
||||
]);
|
||||
$tulis = 'Data '.$poli.' '.$subpoli.' '.$subsubpoli.' Updated..!!';
|
||||
return response()->json(['status' => 'success', 'message' => $tulis]);
|
||||
}
|
||||
}
|
||||
public function deletePoli(Request $request) {
|
||||
$id = $request->id;
|
||||
$poli = Poli::find($id);
|
||||
$poli->delete();
|
||||
return back();
|
||||
}
|
||||
public function storeRuangan(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'poli' => 'required',
|
||||
'ruangan' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
Ruangan::create([
|
||||
'poli' => $request->input('poli'),
|
||||
'ruangan' => $request->input('ruangan')
|
||||
]);
|
||||
Session::flash('message', 'Data berhasil disimpan');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
return back();
|
||||
}
|
||||
}
|
||||
public function getListRuangan(Request $request) {
|
||||
$results = Ruangan::all();
|
||||
echo json_encode($results);
|
||||
}
|
||||
public function updateRuangan(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'id' => 'required',
|
||||
'poli' => 'required',
|
||||
'ruangan' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('id');
|
||||
Ruangan::where('id', $id)->update([
|
||||
'poli' => $request->input('poli'),
|
||||
'ruangan' => $request->input('ruangan')
|
||||
]);
|
||||
}
|
||||
}
|
||||
public function deleteRuangan(Request $request) {
|
||||
$id = $request->id;
|
||||
$ruangan = Ruangan::find($id);
|
||||
$ruangan->delete();
|
||||
return back();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,309 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\Poli;
|
||||
use App\Logbook;
|
||||
use App\User;
|
||||
use App\Periksa;
|
||||
use App\Dokter;
|
||||
use App\Pasien;
|
||||
use App\Jadwalperiksa;
|
||||
use App\Riwayat;
|
||||
use DateTime;
|
||||
use Carbon\Carbon;
|
||||
use Session;
|
||||
|
||||
class ReportController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
return view('admin.report');
|
||||
}
|
||||
}
|
||||
public function rekapPeriksa(Request $request) {
|
||||
set_time_limit(0);
|
||||
$bulan = $request->input('bulan');
|
||||
$tahun = $request->input('tahun');
|
||||
if ($bulan == 'ALL' || $bulan == 'Pick Month') {
|
||||
$orderbydate = Periksa::selectRaw('SUM(id) as jumlah, DATE(daftar) as day')->whereYear('daftar', $tahun)->groupBy(DB::raw('daftar'))->orderBy('daftar', 'ASC')->get();
|
||||
$bulan = '';
|
||||
} else {
|
||||
$tglcari = $tahun . '-' . str_pad($bulan, 2, '0', STR_PAD_LEFT);
|
||||
$orderbydate = Periksa::selectRaw('SUM(id) as jumlah, DATE(daftar) as day')->where('day', 'LIKE', '%' . $tglcari . '%')->groupBy(DB::raw('daftar'))->orderBy('daftar', 'ASC')->get();
|
||||
$bulanNames = [
|
||||
'01' => 'BULAN JANUARI',
|
||||
'02' => 'BULAN FEBRUARI',
|
||||
'03' => 'BULAN MARET',
|
||||
'04' => 'BULAN APRIL',
|
||||
'05' => 'BULAN MEI',
|
||||
'06' => 'BULAN JUNI',
|
||||
'07' => 'BULAN JULI',
|
||||
'08' => 'BULAN AGUSTUS',
|
||||
'09' => 'BULAN SEPTEMBER',
|
||||
'10' => 'BULAN OKTOBER',
|
||||
'11' => 'BULAN NOVEMBER',
|
||||
'12' => 'BULAN DESEMBER',
|
||||
];
|
||||
$bulan = $bulanNames[$bulan] ?? $bulan;
|
||||
}
|
||||
$data = [];
|
||||
$data['bulan'] = $bulan;
|
||||
$data['tahun'] = $tahun;
|
||||
$data['orderbydate']= $orderbydate;
|
||||
$generatetabel = view('cetak.rekap_periksa_table', $data)->render();
|
||||
echo $generatetabel;
|
||||
}
|
||||
protected static function getPasienData($result) {
|
||||
return [
|
||||
'nama' => $result->nmpasien,
|
||||
'tgl' => $result->tgllahirpasien,
|
||||
'jk' => $result->jkpasien,
|
||||
];
|
||||
}
|
||||
protected static function updateTotals($totals, $asuransi, $urgensi, $jk) {
|
||||
if ($jk == 'L') {
|
||||
$totals['m']++;
|
||||
} else {
|
||||
$totals['f']++;
|
||||
}
|
||||
|
||||
if ($asuransi == 'JKN') {
|
||||
$totals['jkn']++;
|
||||
} elseif ($asuransi == 'Umum') {
|
||||
$totals['umum']++;
|
||||
} elseif ($asuransi == 'TAG') {
|
||||
$totals['tag']++;
|
||||
} elseif ($asuransi == 'GCU') {
|
||||
$totals['gcu']++;
|
||||
} elseif ($asuransi == 'Billing') {
|
||||
$totals['bill']++;
|
||||
} else {
|
||||
$totals['swasta']++;
|
||||
}
|
||||
|
||||
if ($urgensi == 'Elective') {
|
||||
$totals['electiv']++;
|
||||
} else {
|
||||
$totals['cito']++;
|
||||
}
|
||||
|
||||
return $totals;
|
||||
}
|
||||
protected static function mapResultToArray($result) {
|
||||
$nmpasien = $result->nmpasien;
|
||||
$tgl = $result->tgllahirpasien;
|
||||
$jk = $result->jkpasien;
|
||||
$jenis = $result->reques;
|
||||
$tlppasien = $result->tlppasien;
|
||||
$nofoto = $result->nofoto;
|
||||
$verifikasi = $result->verifikasi;
|
||||
$tanggal = $result->daftar;
|
||||
$tanggalfoto = $result->foto;
|
||||
$asuransi = $result->asuransi;
|
||||
$urgensi = $result->urgensi;
|
||||
$from = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $result->daftar);
|
||||
if (is_null($verifikasi)){
|
||||
$verifikasi = '';
|
||||
$to = '';
|
||||
$durasi = 'On Progress';
|
||||
} else {
|
||||
$to = \Carbon\Carbon::createFromFormat('Y-m-d H:i:s', $verifikasi);
|
||||
$durasi = $to->diffForHumans($from);
|
||||
}
|
||||
$arrayttllhr = explode("-", $tgl);
|
||||
if (isset($arrayttllhr[2])){
|
||||
$yy = $arrayttllhr[0];
|
||||
$mm = $arrayttllhr[1];
|
||||
$dd = $arrayttllhr[2];
|
||||
$tgllahir = $dd.'-'.$mm.'-'.$yy;
|
||||
} else { $tgllahir = $tgl; }
|
||||
$arrayttl = explode(" ", $tanggal);
|
||||
$tanggal = $arrayttl[0];
|
||||
if ($jk == 'L') {
|
||||
$l = '1';
|
||||
$p = '';
|
||||
} else {
|
||||
$l = '';
|
||||
$p = '1';
|
||||
}
|
||||
if ($asuransi == 'JKN') {
|
||||
$jkn = '1';
|
||||
$umm = '';
|
||||
$swasta = '';
|
||||
$gcu = '';
|
||||
$tag = '';
|
||||
$bill = '';
|
||||
} else if ($asuransi == 'Umum') {
|
||||
$jkn = '';
|
||||
$umm = '1';
|
||||
$swasta = '';
|
||||
$gcu = '';
|
||||
$tag = '';
|
||||
$bill = '';
|
||||
} else if ($asuransi == 'TAG') {
|
||||
$jkn = '';
|
||||
$umm = '';
|
||||
$swasta = '';
|
||||
$gcu = '';
|
||||
$bill = '';
|
||||
$tag = '1';
|
||||
} else if ($asuransi == 'GCU') {
|
||||
$jkn = '';
|
||||
$umm = '';
|
||||
$swasta = '';
|
||||
$gcu = '1';
|
||||
$tag = '';
|
||||
$bill = '';
|
||||
} else if ($asuransi == 'Billing') {
|
||||
$jkn = '';
|
||||
$umm = '';
|
||||
$swasta = '';
|
||||
$gcu = '';
|
||||
$bill = '1';
|
||||
$tag = '';
|
||||
} else {
|
||||
$jkn = '';
|
||||
$umm = '';
|
||||
$swasta = '1';
|
||||
$gcu = '';
|
||||
$tag = '';
|
||||
$bill = '';
|
||||
}
|
||||
if ($urgensi == 'Elective') {
|
||||
$ele = '1';
|
||||
$cito = '';
|
||||
} else {
|
||||
$ele = '';
|
||||
$cito = '1';
|
||||
}
|
||||
$getjennofoto = explode("-", $nofoto);
|
||||
$jenis = $getjennofoto[0].' '.$jenis;
|
||||
return [
|
||||
'id' => $result->id,
|
||||
'filefoto' => '<a href="' . url('/') . '/hasil/' . $result->nofoto . '" target="_blank">' . $result->nofoto . '</a>',
|
||||
'l' => $l,
|
||||
'p' => $p,
|
||||
'jenis' => $jenis,
|
||||
'jkn' => $jkn,
|
||||
'umm' => $umm,
|
||||
'gcu' => $gcu,
|
||||
'tag' => $tag,
|
||||
'swasta' => $swasta,
|
||||
'billing' => $bill,
|
||||
'ele' => $ele,
|
||||
'cito' => $cito,
|
||||
'asuransi' => $asuransi,
|
||||
'nofoto' => $result->nofoto,
|
||||
'noregister' => $result->noregister,
|
||||
'nmpasien' => $nmpasien,
|
||||
'usia' => $result->usia,
|
||||
'kesimpulan' => $result->kesimpulan,
|
||||
'ruangan' => $result->ruangan,
|
||||
'daftar' => $result->daftar,
|
||||
'created_at' => $result->created_at,
|
||||
'nmdokter' => $result->nmdokter,
|
||||
'nmppdssenior' => $result->nmppdssenior,
|
||||
'nmmiddleppds' => $result->nmmiddleppds,
|
||||
'nmppdsjunior' => $result->nmppdsjunior,
|
||||
'nmppdsmiddle2' => $result->nmppdsmiddle2,
|
||||
'nmppdsjunior2' => $result->nmppdsjunior2,
|
||||
'diagnosa2' => $result->diagnosa2,
|
||||
'nmanalis' => $result->nmanalis,
|
||||
'nmexcutor' => $result->nmexcutor,
|
||||
'alamatpasien' => $result->alamatpasien,
|
||||
'tgllahirpasien'=> $tgl,
|
||||
'jkpasien' => $jk,
|
||||
'tlppasien' => $tlppasien,
|
||||
'modality' => $result->modality,
|
||||
'dlp' => $result->dlp,
|
||||
'kd_spesimen' => $result->kd_spesimen,
|
||||
'nm_spesimen' => $result->nm_spesimen,
|
||||
'status' => $result->status,
|
||||
'asalpasien' => $result->asalpasien,
|
||||
'nmrs' => $result->nmrs,
|
||||
'berat' => $result->berat,
|
||||
'klinisi' => $result->klinisi,
|
||||
'klinis' => $result->klinis,
|
||||
'telpon' => $tlppasien,
|
||||
'verifikasi' => $result->verifikasi,
|
||||
'noloket' => $result->noloket,
|
||||
'foto' => $result->foto,
|
||||
'export' => $result->export,
|
||||
'nmdrafter' => $result->nmdrafter,
|
||||
'tgldraft' => $result->tgldraft,
|
||||
'baca' => $result->baca,
|
||||
'nmpembaca' => $result->nmpembaca,
|
||||
'tgladendum' => $result->tgladendum,
|
||||
'nmadendum' => $result->nmadendum,
|
||||
'durasi' => $durasi,
|
||||
];
|
||||
}
|
||||
protected static function getTotalRow($totals) {
|
||||
return [
|
||||
'id' => '',
|
||||
'filefoto' => '',
|
||||
'noregister'=> '',
|
||||
'nama' => '<strong>Total</strong>',
|
||||
'l' => $totals['m'],
|
||||
'p' => $totals['f'],
|
||||
'jkn' => $totals['jkn'],
|
||||
'umm' => $totals['umum'],
|
||||
'gcu' => $totals['gcu'],
|
||||
'tag' => $totals['tag'],
|
||||
'swasta' => $totals['swasta'],
|
||||
'billing' => $totals['bill'],
|
||||
'ele' => $totals['electiv'],
|
||||
'cito' => $totals['cito'],
|
||||
];
|
||||
}
|
||||
public function report(Request $request) {
|
||||
$bulan = $request->input('bulan');
|
||||
$tahun = $request->input('tahun');
|
||||
$homebase = url("/");
|
||||
$arraylist = [];
|
||||
$limit = $request->input('limit') ?? 500;
|
||||
$page = $request->input('pagenum') ?? 1;
|
||||
$order = $request->input('order') ?? 'id desc';
|
||||
$filterscount = $request->input('filterscount') ?? 0;
|
||||
if ($bulan === 'pertanggal' || $bulan === 'terjadwal') {
|
||||
$results = DB::table($bulan === 'terjadwal' ? 'jadwalperiksan' : 'periksa')->when($bulan === 'terjadwal', function ($query) use ($tahun) {
|
||||
return $query->whereNull('jadwalperiksan.status')
|
||||
->where('jadwalperiksan.daftar', 'LIKE', "%$tahun%");
|
||||
}, function ($query) use ($tahun) {
|
||||
return $query->where('periksa.daftar', 'LIKE', "$tahun%");
|
||||
})->get();
|
||||
$totals = ['m' => 0, 'f' => 0, 'jkn' => 0, 'umum' => 0, 'tag' => 0, 'gcu' => 0, 'bill' => 0, 'swasta' => 0, 'electiv' => 0, 'cito' => 0];
|
||||
foreach ($results as $result) {
|
||||
$asuransi = $result->asuransi;
|
||||
$urgensi = $result->urgensi;
|
||||
$totals = self::updateTotals($totals, $asuransi, $urgensi, $result->jkpasien);
|
||||
$arraylist[] = self::mapResultToArray($result);
|
||||
}
|
||||
if ($bulan === 'pertanggal') {
|
||||
$arraylist[] = self::getTotalRow($totals);
|
||||
}
|
||||
echo json_encode($arraylist);
|
||||
} else {
|
||||
if ($bulan == 'ALL' || $bulan == 'Pick Month') {
|
||||
$results = DB::table('periksa')->where('daftar', 'LIKE', $tahun.'%')->get();
|
||||
} else {
|
||||
$tglcari = $tahun.'-'.$bulan;
|
||||
$results = DB::table('periksa')->where('daftar', 'LIKE', $tglcari.'%')->get();
|
||||
}
|
||||
$totals = ['m' => 0, 'f' => 0, 'jkn' => 0, 'umum' => 0, 'tag' => 0, 'gcu' => 0, 'bill' => 0, 'swasta' => 0, 'electiv' => 0, 'cito' => 0];
|
||||
foreach ($results as $result) {
|
||||
$asuransi = $result->asuransi;
|
||||
$urgensi = $result->urgensi;
|
||||
$totals = self::updateTotals($totals, $asuransi, $urgensi, $result->jkpasien);
|
||||
$arraylist[] = self::mapResultToArray($result);
|
||||
}
|
||||
$arraylist[] = self::getTotalRow($totals);
|
||||
echo json_encode($arraylist);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,263 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Defuse\Crypto\Crypto;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use Illuminate\Support\Facades\File;
|
||||
use App\Models\User;
|
||||
use Mail;
|
||||
use QrCode;
|
||||
use PDFCREATOR;
|
||||
|
||||
define( 'API_ACCESS_SEND', 'AAAA6YBXh1k:APA91bFL0q7QAXQGohXMpTwHco79f13C8PFk1Oo8kKhg1JerOulT9-37dxyP8X5ibABI0NuQ4ZsVxKQKCt7HuR7lUdJJuB-hTVnBmOUIBYfBlHb-Lcp6aGkj4erfF7J__A5hufXjF8Vt' );
|
||||
|
||||
class SendMail extends Controller
|
||||
{
|
||||
protected static $pass = 'S1v3pY0uB3e';
|
||||
protected static function enkrip($string){
|
||||
return Crypto::encryptWithPassword($string,self::$pass);
|
||||
}
|
||||
public static function dekrip($enc){
|
||||
try{
|
||||
return Crypto::decryptWithPassword($enc,self::$pass);
|
||||
}catch (\Exception $e){
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public static function kirim($to_name,$to_email,$forget=false){
|
||||
$date=date('YmdHis');
|
||||
$cekdata = User::where('email', $to_email)->orderBy('id', 'DESC')->first();
|
||||
if (isset($cekdata->id)){
|
||||
if($forget){
|
||||
$string_enc = $to_email.'|'.$date.'|FOR';
|
||||
$url = url('/verifikasiemail').'?key='.self::enkrip($string_enc);
|
||||
$subject = 'Ubah Password ('.$cekdata->fakpanjang.')';
|
||||
$subjectmail = 'Ubah Password';
|
||||
$note = 'Anda telah melakukan permohonan ubah password. Silahkan klik link berikut untuk melanjutkan proses.';
|
||||
DB::table('password_resets')->insert([
|
||||
'email' => $to_email,
|
||||
'token' => self::enkrip($string_enc),
|
||||
'created_at'=> date("Y-m-d H:i:s")
|
||||
]);
|
||||
}else{
|
||||
$string_enc = $to_email.'|'.$date.'|VER';
|
||||
$url = url('/verifikasiemail').'?key='.self::enkrip($string_enc);
|
||||
$subject = 'Verifikasi Email ('.$cekdata->fakpanjang.')';
|
||||
$subjectmail = 'Verifikasi Email';
|
||||
$note = 'Email anda telah terdaftar di Aplikasi ('.$cekdata->fakpanjang.') Email ini dapat digunakan jika anda lupa password. Selanjutnya dimohon Bapak/Ibu membuat password untuk login ke aplikasi dengan cara Klik Tombol di bawah ini.';
|
||||
}
|
||||
$data = array(
|
||||
'nama_lengkap' => $to_name,
|
||||
'fakultas' => $cekdata->fakpanjang,
|
||||
'url_verifikasi' => $url,
|
||||
'forget' => $forget,
|
||||
'subject' => $subjectmail,
|
||||
'note' => $note,
|
||||
);
|
||||
if ($to_email != '[email protected]'){
|
||||
Mail::send('mail/user', $data, function($message) use ($to_name, $to_email, $subject) {
|
||||
$message->to($to_email, $to_name)->subject($subject);
|
||||
$message->from('[email protected]','Mail Admin');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
public static function kirimUser($to_name,$to_email,$to_username,$password,$ubahpass=false){
|
||||
$date=date('YmdHis');
|
||||
$cekdata = User::where('email', $to_email)->first();
|
||||
if (isset($cekdata->id)){
|
||||
if($ubahpass){
|
||||
$subject = 'Password User Diubah ('.$cekdata->fakpanjang.')';
|
||||
$note = 'Password anda telah diubah oleh admin dengan password berikut:';
|
||||
}else{
|
||||
$subject = 'User Didaftarkan ('.$cekdata->fakpanjang.')';
|
||||
$note = 'Email anda telah terdaftar di Aplikasi ('.$cekdata->fakpanjang.'). Email ini dapat digunakan jika anda lupa password. Untuk login silahkan akses dengan user <b>'.$to_username.'</b> atau email ini dan dengan password berikut:';
|
||||
}
|
||||
$data = array(
|
||||
'nama_lengkap' => $to_name,
|
||||
'password' => $password,
|
||||
'subject' => $subject,
|
||||
'note' => $note,
|
||||
);
|
||||
if ($to_email != '[email protected]'){
|
||||
Mail::send('mail/useradmin', $data, function($message) use ($to_name, $to_email, $subject) {
|
||||
$message->to($to_email, $to_name)->subject($subject);
|
||||
$message->from('[email protected]','Mail Admin');
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
public static function notif($to_name,$to_email,$subject,$note){
|
||||
$data = array(
|
||||
'nama_lengkap' => $to_name,
|
||||
'subject' => $subject,
|
||||
'note' => $note,
|
||||
);
|
||||
if ($to_email != '[email protected]'){
|
||||
Mail::send('mail/notif', $data, function($message) use ($to_name, $to_email, $subject) {
|
||||
$message->to($to_email, $to_name)->subject($subject);
|
||||
$message->from('[email protected]','Mail Admin');
|
||||
});
|
||||
}
|
||||
$jtokencari = User::where('email', $to_email)->whereNotNull('firebaseid')->get();
|
||||
if (!empty($jtokencari)){
|
||||
foreach ( $jtokencari as $rtokencari ){
|
||||
$firebaseid = $rtokencari->firebase;
|
||||
$msg = array (
|
||||
'message' => $subject,
|
||||
'title' => Session('namaapps01'),
|
||||
'subtitle' => Session('fakpanjang'),
|
||||
'tickerText'=> 'Notification Centre',
|
||||
'image' => '',
|
||||
'vibrate' => 1,
|
||||
'sound' => 1,
|
||||
'largeIcon' => 'large_icon',
|
||||
'smallIcon' => 'small_icon'
|
||||
);
|
||||
$fields = array
|
||||
(
|
||||
'to' => $firebaseid,
|
||||
'priority' => 'high',
|
||||
'notification' => [
|
||||
"title" => Session('namaapps01'),
|
||||
"sound" => "default",
|
||||
"body" => $subject
|
||||
],
|
||||
'data' => $msg
|
||||
|
||||
);
|
||||
$headers = array
|
||||
(
|
||||
'Authorization: key=' . API_ACCESS_SEND,
|
||||
'Content-Type: application/json'
|
||||
);
|
||||
$url = 'https://fcm.googleapis.com/fcm/send';
|
||||
$ch = curl_init();
|
||||
|
||||
// Set the url, number of POST vars, POST data
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Disabling SSL Certificate support temporarly
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
|
||||
|
||||
// Execute post
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
}
|
||||
}
|
||||
public static function mobilenotif($to_name,$to_email,$subject,$note){
|
||||
$pesan = '';
|
||||
$tuliskirim = $note;
|
||||
if ($to_name == 'all'){
|
||||
$getppds = User::where('previlage', $to_email)->whereNotNull('firebase')->get();
|
||||
if (!empty($getppds)){
|
||||
|
||||
foreach($getppds as $rowsppds){
|
||||
$firebaseid = $rowsppds->firebase;
|
||||
$msg = array (
|
||||
'message' => $tuliskirim,
|
||||
'title' => 'LIS',
|
||||
'subtitle' => 'Laboratory Information System',
|
||||
'tickerText'=> 'Pasien Terkirim ke PACS',
|
||||
'image' => '',
|
||||
'vibrate' => 1,
|
||||
'sound' => 1,
|
||||
'largeIcon' => 'large_icon',
|
||||
'smallIcon' => 'small_icon'
|
||||
);
|
||||
$fields = array
|
||||
(
|
||||
'to' => $firebaseid,
|
||||
'priority' => 'high',
|
||||
'notification' => [
|
||||
"title" => 'LIS-RSSA Notification Control',
|
||||
"sound" => "default",
|
||||
"body" => $tuliskirim
|
||||
],
|
||||
'data' => $msg
|
||||
);
|
||||
$headers = array
|
||||
(
|
||||
'Authorization: key=' . API_ACCESS_KEY,
|
||||
'Content-Type: application/json'
|
||||
);
|
||||
$url = 'https://fcm.googleapis.com/fcm/send';
|
||||
$ch = curl_init();
|
||||
// Set the url, number of POST vars, POST data
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
// Disabling SSL Certificate support temporarly
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
|
||||
// Execute post
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
$pesan = $pesan.'<br />Notif To : '.$rowsppds->nama;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$msg = array (
|
||||
'message' => $tuliskirim,
|
||||
'title' => 'LIS',
|
||||
'subtitle' => 'Laboratory Information System',
|
||||
'tickerText'=> 'Adendum Saved',
|
||||
'image' => '',
|
||||
'vibrate' => 1,
|
||||
'sound' => 1,
|
||||
'largeIcon' => 'large_icon',
|
||||
'smallIcon' => 'small_icon'
|
||||
);
|
||||
$fields = array
|
||||
(
|
||||
'to' => $to_email,
|
||||
'priority' => 'high',
|
||||
'notification' => [
|
||||
"title" => 'LIS-RSSA Notification Control',
|
||||
"sound" => "default",
|
||||
"body" => $tuliskirim
|
||||
],
|
||||
'data' => $msg
|
||||
|
||||
);
|
||||
$headers = array
|
||||
(
|
||||
'Authorization: key=' . API_ACCESS_KEY,
|
||||
'Content-Type: application/json'
|
||||
);
|
||||
$url = 'https://fcm.googleapis.com/fcm/send';
|
||||
$ch = curl_init();
|
||||
|
||||
// Set the url, number of POST vars, POST data
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
|
||||
curl_setopt($ch, CURLOPT_POST, true);
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
|
||||
// Disabling SSL Certificate support temporarly
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
|
||||
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 0);
|
||||
curl_setopt($ch, CURLOPT_IPRESOLVE, CURL_IPRESOLVE_V4 );
|
||||
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($fields));
|
||||
|
||||
// Execute post
|
||||
$result = curl_exec($ch);
|
||||
curl_close($ch);
|
||||
}
|
||||
return $pesan;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
use App\Jawaban;
|
||||
use App\Subjawaban;
|
||||
use App\SiraB;
|
||||
use App\Organisms;
|
||||
|
||||
use Validator;
|
||||
use Picqer\Barcode\BarcodeGeneratorPNG;
|
||||
use Session;
|
||||
|
||||
class TemplateController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
$data = [];
|
||||
return view('admin.template', $data);
|
||||
}
|
||||
}
|
||||
public function viewSIRAb() {
|
||||
$previlage = Session('previlage');
|
||||
if ($previlage == 'developer' OR $previlage == 'supervisor') {
|
||||
$data = [];
|
||||
return view('admin.sirab', $data);
|
||||
} else {
|
||||
$data = [];
|
||||
$data['kalimatheader'] = 'Access Denied';
|
||||
$data['kalimatbody'] = 'Laman khusus SPV';
|
||||
return view('errors.error', $data);
|
||||
}
|
||||
}
|
||||
public function backup() {
|
||||
$previlage = Session('previlage');
|
||||
if ($previlage == 'developer' OR $previlage == 'supervisor') {
|
||||
$data = [];
|
||||
$data['alldata'] = Storage::allFiles('/usr/share/nginx/html/rispacs/public/backupdata');
|
||||
return view('backup', $data);
|
||||
} else {
|
||||
$data = [];
|
||||
$data['kalimatheader'] = 'Access Denied';
|
||||
$data['kalimatbody'] = 'Laman khusus SPV';
|
||||
return view('errors.error', $data);
|
||||
}
|
||||
}
|
||||
public function getListJawaban() {
|
||||
$results = DB::table('jawaban')->get();
|
||||
$arraylist = [];
|
||||
$arraylist[]= array(
|
||||
'id' => 'new',
|
||||
'jawaban' => '<span class="badge badge-primary">Add New</span>'
|
||||
);
|
||||
foreach ($results as $result) {
|
||||
$arraylist[] = array(
|
||||
'id' => $result->id,
|
||||
'jawaban' => $result->jawaban,
|
||||
);
|
||||
}
|
||||
|
||||
echo json_encode($arraylist);
|
||||
}
|
||||
public function updateJawaban(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'val01' => 'required',
|
||||
'val02' => 'required'
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('val02');
|
||||
if ($id != 'new'){
|
||||
Jawaban::where('id', $id)->update(['jawaban' => $request->input('val01')]);
|
||||
}
|
||||
else {
|
||||
Jawaban::create(['jawaban' => $request->input('val01')]);
|
||||
}
|
||||
return response()->json(['status' => 'Success !!', 'message' => 'Category Saved..!!']);
|
||||
}
|
||||
}
|
||||
public function deleteJawaban(Request $request) {
|
||||
try {
|
||||
$id = $request->id;
|
||||
if ($id == 'sirab'){
|
||||
$data = SiraB::find($request->idsirab);
|
||||
} else if ($id == 'mikroorganisme'){
|
||||
$data = Organisms::find($request->idsirab);
|
||||
} else {
|
||||
$data = Jawaban::find($id);
|
||||
}
|
||||
$data->delete();
|
||||
if ($data){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Deleted']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => $e->getMessage()]);
|
||||
return back();
|
||||
}
|
||||
|
||||
}
|
||||
public function getListSubjawaban(Request $request) {
|
||||
$idkat = $request->input('val01');
|
||||
$kategori = $request->input('val02');
|
||||
if ($idkat == 'new') {
|
||||
$arraylist = [];
|
||||
$arraylist[]= array(
|
||||
'id' => 'gakboleh',
|
||||
'kategori' => '-',
|
||||
'judul' => '<span class="badge badge-danger">Please Select Category First</span>',
|
||||
'isine' => '-',
|
||||
'kesimpulan'=> '-'
|
||||
);
|
||||
} else {
|
||||
$arraylist = [];
|
||||
$arraylist[]= array(
|
||||
'id' => 'new',
|
||||
'kategori' => '-',
|
||||
'judul' => '<span class="badge badge-custom">Add New Expertise Themplate</span>',
|
||||
'isine' => '-',
|
||||
'kesimpulan'=> '-'
|
||||
);
|
||||
$results = Subjawaban::where('kategori', $idkat)->get();
|
||||
|
||||
foreach ($results as $result) {
|
||||
$isine = $result->subjawaban;
|
||||
$kesimpulan = $result->kesimpulan;
|
||||
$isine = $isine.' '.$kesimpulan;
|
||||
$arraylist[] = array(
|
||||
'id' => $result->id,
|
||||
'kategori' => $kategori,
|
||||
'judul' => $result->judul,
|
||||
'isine' => $isine,
|
||||
'kesimpulan'=> ''
|
||||
);
|
||||
}
|
||||
}
|
||||
echo json_encode($arraylist);
|
||||
}
|
||||
public function updateSubjawaban(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'val01' => 'required',
|
||||
'val02' => 'required',
|
||||
'val03' => 'required',
|
||||
'val04' => 'required'
|
||||
]);
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'Error !!', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('val02');
|
||||
if ($id != 'new'){
|
||||
Subjawaban::where('id', $id)->update([
|
||||
'judul' => $request->input('val03'),
|
||||
'subjawaban'=> $request->input('val04'),
|
||||
'kesimpulan'=> ''
|
||||
]);
|
||||
}
|
||||
else {
|
||||
Subjawaban::create([
|
||||
'kategori' => $request->input('val01'),
|
||||
'judul' => $request->input('val03'),
|
||||
'subjawaban'=> $request->input('val04'),
|
||||
'kesimpulan'=> ''
|
||||
]);
|
||||
}
|
||||
return response()->json(['status' => 'Success !!', 'message' => 'Template Saved..!!']);
|
||||
|
||||
}
|
||||
}
|
||||
public function deleteSubjawaban(Request $request) {
|
||||
$id = $request->id;
|
||||
$subjawaban = Subjawaban::find($id);
|
||||
|
||||
$subjawaban->delete();
|
||||
|
||||
return back();
|
||||
}
|
||||
public function showImage($imageName){
|
||||
// Menentukan path gambar di storage
|
||||
$filePath = public_path("{$imageName}");
|
||||
|
||||
// Cek apakah file ada
|
||||
if (!file_exists($filePath)) {
|
||||
abort(404); // Jika file tidak ditemukan, tampilkan error 404
|
||||
}
|
||||
|
||||
// Ambil konten file gambar
|
||||
$imageContent = file_get_contents($filePath);
|
||||
|
||||
// Tentukan MIME type untuk gambar PNG
|
||||
$mimeType = mime_content_type($filePath);
|
||||
|
||||
// Kirim gambar sebagai response dengan header untuk mencegah cache
|
||||
return response($imageContent, 200)
|
||||
->header('Content-Type', $mimeType) // Tentukan MIME type gambar
|
||||
->header('Cache-Control', 'no-store, no-cache, must-revalidate') // Tidak cache di browser
|
||||
->header('Pragma', 'no-cache') // Tidak menggunakan cache pada browser lama
|
||||
->header('Expires', '0'); // Jangan pernah kadaluarsa
|
||||
}
|
||||
public function exUploadKOP(Request $request) {
|
||||
if($request->hasFile('file')) {
|
||||
$ImageExt = $request->file('file')->getClientOriginalExtension();
|
||||
$file_tmp = $request->file('file');
|
||||
$data = file_get_contents($file_tmp);
|
||||
if ($ImageExt == 'png'){
|
||||
try {
|
||||
$unggah = Storage::disk('langsungpublic')->put('kopsurat.png', $data);
|
||||
|
||||
if ($unggah){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Pictures Saved, please refresh to apply the change']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => $e->getMessage()]);
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Only Accept PNG File']);
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'No File Selected']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
public function showBarcode($nofoto){
|
||||
$generator = new BarcodeGeneratorPNG();
|
||||
$barcodeImage = $generator->getBarcode($nofoto, $generator::TYPE_CODE_128);
|
||||
return response($barcodeImage, 200)->header('Content-Type', 'image/png');
|
||||
}
|
||||
public function exSIRAb(Request $request) {
|
||||
try {
|
||||
$id = $request->id;
|
||||
$tabel = $request->tabel;
|
||||
$pesan = 'Unkown Error';
|
||||
if ($tabel == 'Organisme'){
|
||||
if ($id == 'new'){
|
||||
$ceksudah = Organisms::where('name', $request->name)->where('category', $request->category)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = new Organisms;
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->fill($inputData);
|
||||
$data->save();
|
||||
} else {
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
} else {
|
||||
$ceksudah = Organisms::where('id', '!=', $id)->where('name', $request->name)->where('category', $request->category)->where('kelompok', $request->kelompok)->count();
|
||||
if ($ceksudah == 0){
|
||||
$data = Organisms::find($id);
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->update($inputData);
|
||||
} else {
|
||||
$pesan = $request->name.' ('.$request->category.') Sudah ada, Mohon ubah Data sebelum simpan kembali';
|
||||
}
|
||||
}
|
||||
if ($data){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Saved']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
if ($id == 'new'){
|
||||
$data = new SiraB;
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->fill($inputData);
|
||||
$data->save();
|
||||
} else {
|
||||
$data = SiraB::find($id);
|
||||
$inputData = $request->except(['id', 'tabel', '_token']);
|
||||
$data->update($inputData);
|
||||
}
|
||||
if ($data){
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Saved']);
|
||||
return back();
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => 'Unkown Error']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Failed', 'message' => $e->getMessage()]);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,299 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use App\User;
|
||||
use App\Setting;
|
||||
use App\Dokter;
|
||||
use App\Worklist;
|
||||
use App\XFiles;
|
||||
use Validator;
|
||||
use Session;
|
||||
|
||||
class UserController extends Controller
|
||||
{
|
||||
public function index() {
|
||||
$cekkelompok= Session('previlage');
|
||||
if (Session::get('previlage') == ''){
|
||||
return redirect('/login');
|
||||
} else {
|
||||
if ($cekkelompok == 'supervisor' OR $cekkelompok == 'admin' OR $cekkelompok == 'developer'){
|
||||
$users = User::all();
|
||||
} else {
|
||||
$users = User::where('previlage', $cekkelompok)->get();
|
||||
}
|
||||
$getsetting = Setting::where('id', '1')->first();
|
||||
$data = [];
|
||||
$data['users'] = $users;
|
||||
$data['pacsaddr'] = $getsetting->pacs ?? '';
|
||||
$data['zfpaddr'] = $getsetting->zfp ?? '';
|
||||
$data['port'] = $getsetting->port ?? '';
|
||||
$data['portzfp'] = $getsetting->portzfp ?? '';
|
||||
$data['username'] = $getsetting->username ?? '';
|
||||
$data['password'] = $getsetting->password ?? '';
|
||||
return view('admin.user', $data);
|
||||
}
|
||||
}
|
||||
public function exSetting(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'val01' => 'required',
|
||||
'val02' => 'required',
|
||||
'val03' => 'required',
|
||||
'val04' => 'required',
|
||||
'val05' => 'required',
|
||||
'val06' => 'required',
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$update = Setting::where('id', '1')->update([
|
||||
'pacs' => $request->input('val01'),
|
||||
'zfp' => $request->input('val02'),
|
||||
'port' => $request->input('val03'),
|
||||
'portzfp' => $request->input('val06'),
|
||||
'username' => $request->input('val04'),
|
||||
'password' => $request->input('val05')
|
||||
]);
|
||||
if ($update) {
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Setting Saved..!!!']);
|
||||
return back();
|
||||
}
|
||||
else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'System Down, please try again in a few years....']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
public function exSettingworklist(Request $request) {
|
||||
$idne = $request->input('val01');
|
||||
if ($idne == 'delete'){
|
||||
$delete = Worklist::where('id', $request->input('val02'))->delete();
|
||||
if ($delete) {
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Worklist Deleted..!!!']);
|
||||
return back();
|
||||
}
|
||||
else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'System Down, please try again in a few years....']);
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'val01' => 'required',
|
||||
'val02' => 'required',
|
||||
'val03' => 'required',
|
||||
'val04' => 'required',
|
||||
'val05' => 'required',
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
|
||||
if ($idne == 'new'){
|
||||
$input = Worklist::create([
|
||||
'aetitle' => $request->input('val05'),
|
||||
'portnumber' => $request->input('val04'),
|
||||
'ipaddress' => $request->input('val02'),
|
||||
'location' => $request->input('val03'),
|
||||
'modaliti' => $request->input('val06')
|
||||
]);
|
||||
} else {
|
||||
$input = Worklist::where('id', $idne)->update([
|
||||
'aetitle' => $request->input('val05'),
|
||||
'portnumber' => $request->input('val04'),
|
||||
'ipaddress' => $request->input('val02'),
|
||||
'location' => $request->input('val03'),
|
||||
'modaliti' => $request->input('val06')
|
||||
]);
|
||||
}
|
||||
if ($input) {
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Worklist Saved..!!!']);
|
||||
return back();
|
||||
}
|
||||
else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'System Down, please try again in a few years....']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
public function exTtd(Request $request) {
|
||||
$iduser = Session('id');
|
||||
$marking = Session('username').'-Photo-'.$iduser;
|
||||
$update = XFiles::updateOrCreate(
|
||||
[
|
||||
'xmarking' => $marking,
|
||||
],
|
||||
[
|
||||
'xjenis' => 'Tandatangan',
|
||||
'xtabel' => Session('username'),
|
||||
'xfile' => $request->input('val01')
|
||||
]
|
||||
);
|
||||
if ($update) {
|
||||
User::where('id', $iduser)->update([
|
||||
'tandatangan' => $marking,
|
||||
]);
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Signature Saved..!!!']);
|
||||
return back();
|
||||
}
|
||||
else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'System Down, please try again in a few years....']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
public function store(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'nama' => 'required',
|
||||
'username' => 'required',
|
||||
'password' => 'required',
|
||||
'previlage' => 'required',
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
Session::flash('message', 'Please fill input field or fill with right input');
|
||||
Session::flash('alert-class', 'alert-danger');
|
||||
return back();
|
||||
} else {
|
||||
$username = $request->input('username');
|
||||
$previlage = $request->input('previlage');
|
||||
$nama = $request->input('nama');
|
||||
$cekuser = User::where('username', $username)->count();
|
||||
if ($cekuser == 0){
|
||||
if ($previlage == 'supervisor' OR $previlage == 'developer'){
|
||||
$iduser = User::insertGetId([
|
||||
'nama' => $request->input('nama'),
|
||||
'username' => $request->input('username'),
|
||||
'password' => bcrypt($request->input('password')),
|
||||
'previlage' => $request->input('previlage')
|
||||
]);
|
||||
Dokter::create([
|
||||
'id' => $iduser,
|
||||
'nama' => $request->input('nama'),
|
||||
'kota' => config('global.kota'),
|
||||
'alamat' => config('global.addressapps')
|
||||
]);
|
||||
} else {
|
||||
$user = User::create([
|
||||
'nama' => $request->input('nama'),
|
||||
'username' => $request->input('username'),
|
||||
'password' => bcrypt($request->input('password')),
|
||||
'previlage' => $request->input('previlage')
|
||||
]);
|
||||
}
|
||||
Session::flash('message', 'Username for '.$nama.' Saved');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
return back();
|
||||
} else {
|
||||
Session::flash('message', 'Username already used, please use another username');
|
||||
Session::flash('alert-class', 'alert-danger');
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
public function getUser(Request $request) {
|
||||
$id = $request->input('id');
|
||||
$result = User::where('id', $id)->first();
|
||||
echo json_encode($result);
|
||||
}
|
||||
public function getWorklist() {
|
||||
$arrworklist = [];
|
||||
$getworklist = Worklist::orderBy('location', 'ASC')->get();
|
||||
foreach ($getworklist as $rowida) {
|
||||
$arrworklist[] = array(
|
||||
'id' => $rowida->id,
|
||||
'aetitle' => $rowida->aetitle,
|
||||
'portnumber' => $rowida->portnumber,
|
||||
'ipaddress' => $rowida->ipaddress,
|
||||
'location' => $rowida->location,
|
||||
'modaliti' => $rowida->modaliti,
|
||||
);
|
||||
}
|
||||
echo json_encode($arrworklist);
|
||||
}
|
||||
public function update(Request $request) {
|
||||
$validator = Validator::make($request->all(), [
|
||||
'nama' => 'required',
|
||||
'username' => 'required',
|
||||
'previlage' => 'required'
|
||||
]);
|
||||
|
||||
if($validator->fails()) {
|
||||
return response()->json(['status' => 'error', 'message' => 'Please fill input field or fill with right input']);
|
||||
} else {
|
||||
$id = $request->input('id_user');
|
||||
$password = $request->input('password');
|
||||
if ($password == ''){
|
||||
$update = User::where('id', $id)->update([
|
||||
'nama' => $request->input('nama'),
|
||||
'username' => $request->input('username'),
|
||||
'previlage' => $request->input('previlage')
|
||||
]);
|
||||
} else {
|
||||
$update = User::where('id', $id)->update([
|
||||
'nama' => $request->input('nama'),
|
||||
'username' => $request->input('username'),
|
||||
'password' => bcrypt($request->input('password')),
|
||||
'previlage' => $request->input('previlage')
|
||||
]);
|
||||
}
|
||||
|
||||
if ($update){
|
||||
Session::flash('message', 'Updated');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
|
||||
return back();
|
||||
} else {
|
||||
Session::flash('message', 'Update Failed, Please Try Again in a few year');
|
||||
Session::flash('alert-class', 'alert-success');
|
||||
|
||||
return back();
|
||||
}
|
||||
}
|
||||
}
|
||||
public function updateFoto(Request $request) {
|
||||
$iduser = Session('id');
|
||||
$marking = Session('username').'-Photo-'.$iduser;
|
||||
if($request->hasFile('file')) {
|
||||
$ImageExt = $request->file('file')->getClientOriginalExtension();
|
||||
$file_tmp = $request->file('file');
|
||||
$data = file_get_contents($file_tmp);
|
||||
$photo = 'data:image/' . $ImageExt . ';base64,' . base64_encode($data);
|
||||
$iduser = Session('id');
|
||||
$update = XFiles::updateOrCreate(
|
||||
[
|
||||
'xmarking' => $marking,
|
||||
],
|
||||
[
|
||||
'xtabel' => Session('username'),
|
||||
'xjenis' => 'Photo',
|
||||
'xfile' => $photo
|
||||
]
|
||||
);
|
||||
if ($update) {
|
||||
User::where('id', $iduser)->update([
|
||||
'photo' => $marking,
|
||||
]);
|
||||
return response()->json(['icon' => 'success', 'warna' => '#5ba035', 'status' => 'Success', 'message' => 'Photo Profile Saved, please relogin to apply the change']);
|
||||
return back();
|
||||
}
|
||||
else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'System Down, please try again in a few years....']);
|
||||
return back();
|
||||
}
|
||||
} else {
|
||||
return response()->json(['icon' => 'error', 'warna' => '#bf441d', 'status' => 'Error.!!', 'message' => 'No File Selected']);
|
||||
return back();
|
||||
}
|
||||
}
|
||||
public function delete(Request $request) {
|
||||
$id = $request->user_id;
|
||||
$user = User::find($id);
|
||||
XFiles::where('xtabel', $user->username)->delete();
|
||||
$user->delete();
|
||||
return back();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,82 @@
|
||||
<?php
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use Ratchet\MessageComponentInterface;
|
||||
use Ratchet\ConnectionInterface;
|
||||
use App\Iseng;
|
||||
|
||||
class WebSocketController extends Controller implements MessageComponentInterface{
|
||||
private $connections = [];
|
||||
|
||||
/**
|
||||
* When a new connection is opened it will be passed to this method
|
||||
* @param ConnectionInterface $conn The socket/connection that just connected to your application
|
||||
* @throws \Exception
|
||||
*/
|
||||
function onOpen(ConnectionInterface $conn){
|
||||
$this->connections[$conn->resourceId] = compact('conn') + ['user_id' => null];
|
||||
}
|
||||
|
||||
/**
|
||||
* This is called before or after a socket is closed (depends on how it's closed). SendMessage to $conn will not result in an error if it has already been closed.
|
||||
* @param ConnectionInterface $conn The socket/connection that is closing/closed
|
||||
* @throws \Exception
|
||||
*/
|
||||
function onClose(ConnectionInterface $conn){
|
||||
$disconnectedId = $conn->resourceId;
|
||||
unset($this->connections[$disconnectedId]);
|
||||
foreach($this->connections as &$connection)
|
||||
$connection['conn']->send(json_encode([
|
||||
'offline_user' => $disconnectedId,
|
||||
'from_user_id' => 'server control',
|
||||
'from_resource_id' => null
|
||||
]));
|
||||
}
|
||||
|
||||
/**
|
||||
* If there is an error with one of the sockets, or somewhere in the application where an Exception is thrown,
|
||||
* the Exception is sent back down the stack, handled by the Server and bubbled back up the application through this method
|
||||
* @param ConnectionInterface $conn
|
||||
* @param \Exception $e
|
||||
* @throws \Exception
|
||||
*/
|
||||
function onError(ConnectionInterface $conn, \Exception $e){
|
||||
$userId = $this->connections[$conn->resourceId]['user_id'];
|
||||
echo "An error has occurred with user $userId: {$e->getMessage()}\n";
|
||||
unset($this->connections[$conn->resourceId]);
|
||||
$conn->close();
|
||||
}
|
||||
|
||||
/**
|
||||
* Triggered when a client sends data through the socket
|
||||
* @param \Ratchet\ConnectionInterface $conn The socket/connection that sent the message to your application
|
||||
* @param string $msg The message received
|
||||
* @throws \Exception
|
||||
*/
|
||||
function onMessage(ConnectionInterface $conn, $msg){
|
||||
$msg = json_decode($msg, true);
|
||||
$konten = $msg['content'];
|
||||
Iseng::insert([
|
||||
'msg' => $konten
|
||||
]);
|
||||
|
||||
// if(is_null($this->connections[$conn->resourceId]['user_id'])){
|
||||
// $this->connections[$conn->resourceId]['user_id'] = $msg;
|
||||
// $onlineUsers = [];
|
||||
// foreach($this->connections as $resourceId => &$connection){
|
||||
// $connection['conn']->send(json_encode([$conn->resourceId => $msg]));
|
||||
// if($conn->resourceId != $resourceId)
|
||||
// $onlineUsers[$resourceId] = $connection['user_id'];
|
||||
// }
|
||||
// $conn->send(json_encode(['online_users' => $onlineUsers]));
|
||||
// } else{
|
||||
// $fromUserId = $this->connections[$conn->resourceId]['user_id'];
|
||||
// $msg = json_decode($msg, true);
|
||||
// $this->connections[$msg['to']]['conn']->send(json_encode([
|
||||
// 'msg' => $msg['content'],
|
||||
// 'from_user_id' => $fromUserId,
|
||||
// 'from_resource_id' => $conn->resourceId
|
||||
// ]));
|
||||
// }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http;
|
||||
|
||||
use Illuminate\Foundation\Http\Kernel as HttpKernel;
|
||||
|
||||
class Kernel extends HttpKernel
|
||||
{
|
||||
/**
|
||||
* The application's global HTTP middleware stack.
|
||||
*
|
||||
* These middleware are run during every request to your application.
|
||||
*
|
||||
* @var array<int, class-string|string>
|
||||
*/
|
||||
protected $middleware = [
|
||||
// \App\Http\Middleware\TrustHosts::class,
|
||||
\App\Http\Middleware\TrustProxies::class,
|
||||
\Illuminate\Http\Middleware\HandleCors::class,
|
||||
\App\Http\Middleware\PreventRequestsDuringMaintenance::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
|
||||
\App\Http\Middleware\TrimStrings::class,
|
||||
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's route middleware groups.
|
||||
*
|
||||
* @var array<string, array<int, class-string|string>>
|
||||
*/
|
||||
protected $middlewareGroups = [
|
||||
'web' => [
|
||||
\App\Http\Middleware\EncryptCookies::class,
|
||||
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
|
||||
\Illuminate\Session\Middleware\StartSession::class,
|
||||
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
|
||||
\App\Http\Middleware\VerifyCsrfToken::class,
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
|
||||
'api' => [
|
||||
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
|
||||
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
|
||||
\Illuminate\Routing\Middleware\SubstituteBindings::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* The application's middleware aliases.
|
||||
*
|
||||
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
|
||||
*
|
||||
* @var array<string, class-string|string>
|
||||
*/
|
||||
protected $middlewareAliases = [
|
||||
'project.ipg' => \App\Http\Middleware\Login::class,
|
||||
'auth' => \App\Http\Middleware\Authenticate::class,
|
||||
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
|
||||
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
|
||||
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
|
||||
'can' => \Illuminate\Auth\Middleware\Authorize::class,
|
||||
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
|
||||
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
|
||||
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
|
||||
'signed' => \App\Http\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Auth\Middleware\Authenticate as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class Authenticate extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the path the user should be redirected to when they are not authenticated.
|
||||
*/
|
||||
protected function redirectTo(Request $request): ?string
|
||||
{
|
||||
return $request->expectsJson() ? null : route('login');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
|
||||
|
||||
class EncryptCookies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the cookies that should not be encrypted.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Closure;
|
||||
use Carbon\Carbon;
|
||||
|
||||
class Login
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
$response = $next($request);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
public function terminate($request, $response)
|
||||
{
|
||||
if (! \Auth::check())
|
||||
return;
|
||||
|
||||
$user = \Auth::user();
|
||||
|
||||
if (!$user->session_id) {
|
||||
$user->session_id = \Session::getId();
|
||||
$user->last_activity = Carbon::now();
|
||||
$user->save();
|
||||
}
|
||||
else {
|
||||
$last_session = \Session::getHandler()->read($user->session_id);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance as Middleware;
|
||||
|
||||
class PreventRequestsDuringMaintenance extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be reachable while maintenance mode is enabled.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
//
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Providers\RouteServiceProvider;
|
||||
use Closure;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class RedirectIfAuthenticated
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
|
||||
*/
|
||||
public function handle(Request $request, Closure $next, string ...$guards): Response
|
||||
{
|
||||
$guards = empty($guards) ? [null] : $guards;
|
||||
|
||||
foreach ($guards as $guard) {
|
||||
if (Auth::guard($guard)->check()) {
|
||||
return redirect(RouteServiceProvider::HOME);
|
||||
}
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
|
||||
|
||||
class TrimStrings extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the attributes that should not be trimmed.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'current_password',
|
||||
'password',
|
||||
'password_confirmation',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustHosts as Middleware;
|
||||
|
||||
class TrustHosts extends Middleware
|
||||
{
|
||||
/**
|
||||
* Get the host patterns that should be trusted.
|
||||
*
|
||||
* @return array<int, string|null>
|
||||
*/
|
||||
public function hosts(): array
|
||||
{
|
||||
return [
|
||||
$this->allSubdomainsOfApplicationUrl(),
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Http\Middleware\TrustProxies as Middleware;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class TrustProxies extends Middleware
|
||||
{
|
||||
/**
|
||||
* The trusted proxies for this application.
|
||||
*
|
||||
* @var array<int, string>|string|null
|
||||
*/
|
||||
protected $proxies;
|
||||
|
||||
/**
|
||||
* The headers that should be used to detect proxies.
|
||||
*
|
||||
* @var int
|
||||
*/
|
||||
protected $headers =
|
||||
Request::HEADER_X_FORWARDED_FOR |
|
||||
Request::HEADER_X_FORWARDED_HOST |
|
||||
Request::HEADER_X_FORWARDED_PORT |
|
||||
Request::HEADER_X_FORWARDED_PROTO |
|
||||
Request::HEADER_X_FORWARDED_AWS_ELB;
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Routing\Middleware\ValidateSignature as Middleware;
|
||||
|
||||
class ValidateSignature extends Middleware
|
||||
{
|
||||
/**
|
||||
* The names of the query string parameters that should be ignored.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
// 'fbclid',
|
||||
// 'utm_campaign',
|
||||
// 'utm_content',
|
||||
// 'utm_medium',
|
||||
// 'utm_source',
|
||||
// 'utm_term',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
|
||||
|
||||
class VerifyCsrfToken extends Middleware
|
||||
{
|
||||
/**
|
||||
* The URIs that should be excluded from CSRF verification.
|
||||
*
|
||||
* @var array<int, string>
|
||||
*/
|
||||
protected $except = [
|
||||
'registerpasien', 'registerjson', 'ekstrakhasil', 'prosesbatal'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,4 @@
|
||||
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Iseng extends Model { protected $table = "tabeliseng"; public $timestamps = false;
|
||||
protected $fillable = [
|
||||
'msg' ];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Jadwalperiksa extends Model
|
||||
{
|
||||
protected $table = "jadwalperiksan";
|
||||
protected $fillable = [
|
||||
'id','mulai', 'akhir', 'nofoto', 'noregister', 'asalpasien', 'nmrs', 'pasien_id', 'reques', 'usia', 'berat', 'ruangan_id', 'ruangan', 'dokter_id', 'ppdssenior', 'middleppds', 'ppdsjunior', 'radiografer', 'excutor', 'klinisi', 'klinis', 'poli_id', 'keterangan', 'kesimpulan', 'asuransi', 'urgensi', 'diagnosa', 'modality', 'kilovolt', 'mas', 'dlp', 'daftar', 'foto', 'baca', 'verifikasi', 'export', 'filefoto', 'status',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Jawaban extends Model
|
||||
{
|
||||
protected $table = "jawaban";
|
||||
protected $fillable = [
|
||||
'jawaban'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class KomponenJawaban extends Model
|
||||
{
|
||||
protected $table = "db_komponenjawaban";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Logbook extends Model
|
||||
{
|
||||
protected $table = "db_logbooklist";
|
||||
protected $fillable = [
|
||||
'id', 'kelompok', 'kode', 'kepanjangan', 'kuota', 'target', 'kuota2', 'target2', 'kuota3', 'target3'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Chatify\Traits\UUID;
|
||||
|
||||
class ChFavorite extends Model
|
||||
{
|
||||
use UUID;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Chatify\Traits\UUID;
|
||||
|
||||
class ChMessage extends Model
|
||||
{
|
||||
use UUID;
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'nama', 'username', 'password', 'previlage', 'tandatangan', 'photo', 'firebase'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password'
|
||||
];
|
||||
public function getPhoto()
|
||||
{
|
||||
return $this->hasOne('App\XFiles','xmarking','photo');
|
||||
}
|
||||
public function getTandatangan()
|
||||
{
|
||||
return $this->hasOne('App\XFiles','xmarking','tandatangan');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Organisms extends Model
|
||||
{
|
||||
protected $table = "organisms";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Pasien extends Model
|
||||
{
|
||||
protected $table = "pasien";
|
||||
protected $fillable = [
|
||||
'norm',
|
||||
'nama',
|
||||
'jk',
|
||||
'tgl_lahir',
|
||||
'kota',
|
||||
'telpon',
|
||||
'alamat',
|
||||
'keterangan'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
|
||||
class PatientSample extends Model
|
||||
{
|
||||
use HasFactory;
|
||||
protected $table = "resultraw";
|
||||
|
||||
protected $fillable = [
|
||||
'vendor',
|
||||
'version',
|
||||
'patient_id',
|
||||
'patient_name',
|
||||
'sample_code',
|
||||
'barcode',
|
||||
'test_type',
|
||||
'inst_result',
|
||||
'collection_time',
|
||||
'report_time',
|
||||
'test_id',
|
||||
'start_time',
|
||||
'end_time',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PendaftaranOnListiner extends Model
|
||||
{
|
||||
protected $connection = 'mysqllistener';
|
||||
protected $primaryKey = "rnoreg";
|
||||
protected $table = "paslab";
|
||||
public $timestamps = false;
|
||||
protected $guarded = [];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Periksa extends Model
|
||||
{
|
||||
protected $table = "periksa";
|
||||
protected $guarded = [];
|
||||
public function getMiddlePpdskedua()
|
||||
{
|
||||
return $this->hasOne('App\Models\User','id','middleppds2');
|
||||
}
|
||||
public function getJuniorPpdskedua()
|
||||
{
|
||||
return $this->hasOne('App\Models\User','id','ppdsjunior2');
|
||||
}
|
||||
public function getNmRadiografer()
|
||||
{
|
||||
return $this->hasOne('App\Models\User','id','radiografer');
|
||||
}
|
||||
public function getNmExcutor()
|
||||
{
|
||||
return $this->hasOne('App\Models\User','id','excutor');
|
||||
}
|
||||
public function getNmDokter()
|
||||
{
|
||||
return $this->hasOne('App\Models\User','id','dokter_id');
|
||||
}
|
||||
public function getNmPPDSSenior()
|
||||
{
|
||||
return $this->hasOne('App\Models\User','id','ppdssenior');
|
||||
}
|
||||
public function getPasien()
|
||||
{
|
||||
return $this->hasOne('App\Pasien','id','pasien_id');
|
||||
}
|
||||
public function getPoli()
|
||||
{
|
||||
return $this->hasOne('App\Poli','id','poli_id');
|
||||
}
|
||||
public function getRuangan()
|
||||
{
|
||||
return $this->hasOne('App\Ruangan','id','ruangan_id');
|
||||
}
|
||||
public function getTandatangan()
|
||||
{
|
||||
return $this->hasOne('App\XFiles','xmarking','tandatangan');
|
||||
}
|
||||
public function getLogbook()
|
||||
{
|
||||
return $this->hasOne('App\Logbook','id','diagnosa');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PeriksaSYNC extends Model
|
||||
{
|
||||
protected $table = "db_syncinsitu";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class PeriksaTest extends Model
|
||||
{
|
||||
protected $table = "periksa_testing";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Poli extends Model
|
||||
{
|
||||
protected $table = "poli";
|
||||
protected $fillable = [
|
||||
'poli',
|
||||
'subpoli',
|
||||
'subsubpoli',
|
||||
'modaliti',
|
||||
'modaliti2',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Register any application services.
|
||||
*/
|
||||
public function register(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
// use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The model to policy mappings for the application.
|
||||
*
|
||||
* @var array<class-string, class-string>
|
||||
*/
|
||||
protected $policies = [
|
||||
//
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any authentication / authorization services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\Broadcast;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
class BroadcastServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* Bootstrap any application services.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
Broadcast::routes();
|
||||
|
||||
require base_path('routes/channels.php');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Auth\Events\Registered;
|
||||
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
|
||||
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
|
||||
class EventServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The event to listener mappings for the application.
|
||||
*
|
||||
* @var array<class-string, array<int, class-string>>
|
||||
*/
|
||||
protected $listen = [
|
||||
Registered::class => [
|
||||
SendEmailVerificationNotification::class,
|
||||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* Register any events for your application.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
}
|
||||
|
||||
/**
|
||||
* Determine if events and listeners should be automatically discovered.
|
||||
*/
|
||||
public function shouldDiscoverEvents(): bool
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Cache\RateLimiting\Limit;
|
||||
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\RateLimiter;
|
||||
use Illuminate\Support\Facades\Route;
|
||||
|
||||
class RouteServiceProvider extends ServiceProvider
|
||||
{
|
||||
/**
|
||||
* The path to your application's "home" route.
|
||||
*
|
||||
* Typically, users are redirected here after authentication.
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public const HOME = '/home';
|
||||
|
||||
/**
|
||||
* Define your route model bindings, pattern filters, and other route configuration.
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
RateLimiter::for('api', function (Request $request) {
|
||||
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
|
||||
});
|
||||
|
||||
$this->routes(function () {
|
||||
Route::middleware('api')
|
||||
->prefix('api')
|
||||
->group(base_path('routes/api.php'));
|
||||
|
||||
Route::middleware('web')
|
||||
->group(base_path('routes/web.php'));
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class RekapAntibiotik extends Model
|
||||
{
|
||||
protected $table = "rekapantibiotik";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Rekaplogbook extends Model
|
||||
{
|
||||
protected $table = "db_rekapppds";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class ResultSample extends Model
|
||||
{
|
||||
protected $table = "resultraw";
|
||||
protected $guarded = [];
|
||||
protected $casts = [
|
||||
'additional_result' => 'array'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Riwayat extends Model
|
||||
{
|
||||
protected $table = "riwayatjawaban";
|
||||
protected $fillable = [
|
||||
'id', 'nofoto', 'jawaban', 'inputor', 'keterangan', 'verifikasi', 'created_at'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Ruangan extends Model
|
||||
{
|
||||
protected $table = "ruangan";
|
||||
protected $fillable = [
|
||||
'poli',
|
||||
'ruangan'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,555 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\ResultSample;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Exception;
|
||||
use App\DataListiner;
|
||||
|
||||
// Proses untuk Growth and Detection Result
|
||||
function processGrowthDetectionResult($rawData){
|
||||
// Format: R|1| ^ ^ ^GND_MGIT^430100001234|INST_POSITIVE ^87| ...
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'Growth/Detection',
|
||||
'accession_number' => $resultData[2],
|
||||
'status' => $resultData[3], // Positif atau Negatif
|
||||
'completion_time' => $resultData[7]
|
||||
];
|
||||
}
|
||||
// Proses untuk Isolate Result
|
||||
function processIsolateResult($rawData){
|
||||
$resultData = explode('|', $rawData);
|
||||
return [
|
||||
'test_type' => 'Isolate',
|
||||
'isolate_result' => $resultData[3],
|
||||
'antibiotic' => $resultData[4],
|
||||
'value' => $resultData[5],
|
||||
'status' => $resultData[6],
|
||||
'completion_time' => $resultData[10]
|
||||
];
|
||||
}
|
||||
// Proses untuk Other Test Result
|
||||
function processOtherResult($rawData){
|
||||
// Format: R|1| ^ ^ ^OTHER^Seq123|Complete| ...
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'Other',
|
||||
'sequence_number' => $resultData[3],
|
||||
'result' => $resultData[4],
|
||||
'description' => $resultData[5],
|
||||
'completion_time' => $resultData[6]
|
||||
];
|
||||
}
|
||||
|
||||
class AstmMessageService
|
||||
{
|
||||
/**
|
||||
* Membersihkan string dari karakter non-printable
|
||||
*/
|
||||
private function cleanString($string)
|
||||
{
|
||||
return preg_replace('/[^\P{C}\n]+/u', '', $string);
|
||||
}
|
||||
|
||||
/**
|
||||
* Parsing data berdasarkan format yang diberikan
|
||||
*/
|
||||
private function parseResultData($rawData, $format)
|
||||
{
|
||||
$resultData = explode('|', $rawData);
|
||||
$parsedData = [];
|
||||
|
||||
foreach ($format as $key => $index) {
|
||||
$parsedData[$key] = $resultData[$index] ?? null;
|
||||
}
|
||||
|
||||
return $parsedData;
|
||||
}
|
||||
/**
|
||||
* Proses hasil AST Record
|
||||
*/
|
||||
public function processAstResult($rawData)
|
||||
{
|
||||
$format = [
|
||||
'test_type' => 0,
|
||||
'accession_number' => 2,
|
||||
'antibiotic' => 3,
|
||||
'susceptibility' => 4,
|
||||
'value' => 5,
|
||||
'status' => 6,
|
||||
'completion_time' => 10
|
||||
];
|
||||
|
||||
return $this->parseResultData($rawData, $format);
|
||||
}
|
||||
/**
|
||||
* Proses hasil ID Record
|
||||
*/
|
||||
public function processIdResult($rawData)
|
||||
{
|
||||
$format = [
|
||||
'test_type' => 0,
|
||||
'accession_number' => 2,
|
||||
'organism_name' => 3,
|
||||
'status' => 6,
|
||||
'completion_time' => 10
|
||||
];
|
||||
|
||||
return $this->parseResultData($rawData, $format);
|
||||
}
|
||||
public function createHeader($senderName, $versionNumber)
|
||||
{
|
||||
$messageDateTime = Carbon::now()->format('YmdHis');
|
||||
return "H|{$senderName}|{$versionNumber}|{$messageDateTime}";
|
||||
}
|
||||
|
||||
// Fungsi untuk membuat Patient Record (P)
|
||||
public function createPatientRecord($patient)
|
||||
{
|
||||
// Extract fields from $patient array, adjust field positions based on mapping
|
||||
return "P|{$patient['id']}|{$patient['last_name']}|{$patient['first_name']}|{$patient['middle_name']}|{$patient['suffix']}|{$patient['dob']}|{$patient['sex']}|{$patient['address']}||{$patient['phone']}|{$patient['admitting_physician']}";
|
||||
}
|
||||
|
||||
// Fungsi untuk membuat Order Record (O)
|
||||
public function createOrderRecord($order)
|
||||
{
|
||||
// Order fields based on mapping (Accession Number, Test ID, etc.)
|
||||
return "O|{$order['accession_number']}|{$order['isolate_number']}|{$order['organism']}|{$order['exclude_isolate']}|{$order['priority']}|{$order['collection_date_time']}|{$order['collected_by']}|{$order['received_by']}|{$order['specimen_action_code']}|{$order['isolate_source_test']}|{$order['isolate_source_test_start_time']}|{$order['receipt_date_time']}|{$order['specimen_type']}|{$order['body_site']}|{$order['ordering_physician']}|{$order['ordering_physician_phone']}|{$order['ordering_physician_fax']}|{$order['ordering_physician_pager']}|{$order['specimen_user_field_1']}|{$order['specimen_user_field_2']}|{$order['specimen_user_field_3']}|{$order['specimen_user_field_4']}|{$order['specimen_user_field_5']}|{$order['finalized_date_time']}|{$order['specimen_reimbursement_value']}|{$order['test_reimbursement_value']}|{$order['isolate_classification']}"; }
|
||||
public function createTerminatorRecord($order)
|
||||
{
|
||||
// Order fields based on mapping (Accession Number, Test ID, etc.)
|
||||
return "L|1|N";
|
||||
}
|
||||
// Fungsi untuk membuat pesan lengkap (header + patient + order)
|
||||
public function createMessage($senderName, $versionNumber, $patient, $order)
|
||||
{
|
||||
$header = $this->createHeader($senderName, $versionNumber);
|
||||
$patientRecord = $this->createPatientRecord($patient);
|
||||
$orderRecord = $this->createOrderRecord($order);
|
||||
$terimatorRecord= $this->createTerminatorRecord($order);
|
||||
return implode("\n", [$header, $patientRecord, $orderRecord, $terimatorRecord]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Proses data ASTM Response
|
||||
*/
|
||||
public function processAstmResponse($response, $alat) {
|
||||
// Bersihkan data
|
||||
$astmData = $this->cleanString($response);
|
||||
// Validasi awal: response tidak kosong
|
||||
if (empty($astmData)) {
|
||||
Log::error("ASTM data kosong atau tidak valid.");
|
||||
}
|
||||
$headerData = [];
|
||||
$patientData = [];
|
||||
$orderData = [];
|
||||
$resultData = [];
|
||||
$instrumenDT = [];
|
||||
$mltrData = [];
|
||||
$isolate = null;
|
||||
$accession_number = null;
|
||||
$segments = explode("\n", $astmData);
|
||||
foreach ($segments as $rsegmen){
|
||||
$cekdata = explode('|', $rsegmen);
|
||||
$datapertama = $cekdata[0];
|
||||
$cleankode = preg_replace("/[^a-zA-Z]/", "", $datapertama);
|
||||
if ($cleankode == 'H'){
|
||||
$headerData = array_merge([$cleankode], array_slice($cekdata, 1));
|
||||
}
|
||||
if ($cleankode == 'P'){
|
||||
$patientData = array_merge([$cleankode], array_slice($cekdata, 1));
|
||||
}
|
||||
if ($cleankode == 'O'){
|
||||
$orderData = array_merge([$cleankode], array_slice($cekdata, 1));
|
||||
}
|
||||
if ($cleankode == 'R'){
|
||||
$resultData = array_merge([$cleankode], array_slice($cekdata, 1));
|
||||
}
|
||||
if ($cleankode == 'I'){
|
||||
$instrumenDT = array_merge([$cleankode], array_slice($cekdata, 1));
|
||||
}
|
||||
if ($cleankode == 'mtrsl'){
|
||||
$mltrData = array_merge([$cleankode], array_slice($cekdata, 1));
|
||||
}
|
||||
}
|
||||
if (!empty($patientData) && !empty($headerData)) {
|
||||
$resultSample = new ResultSample();
|
||||
$noregister = $patientData[4] ?? null;
|
||||
$resultSample->sender_name = $alat;
|
||||
$resultSample->version_number = $headerData[11] ?? $patientData[12] ?? null;
|
||||
$resultSample->message_datetime = $resultData[13] ?? null; // '20241130152734'
|
||||
// Patient Record (Segment P)
|
||||
$resultSample->patient_id = $patientData[4] ?? null; // '11607396'
|
||||
$resultSample->patient_name_last = $patientData[6] ?? null; // 'ZAKIYATUN'
|
||||
$resultSample->patient_name_first = $patientData[7] ?? null; // 'O'
|
||||
$resultSample->patient_name_middle = $patientData[8] ?? null;
|
||||
$resultSample->patient_name_suffix = $patientData[9] ?? null;
|
||||
$resultSample->patient_name_title = $patientData[10] ?? null;
|
||||
$resultSample->patient_dob = $resultData[11] ?? null; // '19800101'
|
||||
$resultSample->patient_sex = $patientData[12] ?? null; // 'F'
|
||||
$resultSample->address_street = $patientData[13] ?? null; // 'Street ABC'
|
||||
$resultSample->address_city = $patientData[14] ?? null;
|
||||
$resultSample->address_state = $patientData[15] ?? null;
|
||||
$resultSample->address_zip = $patientData[16] ?? null;
|
||||
$resultSample->address_country = $patientData[17] ?? null;
|
||||
$resultSample->patient_phone = $patientData[18] ?? null; // '081234567890'
|
||||
|
||||
// Order Record (Segment O)
|
||||
$resultSample->accession_number = $orderData[4] ?? null; // '12345'
|
||||
$resultSample->isolate_number = $orderData[5] ?? null; // '67890'
|
||||
$resultSample->organism = $orderData[6] ?? null; // 'E. coli'
|
||||
$resultSample->exclude_isolate_from_statistics = $isolate; // 'false'
|
||||
$resultSample->test_id = $orderData[8] ?? null; // 'Test123'
|
||||
|
||||
// Result Record (Segment R)
|
||||
$resultSample->result_type_code = $resultData[4] ?? null; // 'S'
|
||||
$resultSample->antibiotic = $resultData[5] ?? null; // 'Amoxicillin'
|
||||
$resultSample->antibiotic_concentration = $resultData[6] ?? null; // '100mg'
|
||||
$resultSample->antibiotic_concentration_units = $resultData[7] ?? null; // 'mg'
|
||||
$resultSample->test_status = $resultData[8] ?? null; // 'Completed'
|
||||
$resultSample->result_data = json_encode(array_slice($resultData, 9)); // Additional data (if any)
|
||||
|
||||
$resultSample->preliminary_final_status = $resultData[13] ?? null;
|
||||
$resultSample->test_start_datetime = $resultData[14] ?? null;
|
||||
$resultSample->result_status_datetime = $resultData[15] ?? null;
|
||||
$resultSample->test_complete_datetime = $resultData[16] ?? null;
|
||||
// Periksa apakah data duplikat berdasarkan accession_number
|
||||
//if (ResultSample::where('accession_number', $resultSample->accession_number)->exists()) {
|
||||
// return response()->json(['message' => 'Data sudah ada.'], 409);
|
||||
//}
|
||||
|
||||
// Simpan ke database
|
||||
if ($noregister){
|
||||
Log::info("Data berhasil disimpan:", $resultSample->toArray());
|
||||
$resultSample->save();
|
||||
}
|
||||
return response()->json(['message' => 'Data berhasil diproses dan disimpan.']);
|
||||
|
||||
} else {
|
||||
if (!empty($mltrData)){
|
||||
Log::info("Trying parser MTRSL :", $mltrData);
|
||||
$parsedData = [];
|
||||
$parsedData['antibiotics'] = [];
|
||||
$antibiotic = '';
|
||||
$resistance = '';
|
||||
$value = '';
|
||||
$interpretation = '';
|
||||
$mulaikirim = 0;
|
||||
$resultSample = new ResultSample();
|
||||
foreach ($mltrData as $index => $field) {
|
||||
if ($field == 'ra'){
|
||||
if ($antibiotic != ''){
|
||||
$parsedData['antibiotics'][] = [
|
||||
'antibiotic' => $antibiotic, // Antibiotik
|
||||
'resistance' => $resistance, // Hasil Resistansi
|
||||
'value' => $value, // Nilai
|
||||
'interpretation'=> $interpretation // Interpretasi
|
||||
];
|
||||
$antibiotic = '';
|
||||
$resistance = '';
|
||||
$value = '';
|
||||
$interpretation = '';
|
||||
} else {
|
||||
$mulaikirim = 1;
|
||||
}
|
||||
} else {
|
||||
if ($mulaikirim == 1){
|
||||
$antibiotic = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else if ($mulaikirim == 2){
|
||||
$resistance = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else if ($mulaikirim == 3){
|
||||
$value = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else if ($mulaikirim == 4){
|
||||
$interpretation = substr($field, 2);
|
||||
$mulaikirim++;
|
||||
} else {
|
||||
$field = substr($field, 2);
|
||||
switch ($index) {
|
||||
case 0:
|
||||
$resultSample->sender_name = $alat;
|
||||
break;
|
||||
case 1:
|
||||
$resultSample->version_number = $field; // iiV2
|
||||
break;
|
||||
case 2:
|
||||
$resultSample->isolate_number = $field; // is000015F278BD
|
||||
break;
|
||||
case 4:
|
||||
$resultSample->patient_id = $field; // pi12009427
|
||||
break;
|
||||
case 5:
|
||||
$patientNames = explode(',', $field ?? null);
|
||||
if (count($patientNames) > 0) {
|
||||
$resultSample->patient_name_last = trim($patientNames[0]); // Last name
|
||||
}
|
||||
if (count($patientNames) > 1) {
|
||||
$resultSample->patient_name_first = trim($patientNames[1]); // First name
|
||||
}
|
||||
if (count($patientNames) > 2) {
|
||||
$resultSample->patient_name_middle = trim($patientNames[2]); // Middle name
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
$resultSample->address_street = $field; // plMANINJAU
|
||||
break;
|
||||
case 12:
|
||||
try {
|
||||
$resultSample->message_datetime = Carbon::parse($field)->format('Y-m-d') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->message_datetime = date('Y-m-d');
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
try {
|
||||
$resultSample->test_complete_datetime = Carbon::parse($field)->format('Y-m-d') ?? null;
|
||||
}catch (Exception $e) {
|
||||
$resultSample->test_complete_datetime = date('Y-m-d');
|
||||
}
|
||||
break;
|
||||
case 14:
|
||||
$resultSample->accession_number = substr($field, 6); // ci30112024.26859
|
||||
break;
|
||||
case 23:
|
||||
$resultSample->organism = $field; // o2Staphylococcus haemolyticus
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//$resultSample->specimen_type = $parsedData['specimen_type'] ?? null; // Could be inferred
|
||||
//$resultSample->test_id = $parsedData['test_id'] ?? null;
|
||||
|
||||
// Result Record
|
||||
|
||||
$resultSample->additional_result = json_encode($parsedData['antibiotics']);
|
||||
|
||||
// Menyimpan data yang sudah diparse
|
||||
$resultSample->save();
|
||||
Log::info("Data MTRL Berhasil di Parse dan di simpan ", $resultSample->toArray());
|
||||
return response()->json(['message' => 'Data berhasil diproses dan disimpan.']);
|
||||
} else {
|
||||
$headerData = explode("|", $response);
|
||||
if (isset($headerData[3])){
|
||||
$accnumber = $headerData[47] ?? null;
|
||||
$noregister = $headerData[16] ?? null;
|
||||
$nama = $headerData[18] ?? null;
|
||||
$urgensi = $headerData[50] ?? null; //A Critical R Normal
|
||||
$iddokter = $headerData[33] ?? null;
|
||||
$test_start_datetime = $headerData[52] ?? null;
|
||||
$result_status_datetime = $headerData[59] ?? null;
|
||||
$specimen_type = $headerData[60] ?? null;
|
||||
$resulttype = $headerData[34] ?? null;
|
||||
$resultstatus = $headerData[63] ?? null;
|
||||
$preliminary = $headerData[40] ?? null; //P
|
||||
$test_complete_datetime = $headerData[44] ?? null;
|
||||
$tesid = $headerData[62] ?? null;
|
||||
$alamat = $headerData[23] ?? null;
|
||||
$instrumen = $resultData[2] ?? null;
|
||||
$body_site = '';
|
||||
$tengah = '';
|
||||
$depan = '';
|
||||
$akhir = '';
|
||||
$suffix = '';
|
||||
$title = '';
|
||||
$concentration_unit = '';
|
||||
$kode = '';
|
||||
$antibiotic = '';
|
||||
$city = '';
|
||||
$state = '';
|
||||
$zipcode = '';
|
||||
$country = '';
|
||||
if ($resulttype){
|
||||
$getdataresult = explode('^', $resulttype);
|
||||
$kode = $getdataresult[3] ?? '';
|
||||
$concentration_unit = $getdataresult[4] ?? '';
|
||||
}
|
||||
if ($specimen_type){
|
||||
$getdata = explode('\n', $specimen_type);
|
||||
$specimen_type = $getdata[0];
|
||||
$body_site = $getdata[1] ?? '';
|
||||
}
|
||||
if ($tesid){
|
||||
$gettgl = explode('^', $tesid);
|
||||
$tesid = $gettgl[3] ?? null;
|
||||
}
|
||||
if ($instrumen){
|
||||
$gettgl = explode('^', $instrumen);
|
||||
$instrumen = $gettgl[0];
|
||||
$media_assay_type = $gettgl[1] ?? null;
|
||||
$protocol_length = $gettgl[2] ?? null;
|
||||
$instrument_number = $gettgl[3] ?? null;
|
||||
$instrument_location = $gettgl[4] ?? null;
|
||||
$protocol_name = $gettgl[5] ?? null;
|
||||
} else {
|
||||
$media_assay_type = null;
|
||||
$protocol_length = null;
|
||||
$instrument_number = null;
|
||||
$instrument_location = null;
|
||||
$protocol_name = null;
|
||||
}
|
||||
if ($isolate == '' OR $isolate == '0' OR is_null($isolate)){
|
||||
$isolate = false;
|
||||
} else { $isolate = true; }
|
||||
if ($test_complete_datetime){
|
||||
$test_complete_datetime = substr($test_complete_datetime, 0, 14);
|
||||
//$test_complete_datetime = Carbon::parse($test_complete_datetime)->format('Y-m-d H:i:s');
|
||||
}
|
||||
if ($result_status_datetime){
|
||||
$result_status_datetime = substr($result_status_datetime, 0, 14);
|
||||
//$result_status_datetime = Carbon::parse($result_status_datetime)->format('Y-m-d H:i:s');
|
||||
}
|
||||
if ($test_start_datetime){
|
||||
$test_start_datetime = substr($test_start_datetime, 0, 14);
|
||||
//$test_start_datetime = Carbon::parse($test_start_datetime)->format('Y-m-d H:i:s');
|
||||
}
|
||||
if ($nama){
|
||||
$getnama = explode('\015', $nama);
|
||||
$nama = $getnama[0];
|
||||
$getnama = explode('\n', $nama);
|
||||
$nama = $getnama[0];
|
||||
|
||||
$akhir = $getnama[1] ?? '';
|
||||
$depan = $getnama[2] ?? '';
|
||||
$tengah = $getnama[3] ?? '';
|
||||
$suffix = $getnama[4] ?? '';
|
||||
$title = $getnama[5] ?? '';
|
||||
|
||||
$nama = $nama.$akhir;
|
||||
}
|
||||
if ($alamat){
|
||||
$getnama = explode('^', $alamat);
|
||||
$alamat = $getnama[0];
|
||||
$city = $getnama[1] ?? '';
|
||||
$state = $getnama[2] ?? '';
|
||||
$zipcode = $getnama[3] ?? '';
|
||||
$country = $getnama[4] ?? '';
|
||||
}
|
||||
if ($test_start_datetime == ''){ $test_start_datetime = null; }
|
||||
if ($result_status_datetime == ''){ $result_status_datetime = null; }
|
||||
if ($test_complete_datetime == ''){ $test_complete_datetime = null; }
|
||||
|
||||
$resultSample->sender_name = $headerData[4] ?? 'Unkown';
|
||||
$resultSample->version_number = $headerData[12] ?? 'V0.0';
|
||||
$resultSample->message_datetime = $test_start_datetime;
|
||||
// Patient Record (Segment P)
|
||||
$resultSample->patient_id = $noregister; // '11607396'
|
||||
$resultSample->patient_name_last = $nama; // 'ZAKIYATUN'
|
||||
$resultSample->patient_name_first = $depan; // 'O'
|
||||
$resultSample->patient_name_middle = $tengah;
|
||||
$resultSample->patient_name_suffix = $suffix;
|
||||
$resultSample->patient_name_title = $title;
|
||||
$resultSample->patient_dob = $headerData[20] ?? null;
|
||||
$resultSample->patient_sex = $headerData[21] ?? null;
|
||||
$resultSample->address_street = $alamat;
|
||||
$resultSample->address_city = $city;
|
||||
$resultSample->address_state = $state;
|
||||
$resultSample->address_zip = $zipcode;
|
||||
$resultSample->address_country = $country;
|
||||
$resultSample->patient_phone = $headerData[25] ?? null;
|
||||
$resultSample->admitting_physician = $headerData[27] ?? null;
|
||||
$resultSample->patient_diagnosis = $headerData[33] ?? null;
|
||||
$resultSample->patient_therapy = json_encode($headerData);
|
||||
$resultSample->admit_datetime = null;
|
||||
$resultSample->room_number = $headerData[46] ?? '00001';
|
||||
$resultSample->hospital_service = $headerData[45] ?? 'RSSA Malang';
|
||||
$resultSample->hospital_client = $orderData[4] ?? 'Lab Mikro';
|
||||
|
||||
// Order Record (Segment O)
|
||||
$resultSample->accession_number = $accnumber; // '12345'
|
||||
$resultSample->isolate_number = $orderData[5] ?? null; // '67890'
|
||||
$resultSample->organism = $orderData[6] ?? null; // 'E. coli'
|
||||
$resultSample->exclude_isolate_from_statistics = $isolate; // 'false'
|
||||
$resultSample->specimen_type = $specimen_type;
|
||||
$resultSample->body_site = $body_site;
|
||||
$resultSample->test_id = $tesid; // 'Test123'
|
||||
$resultSample->urgensi = $urgensi; //A Critical R Normal
|
||||
|
||||
// Result Record (Segment R)
|
||||
$resultSample->result_type_code = $kode;
|
||||
$resultSample->antibiotic = $antibiotic;
|
||||
$resultSample->antibiotic_concentration = $concentration_unit; // '100mg'
|
||||
$resultSample->antibiotic_concentration_units = $concentration_unit; // 'mg'
|
||||
$resultSample->test_status = $resultstatus; // 'Completed'
|
||||
$resultSample->result_data = json_encode($orderData); // Additional data (if any)
|
||||
|
||||
$resultSample->preliminary_final_status = $preliminary;
|
||||
$resultSample->test_start_datetime = $test_start_datetime;
|
||||
$resultSample->result_status_datetime = $result_status_datetime;
|
||||
$resultSample->test_complete_datetime = $test_complete_datetime;
|
||||
|
||||
$resultSample->instrument_type = $instrumen;
|
||||
$resultSample->media_assay_type = $media_assay_type;
|
||||
$resultSample->protocol_length = $protocol_length;
|
||||
$resultSample->instrument_number = $instrument_number;
|
||||
$resultSample->instrument_location = $instrument_location;
|
||||
$resultSample->protocol_name = $protocol_name;
|
||||
$resultSample->additional_result = json_encode($resultData);
|
||||
if ($noregister){
|
||||
$resultSample->save();
|
||||
Log::info("Data ASTM Berhasil di Parse dan di simpan ", $resultSample->toArray());
|
||||
return response()->json(['message' => 'Data berhasil diproses dan disimpan.']);
|
||||
}
|
||||
} else {
|
||||
Log::debug("Abaikan Data Berikut ". json_encode($headerData));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/**
|
||||
* Proses data ASTM Response
|
||||
*/
|
||||
public function processAstmMessages($dataListener) {
|
||||
foreach ($dataListener as $data) {
|
||||
try {
|
||||
// Ambil pesan ASTM dari kolom 'message' atau yang relevan
|
||||
$response = $data->rawdt;
|
||||
if ($data->alat == 'BD Mikro 1'){
|
||||
if ($data->no_id != ''){
|
||||
$rnmpas = $data->rnmpas;
|
||||
$getnama = explode('|', $rnmpas);
|
||||
$resultSample = new ResultSample();
|
||||
$resultSample->sender_name = $data->alat;
|
||||
$resultSample->message_datetime = $data->tgl_data;
|
||||
$resultSample->version_number = 'V1.0';
|
||||
$resultSample->patient_id = $data->urut;
|
||||
$resultSample->patient_name_last= $getnama[0];
|
||||
$resultSample->accession_number = $data->no_id;
|
||||
$resultSample->test_status = $data->organisme;
|
||||
$resultSample->save();
|
||||
DataListiner::where('urut', $data->urut)->update([
|
||||
'processed' => 1
|
||||
]);
|
||||
Log::info("Data ASTM BD ", $resultSample->toArray());
|
||||
|
||||
} else {
|
||||
DataListiner::where('urut', $data->urut)->update([
|
||||
'processed' => 9
|
||||
]);
|
||||
}
|
||||
} else {
|
||||
// Lakukan parsing menggunakan method/fungsi yang sudah dibuat
|
||||
$result = $this->processAstmResponse($response, $data->alat);
|
||||
// Jika berhasil, tandai data sudah diproses
|
||||
if ($result) {
|
||||
DataListiner::where('urut', $data->urut)->update([
|
||||
'processed' => 1
|
||||
]);
|
||||
} else {
|
||||
Log::debug($result);
|
||||
}
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
Log::critical($e->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
|
||||
use App\Models\Result;
|
||||
|
||||
class ResultProcessingService
|
||||
{
|
||||
// Proses untuk AST Result
|
||||
public function processAstResult($rawData)
|
||||
{
|
||||
// Format: R|1| ^ ^ ^AST_MGIT^439400005678^P^0.5^ug/ml| INST_COMPLETE^105^^S| ...
|
||||
// Parse raw data menjadi array atau objek
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'AST',
|
||||
'accession_number' => $resultData[2],
|
||||
'antibiotic' => $resultData[3], // Seperti 'AST_MGIT'
|
||||
'susceptibility' => $resultData[4], // Seperti 'P' atau 'R'
|
||||
'value' => $resultData[5],
|
||||
'status' => $resultData[6],
|
||||
'completion_time' => $resultData[10]
|
||||
];
|
||||
}
|
||||
|
||||
// Proses untuk ID Result
|
||||
public function processIdResult($rawData)
|
||||
{
|
||||
// Format: R|1| ^ ^ ^ID^Seq123|Complete^MYCBTUB^45678^RM_VRE| ...
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'ID',
|
||||
'sequence_number' => $resultData[3],
|
||||
'result' => $resultData[4], // Status 'Complete'
|
||||
'organism' => $resultData[5], // Organism name
|
||||
'resistance_marker' => $resultData[6], // Resistance marker info
|
||||
'completion_time' => $resultData[8]
|
||||
];
|
||||
}
|
||||
|
||||
// Proses untuk Growth and Detection Result
|
||||
public function processGrowthDetectionResult($rawData)
|
||||
{
|
||||
// Format: R|1| ^ ^ ^GND_MGIT^430100001234|INST_POSITIVE ^87| ...
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'Growth/Detection',
|
||||
'accession_number' => $resultData[2],
|
||||
'status' => $resultData[3], // Positif atau Negatif
|
||||
'completion_time' => $resultData[7]
|
||||
];
|
||||
}
|
||||
|
||||
// Proses untuk Isolate Result
|
||||
public function processIsolateResult($rawData)
|
||||
{
|
||||
// Format: R|1| ^^^AST^^P^100.0^ug/mL| ^^R^R^^MGIT_960_AST92| ...
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'Isolate',
|
||||
'isolate_result' => $resultData[3],
|
||||
'antibiotic' => $resultData[4],
|
||||
'value' => $resultData[5],
|
||||
'status' => $resultData[6],
|
||||
'completion_time' => $resultData[10]
|
||||
];
|
||||
}
|
||||
|
||||
// Proses untuk Other Test Result
|
||||
public function processOtherResult($rawData)
|
||||
{
|
||||
// Format: R|1| ^ ^ ^OTHER^Seq123|Complete| ...
|
||||
$resultData = explode('|', $rawData);
|
||||
|
||||
return [
|
||||
'test_type' => 'Other',
|
||||
'sequence_number' => $resultData[3],
|
||||
'result' => $resultData[4],
|
||||
'description' => $resultData[5],
|
||||
'completion_time' => $resultData[6]
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Services;
|
||||
use Carbon\Carbon;
|
||||
use Fawno\PhpSerial\SerialDio;
|
||||
use Fawno\PhpSerial\SerialConfig;
|
||||
class SerialCommunicationService
|
||||
{
|
||||
public function sendMessageDevice1($message, $port = 'COM2')
|
||||
{
|
||||
$config = new SerialConfig();
|
||||
$config->setBaudRate(9600);
|
||||
$config->setParity(0);
|
||||
$config->setDataBits(8);
|
||||
$config->setStopBits(1);
|
||||
$config->setFlowControl(0);
|
||||
$serial = new SerialDio($port, $config);
|
||||
$serial->open('r+b');
|
||||
$serial->setBlocking(0);
|
||||
$serial->setTimeout(0, 0);
|
||||
$serial->send($message);
|
||||
$pesan = $serial->read();
|
||||
$serial->close();
|
||||
return $pesan;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Setting extends Model
|
||||
{
|
||||
protected $table = "setting";
|
||||
protected $fillable = [
|
||||
'pacs',
|
||||
'zfp',
|
||||
'port',
|
||||
'portzfp',
|
||||
'username',
|
||||
'password',
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class SiraB extends Model
|
||||
{
|
||||
protected $table = "sirab";
|
||||
protected $guarded = [];
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Subjawaban extends Model
|
||||
{
|
||||
protected $table = "subjawaban";
|
||||
protected $fillable = [
|
||||
'kategori',
|
||||
'judul',
|
||||
'subjawaban',
|
||||
'kesimpulan'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
|
||||
class User extends Authenticatable
|
||||
{
|
||||
use Notifiable;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'nama', 'username', 'password', 'previlage', 'tandatangan', 'photo', 'firebase'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password'
|
||||
];
|
||||
public function getPhoto()
|
||||
{
|
||||
return $this->hasOne('App\XFiles','xmarking','photo');
|
||||
}
|
||||
public function getTandatangan()
|
||||
{
|
||||
return $this->hasOne('App\XFiles','xmarking','tandatangan');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class Worklist extends Model
|
||||
{
|
||||
protected $table = "worklist";
|
||||
protected $fillable = [
|
||||
'aetitle', 'portnumber', 'ipaddress', 'location', 'modaliti'
|
||||
];
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
namespace App;
|
||||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
|
||||
class XFiles extends Model
|
||||
{
|
||||
protected $table = "x_files";
|
||||
protected $primaryKey = "xid";
|
||||
public $timestamps = false;
|
||||
protected $guarded = [];
|
||||
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Register The Auto Loader
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Composer provides a convenient, automatically generated class loader
|
||||
| for our application. We just need to utilize it! We'll require it
|
||||
| into the script here so that we do not have to worry about the
|
||||
| loading of any of our classes manually. It's great to relax.
|
||||
|
|
||||
*/
|
||||
|
||||
require __DIR__.'/vendor/autoload.php';
|
||||
|
||||
$app = require_once __DIR__.'/bootstrap/app.php';
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Run The Artisan Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When we run the console application, the current CLI command will be
|
||||
| executed in this console and the response sent back to a terminal
|
||||
| or another output device for the developers. Here goes nothing!
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
|
||||
|
||||
$status = $kernel->handle(
|
||||
$input = new Symfony\Component\Console\Input\ArgvInput,
|
||||
new Symfony\Component\Console\Output\ConsoleOutput
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Shutdown The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Once Artisan has finished running, we will fire off the shutdown events
|
||||
| so that any final work may be done by the application before we shut
|
||||
| down the process. This is the last thing to happen to the request.
|
||||
|
|
||||
*/
|
||||
|
||||
$kernel->terminate($input, $status);
|
||||
|
||||
exit($status);
|
||||
@@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Create The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The first thing we will do is create a new Laravel application instance
|
||||
| which serves as the "glue" for all the components of Laravel, and is
|
||||
| the IoC container for the system binding all of the various parts.
|
||||
|
|
||||
*/
|
||||
|
||||
$app = new Illuminate\Foundation\Application(
|
||||
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bind Important Interfaces
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, we need to bind some important interfaces into the container so
|
||||
| we will be able to resolve them when needed. The kernels serve the
|
||||
| incoming requests to this application from both the web and CLI.
|
||||
|
|
||||
*/
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Http\Kernel::class,
|
||||
App\Http\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Console\Kernel::class,
|
||||
App\Console\Kernel::class
|
||||
);
|
||||
|
||||
$app->singleton(
|
||||
Illuminate\Contracts\Debug\ExceptionHandler::class,
|
||||
App\Exceptions\Handler::class
|
||||
);
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Return The Application
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This script returns the application instance. The instance is given to
|
||||
| the calling script so we can separate the building of the instances
|
||||
| from the actual running of the application and sending responses.
|
||||
|
|
||||
*/
|
||||
|
||||
return $app;
|
||||
@@ -0,0 +1,2 @@
|
||||
*
|
||||
!.gitignore
|
||||
@@ -0,0 +1,79 @@
|
||||
{
|
||||
"name": "laravel/laravel",
|
||||
"type": "project",
|
||||
"description": "The skeleton application for the Laravel framework.",
|
||||
"keywords": ["laravel", "framework"],
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": "^8.1",
|
||||
"aamdsam/bridging-bpjs": "^1.11",
|
||||
"aranyasen/hl7": "^3.1",
|
||||
"arcanedev/log-viewer": "^10.1",
|
||||
"elibyy/tcpdf-laravel": "^11.1",
|
||||
"fawno/php-serial": "^2.0",
|
||||
"guzzlehttp/guzzle": "^7.8",
|
||||
"laravel/framework": "^10.10",
|
||||
"laravel/passport": "^11.10",
|
||||
"laravel/sanctum": "^3.3",
|
||||
"laravel/tinker": "^2.8",
|
||||
"munafio/chatify": "^1.6",
|
||||
"onecentlin/laravel-adminer": "^7.0",
|
||||
"phpoffice/phpspreadsheet": "^3.3",
|
||||
"picqer/php-barcode-generator": "^3.2",
|
||||
"pusher/pusher-php-server": "^7.2",
|
||||
"setasign/fpdi": "^2.6",
|
||||
"simplesoftwareio/simple-qrcode": "^4.2"
|
||||
},
|
||||
"require-dev": {
|
||||
"fakerphp/faker": "^1.9.1",
|
||||
"laravel/pint": "^1.0",
|
||||
"laravel/sail": "^1.18",
|
||||
"mockery/mockery": "^1.4.4",
|
||||
"nunomaduro/collision": "^7.0",
|
||||
"phpunit/phpunit": "^10.1",
|
||||
"spatie/laravel-ignition": "^2.0"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"App\\": "app/",
|
||||
"Database\\Factories\\": "database/factories/",
|
||||
"Database\\Seeders\\": "database/seeders/"
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Tests\\": "tests/"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"post-autoload-dump": [
|
||||
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
|
||||
"@php artisan package:discover --ansi"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@php artisan vendor:publish --tag=laravel-assets --ansi --force"
|
||||
],
|
||||
"post-root-package-install": [
|
||||
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
|
||||
],
|
||||
"post-create-project-cmd": [
|
||||
"@php artisan key:generate --ansi"
|
||||
]
|
||||
},
|
||||
"extra": {
|
||||
"laravel": {
|
||||
"dont-discover": []
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"optimize-autoloader": true,
|
||||
"preferred-install": "dist",
|
||||
"sort-packages": true,
|
||||
"allow-plugins": {
|
||||
"pestphp/pest-plugin": true,
|
||||
"php-http/discovery": true
|
||||
}
|
||||
},
|
||||
"minimum-stability": "stable",
|
||||
"prefer-stable": true
|
||||
}
|
||||
Generated
+10483
File diff suppressed because it is too large
Load diff
Binary file not shown.
@@ -0,0 +1,72 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Enable Adminer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
*/
|
||||
'enabled' => env('ADMINER_ENABLED', true),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Auto Login
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable autologin to database
|
||||
|
|
||||
| ATTENTION: Please only enable autologin with authenticated protection
|
||||
|
|
||||
*/
|
||||
'autologin' => env('ADMINER_AUTO_LOGIN', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Route Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may customize route prefix. (default: 'adminer')
|
||||
|
|
||||
*/
|
||||
'route_prefix' => env('ADMINER_ROUTE_PREFIX', 'adminer'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Middleware for authentication protection
|
||||
|
|
||||
| Default laravel authentication middleware: 'auth'
|
||||
|
|
||||
| Multiple middleware allowed using array:
|
||||
| Example:
|
||||
| 'middleware' => ['auth', 'adminer']
|
||||
|
|
||||
*/
|
||||
'middleware' => 'auth',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Plugins
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Enable Adminer plugins loaded from /resources/adminer/plugins
|
||||
|
|
||||
| Example:
|
||||
|
|
||||
| With arguments...
|
||||
| 'PluginClassName' => ['class', 'arguments', ...]
|
||||
|
|
||||
| or with a single argument
|
||||
| 'PluginClassName' => 'argument'
|
||||
|
|
||||
| or without arguments
|
||||
| 'PluginClassName'
|
||||
|
|
||||
*/
|
||||
'plugins' => [
|
||||
|
||||
],
|
||||
];
|
||||
+188
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Facades\Facade;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value is the name of your application. This value is used when the
|
||||
| framework needs to place the application's name in a notification or
|
||||
| any other location as required by the application or its packages.
|
||||
|
|
||||
*/
|
||||
|
||||
'name' => env('APP_NAME', 'Laravel'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Environment
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value determines the "environment" your application is currently
|
||||
| running in. This may determine how you prefer to configure various
|
||||
| services the application utilizes. Set this in your ".env" file.
|
||||
|
|
||||
*/
|
||||
|
||||
'env' => env('APP_ENV', 'production'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Debug Mode
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When your application is in debug mode, detailed error messages with
|
||||
| stack traces will be shown on every error that occurs within your
|
||||
| application. If disabled, a simple generic error page is shown.
|
||||
|
|
||||
*/
|
||||
|
||||
'debug' => (bool) env('APP_DEBUG', false),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application URL
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This URL is used by the console to properly generate URLs when using
|
||||
| the Artisan command line tool. You should set this to the root of
|
||||
| your application so that it is used when running Artisan tasks.
|
||||
|
|
||||
*/
|
||||
|
||||
'url' => env('APP_URL', 'http://localhost'),
|
||||
|
||||
'asset_url' => env('ASSET_URL'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Timezone
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default timezone for your application, which
|
||||
| will be used by the PHP date and date-time functions. We have gone
|
||||
| ahead and set this to a sensible default for you out of the box.
|
||||
|
|
||||
*/
|
||||
|
||||
'timezone' => 'UTC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Locale Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The application locale determines the default locale that will be used
|
||||
| by the translation service provider. You are free to set this value
|
||||
| to any of the locales which will be supported by the application.
|
||||
|
|
||||
*/
|
||||
|
||||
'locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Application Fallback Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The fallback locale determines the locale to use when the current one
|
||||
| is not available. You may change the value to correspond to any of
|
||||
| the language folders that are provided through your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'fallback_locale' => 'en',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Faker Locale
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This locale will be used by the Faker PHP library when generating fake
|
||||
| data for your database seeds. For example, this will be used to get
|
||||
| localized telephone numbers, street address information and more.
|
||||
|
|
||||
*/
|
||||
|
||||
'faker_locale' => 'en_US',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Encryption Key
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This key is used by the Illuminate encrypter service and should be set
|
||||
| to a random, 32 character string, otherwise these encrypted strings
|
||||
| will not be safe. Please do this before deploying an application!
|
||||
|
|
||||
*/
|
||||
|
||||
'key' => env('APP_KEY'),
|
||||
|
||||
'cipher' => 'AES-256-CBC',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Maintenance Mode Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These configuration options determine the driver used to determine and
|
||||
| manage Laravel's "maintenance mode" status. The "cache" driver will
|
||||
| allow maintenance mode to be controlled across multiple machines.
|
||||
|
|
||||
| Supported drivers: "file", "cache"
|
||||
|
|
||||
*/
|
||||
|
||||
'maintenance' => [
|
||||
'driver' => 'file',
|
||||
// 'store' => 'redis',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Autoloaded Service Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The service providers listed here will be automatically loaded on the
|
||||
| request to your application. Feel free to add your own services to
|
||||
| this array to grant expanded functionality to your applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => ServiceProvider::defaultProviders()->merge([
|
||||
/*
|
||||
* Package Service Providers...
|
||||
*/
|
||||
|
||||
/*
|
||||
* Application Service Providers...
|
||||
*/
|
||||
App\Providers\AppServiceProvider::class,
|
||||
App\Providers\AuthServiceProvider::class,
|
||||
// App\Providers\BroadcastServiceProvider::class,
|
||||
App\Providers\EventServiceProvider::class,
|
||||
App\Providers\RouteServiceProvider::class,
|
||||
])->toArray(),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Class Aliases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array of class aliases will be registered when this application
|
||||
| is started. However, feel free to register as many as you wish as
|
||||
| the aliases are "lazy" loaded so they don't hinder performance.
|
||||
|
|
||||
*/
|
||||
|
||||
'aliases' => Facade::defaultAliases()->merge([
|
||||
// 'Example' => App\Facades\Example::class,
|
||||
])->toArray(),
|
||||
|
||||
];
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Defaults
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default authentication "guard" and password
|
||||
| reset options for your application. You may change these defaults
|
||||
| as required, but they're a perfect start for most applications.
|
||||
|
|
||||
*/
|
||||
|
||||
'defaults' => [
|
||||
'guard' => 'web',
|
||||
'passwords' => 'users',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Authentication Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Next, you may define every authentication guard for your application.
|
||||
| Of course, a great default configuration has been defined for you
|
||||
| here which uses session storage and the Eloquent user provider.
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| Supported: "session"
|
||||
|
|
||||
*/
|
||||
|
||||
'guards' => [
|
||||
'web' => [
|
||||
'driver' => 'session',
|
||||
'provider' => 'users',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| User Providers
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| All authentication drivers have a user provider. This defines how the
|
||||
| users are actually retrieved out of your database or other storage
|
||||
| mechanisms used by this application to persist your user's data.
|
||||
|
|
||||
| If you have multiple user tables or models you may configure multiple
|
||||
| sources which represent each model / table. These sources may then
|
||||
| be assigned to any extra authentication guards you have defined.
|
||||
|
|
||||
| Supported: "database", "eloquent"
|
||||
|
|
||||
*/
|
||||
|
||||
'providers' => [
|
||||
'users' => [
|
||||
'driver' => 'eloquent',
|
||||
'model' => App\Models\User::class,
|
||||
],
|
||||
|
||||
// 'users' => [
|
||||
// 'driver' => 'database',
|
||||
// 'table' => 'users',
|
||||
// ],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Resetting Passwords
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may specify multiple password reset configurations if you have more
|
||||
| than one user table or model in the application and you want to have
|
||||
| separate password reset settings based on the specific user types.
|
||||
|
|
||||
| The expiry time is the number of minutes that each reset token will be
|
||||
| considered valid. This security feature keeps tokens short-lived so
|
||||
| they have less time to be guessed. You may change this as needed.
|
||||
|
|
||||
| The throttle setting is the number of seconds a user must wait before
|
||||
| generating more password reset tokens. This prevents the user from
|
||||
| quickly generating a very large amount of password reset tokens.
|
||||
|
|
||||
*/
|
||||
|
||||
'passwords' => [
|
||||
'users' => [
|
||||
'provider' => 'users',
|
||||
'table' => 'password_reset_tokens',
|
||||
'expire' => 60,
|
||||
'throttle' => 60,
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Password Confirmation Timeout
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define the amount of seconds before a password confirmation
|
||||
| times out and the user is prompted to re-enter their password via the
|
||||
| confirmation screen. By default, the timeout lasts for three hours.
|
||||
|
|
||||
*/
|
||||
|
||||
'password_timeout' => 10800,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Broadcaster
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default broadcaster that will be used by the
|
||||
| framework when an event needs to be broadcast. You may set this to
|
||||
| any of the connections defined in the "connections" array below.
|
||||
|
|
||||
| Supported: "pusher", "ably", "redis", "log", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('BROADCAST_DRIVER', 'null'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Broadcast Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the broadcast connections that will be used
|
||||
| to broadcast events to other systems or over websockets. Samples of
|
||||
| each available type of connection are provided inside this array.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'pusher' => [
|
||||
'driver' => 'pusher',
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
'cluster' => env('PUSHER_APP_CLUSTER'),
|
||||
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||
'port' => env('PUSHER_PORT', 443),
|
||||
'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||
'encrypted' => true,
|
||||
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
],
|
||||
'client_options' => [
|
||||
// Guzzle client options: https://docs.guzzlephp.org/en/stable/request-options.html
|
||||
],
|
||||
],
|
||||
|
||||
'ably' => [
|
||||
'driver' => 'ably',
|
||||
'key' => env('ABLY_KEY'),
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'driver' => 'log',
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'null',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default cache connection that gets used while
|
||||
| using this caching library. This connection is used when another is
|
||||
| not explicitly specified when executing a given caching function.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('CACHE_DRIVER', 'file'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Stores
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may define all of the cache "stores" for your application as
|
||||
| well as their drivers. You may even define multiple stores for the
|
||||
| same cache driver to group types of items stored in your caches.
|
||||
|
|
||||
| Supported drivers: "apc", "array", "database", "file",
|
||||
| "memcached", "redis", "dynamodb", "octane", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'stores' => [
|
||||
|
||||
'apc' => [
|
||||
'driver' => 'apc',
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'driver' => 'array',
|
||||
'serialize' => false,
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'cache',
|
||||
'connection' => null,
|
||||
'lock_connection' => null,
|
||||
],
|
||||
|
||||
'file' => [
|
||||
'driver' => 'file',
|
||||
'path' => storage_path('framework/cache/data'),
|
||||
'lock_path' => storage_path('framework/cache/data'),
|
||||
],
|
||||
|
||||
'memcached' => [
|
||||
'driver' => 'memcached',
|
||||
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
|
||||
'sasl' => [
|
||||
env('MEMCACHED_USERNAME'),
|
||||
env('MEMCACHED_PASSWORD'),
|
||||
],
|
||||
'options' => [
|
||||
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
|
||||
],
|
||||
'servers' => [
|
||||
[
|
||||
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
|
||||
'port' => env('MEMCACHED_PORT', 11211),
|
||||
'weight' => 100,
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'cache',
|
||||
'lock_connection' => 'default',
|
||||
],
|
||||
|
||||
'dynamodb' => [
|
||||
'driver' => 'dynamodb',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
|
||||
'endpoint' => env('DYNAMODB_ENDPOINT'),
|
||||
],
|
||||
|
||||
'octane' => [
|
||||
'driver' => 'octane',
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cache Key Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When utilizing the APC, database, memcached, Redis, or DynamoDB cache
|
||||
| stores there might be other applications using the same cache. For
|
||||
| that reason, you may prefix every cache key to avoid collisions.
|
||||
|
|
||||
*/
|
||||
|
||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
||||
|
||||
];
|
||||
@@ -0,0 +1,123 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Messenger display name
|
||||
|-------------------------------------
|
||||
*/
|
||||
'name' => env('CHATIFY_NAME', 'Chatify Messenger'),
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| The disk on which to store added
|
||||
| files and derived images by default.
|
||||
|-------------------------------------
|
||||
*/
|
||||
'storage_disk_name' => env('CHATIFY_STORAGE_DISK', 'public'),
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Routes configurations
|
||||
|-------------------------------------
|
||||
*/
|
||||
'routes' => [
|
||||
'prefix' => env('CHATIFY_ROUTES_PREFIX', 'chatify'),
|
||||
'middleware' => env('CHATIFY_ROUTES_MIDDLEWARE', ['web','auth']),
|
||||
'namespace' => env('CHATIFY_ROUTES_NAMESPACE', 'Chatify\Http\Controllers'),
|
||||
],
|
||||
'api_routes' => [
|
||||
'prefix' => env('CHATIFY_API_ROUTES_PREFIX', 'chatify/api'),
|
||||
'middleware' => env('CHATIFY_API_ROUTES_MIDDLEWARE', ['api']),
|
||||
'namespace' => env('CHATIFY_API_ROUTES_NAMESPACE', 'Chatify\Http\Controllers\Api'),
|
||||
],
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Pusher API credentials
|
||||
|-------------------------------------
|
||||
*/
|
||||
'pusher' => [
|
||||
'debug' => env('APP_DEBUG', false),
|
||||
'key' => env('PUSHER_APP_KEY'),
|
||||
'secret' => env('PUSHER_APP_SECRET'),
|
||||
'app_id' => env('PUSHER_APP_ID'),
|
||||
'options' => [
|
||||
'cluster' => env('PUSHER_APP_CLUSTER', 'mt1'),
|
||||
'host' => env('PUSHER_HOST') ?: 'api-'.env('PUSHER_APP_CLUSTER', 'mt1').'.pusher.com',
|
||||
'port' => env('PUSHER_PORT', 443),
|
||||
'scheme' => env('PUSHER_SCHEME', 'https'),
|
||||
'encrypted' => true,
|
||||
'useTLS' => env('PUSHER_SCHEME', 'https') === 'https',
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| User Avatar
|
||||
|-------------------------------------
|
||||
*/
|
||||
'user_avatar' => [
|
||||
'folder' => 'users-avatar',
|
||||
'default' => 'avatar.png',
|
||||
],
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Gravatar
|
||||
|
|
||||
| imageset property options:
|
||||
| [ 404 | mp | identicon (default) | monsterid | wavatar ]
|
||||
|-------------------------------------
|
||||
*/
|
||||
'gravatar' => [
|
||||
'enabled' => true,
|
||||
'image_size' => 200,
|
||||
'imageset' => 'identicon'
|
||||
],
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Attachments
|
||||
|-------------------------------------
|
||||
*/
|
||||
'attachments' => [
|
||||
'folder' => 'attachments',
|
||||
'download_route_name' => 'attachments.download',
|
||||
'allowed_images' => (array) ['png','jpg','jpeg','gif'],
|
||||
'allowed_files' => (array) ['zip','rar','txt'],
|
||||
'max_upload_size' => env('CHATIFY_MAX_FILE_SIZE', 150), // MB
|
||||
],
|
||||
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Messenger's colors
|
||||
|-------------------------------------
|
||||
*/
|
||||
'colors' => (array) [
|
||||
'#2180f3',
|
||||
'#2196F3',
|
||||
'#00BCD4',
|
||||
'#3F51B5',
|
||||
'#673AB7',
|
||||
'#4CAF50',
|
||||
'#FFC107',
|
||||
'#FF9800',
|
||||
'#ff2522',
|
||||
'#9C27B0',
|
||||
],
|
||||
/*
|
||||
|-------------------------------------
|
||||
| Sounds
|
||||
| You can enable/disable the sounds and
|
||||
| change sound's name/path placed at
|
||||
| `public/` directory of your app.
|
||||
|
|
||||
|-------------------------------------
|
||||
*/
|
||||
'sounds' => [
|
||||
'enabled' => true,
|
||||
'public_path' => 'sounds/chatify',
|
||||
'new_message' => 'new-message-sound.mp3',
|
||||
]
|
||||
];
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Cross-Origin Resource Sharing (CORS) Configuration
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure your settings for cross-origin resource sharing
|
||||
| or "CORS". This determines what cross-origin operations may execute
|
||||
| in web browsers. You are free to adjust these settings as needed.
|
||||
|
|
||||
| To learn more: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => ['api/*', 'sanctum/csrf-cookie'],
|
||||
|
||||
'allowed_methods' => ['*'],
|
||||
|
||||
'allowed_origins' => ['*'],
|
||||
|
||||
'allowed_origins_patterns' => [],
|
||||
|
||||
'allowed_headers' => ['*'],
|
||||
|
||||
'exposed_headers' => [],
|
||||
|
||||
'max_age' => 0,
|
||||
|
||||
'supports_credentials' => false,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,166 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Database Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify which of the database connections below you wish
|
||||
| to use as your default connection for all database work. Of course
|
||||
| you may use many connections at once using the Database library.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('DB_CONNECTION', 'pgsql'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Database Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here are each of the database connections setup for your application.
|
||||
| Of course, examples of configuring each database platform that is
|
||||
| supported by Laravel is shown below to make development simple.
|
||||
|
|
||||
|
|
||||
| All database work in Laravel is done through the PHP PDO facilities
|
||||
| so make sure you have the driver for your particular database of
|
||||
| choice installed on your machine before you begin development.
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sqlite' => [
|
||||
'driver' => 'sqlite',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'database' => env('DB_DATABASE', database_path('database.sqlite')),
|
||||
'prefix' => '',
|
||||
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
|
||||
],
|
||||
|
||||
'mysql' => [
|
||||
'driver' => 'mysql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '3306'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'unix_socket' => env('DB_SOCKET', ''),
|
||||
'charset' => 'utf8mb4',
|
||||
'collation' => 'utf8mb4_unicode_ci',
|
||||
'prefix' => '',
|
||||
'prefix_indexes'=> true,
|
||||
'strict' => false,
|
||||
'engine' => null,
|
||||
'options' => extension_loaded('pdo_mysql') ? array_filter([
|
||||
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
|
||||
]) : [],
|
||||
],
|
||||
|
||||
'pgsql' => [
|
||||
'driver' => 'pgsql',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', '127.0.0.1'),
|
||||
'port' => env('DB_PORT', '5432'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes'=> true,
|
||||
'search_path' => 'public',
|
||||
'sslmode' => 'prefer',
|
||||
],
|
||||
'mysqllistener' => [
|
||||
'driver' => 'mysql',
|
||||
'host' => env('DB_HOST_SQLLTR'),
|
||||
'port' => env('DB_PORT_SQLLTR'),
|
||||
'database' => env('DB_DATABASE_SQLLTR'),
|
||||
'username' => env('DB_USERNAME_SQLLTR'),
|
||||
'password' => env('DB_PASSWORD_SQLLTR'),
|
||||
],
|
||||
'sqlbd1' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'host' => env('DB_HOST_SQLBD1'),
|
||||
'port' => env('DB_PORT_SQLBD1'),
|
||||
'database' => env('DB_DATABASE_SQLBD1'),
|
||||
'username' => env('DB_USERNAME_SQLBD1'),
|
||||
'password' => env('DB_PASSWORD_SQLBD1'),
|
||||
],
|
||||
'sqlsrv' => [
|
||||
'driver' => 'sqlsrv',
|
||||
'url' => env('DATABASE_URL'),
|
||||
'host' => env('DB_HOST', 'localhost'),
|
||||
'port' => env('DB_PORT', '1433'),
|
||||
'database' => env('DB_DATABASE', 'forge'),
|
||||
'username' => env('DB_USERNAME', 'forge'),
|
||||
'password' => env('DB_PASSWORD', ''),
|
||||
'charset' => 'utf8',
|
||||
'prefix' => '',
|
||||
'prefix_indexes'=> true,
|
||||
// 'encrypt' => env('DB_ENCRYPT', 'yes'),
|
||||
// 'trust_server_certificate' => env('DB_TRUST_SERVER_CERTIFICATE', 'false'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Migration Repository Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This table keeps track of all the migrations that have already run for
|
||||
| your application. Using this information, we can determine which of
|
||||
| the migrations on disk haven't actually been run in the database.
|
||||
|
|
||||
*/
|
||||
|
||||
'migrations' => 'migrations',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Redis Databases
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Redis is an open source, fast, and advanced key-value store that also
|
||||
| provides a richer body of commands than a typical key-value system
|
||||
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
||||
|
|
||||
*/
|
||||
|
||||
'redis' => [
|
||||
|
||||
'client' => env('REDIS_CLIENT', 'phpredis'),
|
||||
|
||||
'options' => [
|
||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
||||
],
|
||||
|
||||
'default' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_DB', '0'),
|
||||
],
|
||||
|
||||
'cache' => [
|
||||
'url' => env('REDIS_URL'),
|
||||
'host' => env('REDIS_HOST', '127.0.0.1'),
|
||||
'username' => env('REDIS_USERNAME'),
|
||||
'password' => env('REDIS_PASSWORD'),
|
||||
'port' => env('REDIS_PORT', '6379'),
|
||||
'database' => env('REDIS_CACHE_DB', '1'),
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Filesystem Disk
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the default filesystem disk that should be used
|
||||
| by the framework. The "local" disk, as well as a variety of cloud
|
||||
| based disks are available to your application. Just store away!
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('FILESYSTEM_DISK', 'langsungpublic'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Filesystem Disks
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure as many filesystem "disks" as you wish, and you
|
||||
| may even configure multiple disks of the same driver. Defaults have
|
||||
| been set up for each driver as an example of the required values.
|
||||
|
|
||||
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
||||
|
|
||||
*/
|
||||
|
||||
'disks' => [
|
||||
|
||||
'local' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app'),
|
||||
'throw' => false,
|
||||
],
|
||||
'langsungpublic' => [
|
||||
'driver' => 'local',
|
||||
'root' => public_path(),
|
||||
'visibility' => 'public',
|
||||
],
|
||||
'public' => [
|
||||
'driver' => 'local',
|
||||
'root' => storage_path('app/public'),
|
||||
'url' => env('APP_URL').'/storage',
|
||||
'visibility' => 'public',
|
||||
'throw' => false,
|
||||
],
|
||||
|
||||
's3' => [
|
||||
'driver' => 's3',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION'),
|
||||
'bucket' => env('AWS_BUCKET'),
|
||||
'url' => env('AWS_URL'),
|
||||
'endpoint' => env('AWS_ENDPOINT'),
|
||||
'use_path_style_endpoint' => env('AWS_USE_PATH_STYLE_ENDPOINT', false),
|
||||
'throw' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Symbolic Links
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the symbolic links that will be created when the
|
||||
| `storage:link` Artisan command is executed. The array keys should be
|
||||
| the locations of the links and the values should be their targets.
|
||||
|
|
||||
*/
|
||||
|
||||
'links' => [
|
||||
public_path('storage') => storage_path('app/public'),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
return [
|
||||
'Title' => 'LIS',
|
||||
'namaapps' => 'Laboratory Information System',
|
||||
'domainapps' => 'RSUD Dr. Saiful Anwar',
|
||||
'subdomainapps' => 'Kota Malang',
|
||||
'subsubdomainapps' => 'Jawa Timur',
|
||||
'addressapps' => 'Jl. Lamandau 18A Bunulrejo Blimbing Malang',
|
||||
'kota' => 'Lumajang',
|
||||
'emailapps' => '[email protected]',
|
||||
'lamanapps' => 'https://lis.swandhana.test',
|
||||
'logofrontapps' => 'header.png',
|
||||
];
|
||||
?>
|
||||
@@ -0,0 +1,54 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Hash Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default hash driver that will be used to hash
|
||||
| passwords for your application. By default, the bcrypt algorithm is
|
||||
| used; however, you remain free to modify this option if you wish.
|
||||
|
|
||||
| Supported: "bcrypt", "argon", "argon2id"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => 'bcrypt',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Bcrypt Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Bcrypt algorithm. This will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'bcrypt' => [
|
||||
'rounds' => env('BCRYPT_ROUNDS', 12),
|
||||
'verify' => true,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Argon Options
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the configuration options that should be used when
|
||||
| passwords are hashed using the Argon algorithm. These will allow you
|
||||
| to control the amount of time it takes to hash the given password.
|
||||
|
|
||||
*/
|
||||
|
||||
'argon' => [
|
||||
'memory' => 65536,
|
||||
'threads' => 1,
|
||||
'time' => 4,
|
||||
'verify' => true,
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,146 @@
|
||||
<?php
|
||||
|
||||
use Arcanedev\LogViewer\Contracts\Utilities\Filesystem;
|
||||
|
||||
return [
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Log files storage path
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'storage-path' => storage_path('logs'),
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Log files pattern
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'pattern' => [
|
||||
'prefix' => Filesystem::PATTERN_PREFIX, // 'laravel-'
|
||||
'date' => Filesystem::PATTERN_DATE, // '[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]'
|
||||
'extension' => Filesystem::PATTERN_EXTENSION, // '.log'
|
||||
],
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Locale
|
||||
| -----------------------------------------------------------------
|
||||
| Supported locales :
|
||||
| 'auto', 'ar', 'bg', 'de', 'en', 'es', 'et', 'fa', 'fr', 'hu', 'hy', 'id', 'it', 'ja', 'ko', 'nl',
|
||||
| 'pl', 'pt-BR', 'ro', 'ru', 'sv', 'th', 'tr', 'zh-TW', 'zh'
|
||||
*/
|
||||
|
||||
'locale' => 'auto',
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Theme
|
||||
| -----------------------------------------------------------------
|
||||
| Supported themes :
|
||||
| 'bootstrap-5'
|
||||
| 'bootstrap-4'
|
||||
| 'bootstrap-3'
|
||||
|
|
||||
| You can make your own theme by adding a folder to the views directory and specifying it here.
|
||||
*/
|
||||
|
||||
'theme' => 'bootstrap-5',
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Route settings
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'route' => [
|
||||
'enabled' => true,
|
||||
|
||||
'attributes' => [
|
||||
'prefix' => 'log-viewer',
|
||||
|
||||
'middleware' => env('ARCANEDEV_LOGVIEWER_MIDDLEWARE') ? explode(',', env('ARCANEDEV_LOGVIEWER_MIDDLEWARE')) : null,
|
||||
],
|
||||
|
||||
'show' => 'log-viewer::logs.show'
|
||||
],
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Log entries per page
|
||||
| -----------------------------------------------------------------
|
||||
| This defines how many logs & entries are displayed per page.
|
||||
*/
|
||||
|
||||
'per-page' => 30,
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Download settings
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'download' => [
|
||||
'prefix' => 'laravel-',
|
||||
|
||||
'extension' => 'log',
|
||||
],
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Menu settings
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'menu' => [
|
||||
'filter-route' => 'log-viewer::logs.filter',
|
||||
|
||||
'icons-enabled' => true,
|
||||
],
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Icons
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'icons' => [
|
||||
/**
|
||||
* Font awesome >= 4.3
|
||||
* http://fontawesome.io/icons/
|
||||
*/
|
||||
'all' => 'fa fa-fw fa-list', // http://fontawesome.io/icon/list/
|
||||
'emergency' => 'fa fa-fw fa-bug', // http://fontawesome.io/icon/bug/
|
||||
'alert' => 'fa fa-fw fa-bullhorn', // http://fontawesome.io/icon/bullhorn/
|
||||
'critical' => 'fa fa-fw fa-heartbeat', // http://fontawesome.io/icon/heartbeat/
|
||||
'error' => 'fa fa-fw fa-times-circle', // http://fontawesome.io/icon/times-circle/
|
||||
'warning' => 'fa fa-fw fa-exclamation-triangle', // http://fontawesome.io/icon/exclamation-triangle/
|
||||
'notice' => 'fa fa-fw fa-exclamation-circle', // http://fontawesome.io/icon/exclamation-circle/
|
||||
'info' => 'fa fa-fw fa-info-circle', // http://fontawesome.io/icon/info-circle/
|
||||
'debug' => 'fa fa-fw fa-life-ring', // http://fontawesome.io/icon/life-ring/
|
||||
],
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Colors
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'colors' => [
|
||||
'levels' => [
|
||||
'empty' => '#D1D1D1',
|
||||
'all' => '#8A8A8A',
|
||||
'emergency' => '#B71C1C',
|
||||
'alert' => '#D32F2F',
|
||||
'critical' => '#F44336',
|
||||
'error' => '#FF5722',
|
||||
'warning' => '#FF9100',
|
||||
'notice' => '#4CAF50',
|
||||
'info' => '#1976D2',
|
||||
'debug' => '#90CAF9',
|
||||
],
|
||||
],
|
||||
|
||||
/* -----------------------------------------------------------------
|
||||
| Strings to highlight in stack trace
|
||||
| -----------------------------------------------------------------
|
||||
*/
|
||||
|
||||
'highlight' => [
|
||||
'^#\d+',
|
||||
'^Stack trace:',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,131 @@
|
||||
<?php
|
||||
|
||||
use Monolog\Handler\NullHandler;
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Monolog\Handler\SyslogUdpHandler;
|
||||
use Monolog\Processor\PsrLogMessageProcessor;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option defines the default log channel that gets used when writing
|
||||
| messages to the logs. The name specified in this option should match
|
||||
| one of the channels defined in the "channels" configuration array.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('LOG_CHANNEL', 'stack'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Deprecations Log Channel
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the log channel that should be used to log warnings
|
||||
| regarding deprecated PHP and library features. This allows you to get
|
||||
| your application ready for upcoming major versions of dependencies.
|
||||
|
|
||||
*/
|
||||
|
||||
'deprecations' => [
|
||||
'channel' => env('LOG_DEPRECATIONS_CHANNEL', 'null'),
|
||||
'trace' => false,
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Log Channels
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the log channels for your application. Out of
|
||||
| the box, Laravel uses the Monolog PHP logging library. This gives
|
||||
| you a variety of powerful log handlers / formatters to utilize.
|
||||
|
|
||||
| Available Drivers: "single", "daily", "slack", "syslog",
|
||||
| "errorlog", "monolog",
|
||||
| "custom", "stack"
|
||||
|
|
||||
*/
|
||||
|
||||
'channels' => [
|
||||
'stack' => [
|
||||
'driver' => 'stack',
|
||||
'channels' => ['single'],
|
||||
'ignore_exceptions' => false,
|
||||
],
|
||||
|
||||
'single' => [
|
||||
'driver' => 'single',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'daily' => [
|
||||
'driver' => 'daily',
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'days' => 14,
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'slack' => [
|
||||
'driver' => 'slack',
|
||||
'url' => env('LOG_SLACK_WEBHOOK_URL'),
|
||||
'username' => 'Laravel Log',
|
||||
'emoji' => ':boom:',
|
||||
'level' => env('LOG_LEVEL', 'critical'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'papertrail' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => env('LOG_PAPERTRAIL_HANDLER', SyslogUdpHandler::class),
|
||||
'handler_with' => [
|
||||
'host' => env('PAPERTRAIL_URL'),
|
||||
'port' => env('PAPERTRAIL_PORT'),
|
||||
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
||||
],
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'stderr' => [
|
||||
'driver' => 'monolog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'handler' => StreamHandler::class,
|
||||
'formatter' => env('LOG_STDERR_FORMATTER'),
|
||||
'with' => [
|
||||
'stream' => 'php://stderr',
|
||||
],
|
||||
'processors' => [PsrLogMessageProcessor::class],
|
||||
],
|
||||
|
||||
'syslog' => [
|
||||
'driver' => 'syslog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'facility' => LOG_USER,
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'errorlog' => [
|
||||
'driver' => 'errorlog',
|
||||
'level' => env('LOG_LEVEL', 'debug'),
|
||||
'replace_placeholders' => true,
|
||||
],
|
||||
|
||||
'null' => [
|
||||
'driver' => 'monolog',
|
||||
'handler' => NullHandler::class,
|
||||
],
|
||||
|
||||
'emergency' => [
|
||||
'path' => storage_path('logs/laravel.log'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
+134
@@ -0,0 +1,134 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Mailer
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default mailer that is used to send any email
|
||||
| messages sent by your application. Alternative mailers may be setup
|
||||
| and used as needed; however, this mailer will be used by default.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('MAIL_MAILER', 'smtp'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Mailer Configurations
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure all of the mailers used by your application plus
|
||||
| their respective settings. Several examples have been configured for
|
||||
| you and you are free to add your own as your application requires.
|
||||
|
|
||||
| Laravel supports a variety of mail "transport" drivers to be used while
|
||||
| sending an e-mail. You will specify which one you are using for your
|
||||
| mailers below. You are free to add additional mailers as required.
|
||||
|
|
||||
| Supported: "smtp", "sendmail", "mailgun", "ses", "ses-v2",
|
||||
| "postmark", "log", "array", "failover", "roundrobin"
|
||||
|
|
||||
*/
|
||||
|
||||
'mailers' => [
|
||||
'smtp' => [
|
||||
'transport' => 'smtp',
|
||||
'url' => env('MAIL_URL'),
|
||||
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
|
||||
'port' => env('MAIL_PORT', 587),
|
||||
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
|
||||
'username' => env('MAIL_USERNAME'),
|
||||
'password' => env('MAIL_PASSWORD'),
|
||||
'timeout' => null,
|
||||
'local_domain' => env('MAIL_EHLO_DOMAIN'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'transport' => 'ses',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'transport' => 'postmark',
|
||||
// 'message_stream_id' => null,
|
||||
// 'client' => [
|
||||
// 'timeout' => 5,
|
||||
// ],
|
||||
],
|
||||
|
||||
'mailgun' => [
|
||||
'transport' => 'mailgun',
|
||||
// 'client' => [
|
||||
// 'timeout' => 5,
|
||||
// ],
|
||||
],
|
||||
|
||||
'sendmail' => [
|
||||
'transport' => 'sendmail',
|
||||
'path' => env('MAIL_SENDMAIL_PATH', '/usr/sbin/sendmail -bs -i'),
|
||||
],
|
||||
|
||||
'log' => [
|
||||
'transport' => 'log',
|
||||
'channel' => env('MAIL_LOG_CHANNEL'),
|
||||
],
|
||||
|
||||
'array' => [
|
||||
'transport' => 'array',
|
||||
],
|
||||
|
||||
'failover' => [
|
||||
'transport' => 'failover',
|
||||
'mailers' => [
|
||||
'smtp',
|
||||
'log',
|
||||
],
|
||||
],
|
||||
|
||||
'roundrobin' => [
|
||||
'transport' => 'roundrobin',
|
||||
'mailers' => [
|
||||
'ses',
|
||||
'postmark',
|
||||
],
|
||||
],
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Global "From" Address
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| You may wish for all e-mails sent by your application to be sent from
|
||||
| the same address. Here, you may specify a name and address that is
|
||||
| used globally for all e-mails that are sent by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'from' => [
|
||||
'address' => env('MAIL_FROM_ADDRESS', '[email protected]'),
|
||||
'name' => env('MAIL_FROM_NAME', 'Example'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Markdown Mail Settings
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| If you are using Markdown based email rendering, you may configure your
|
||||
| theme and component paths here, allowing you to customize the design
|
||||
| of the emails. Or, you may simply stick with the Laravel defaults!
|
||||
|
|
||||
*/
|
||||
|
||||
'markdown' => [
|
||||
'theme' => 'default',
|
||||
|
||||
'paths' => [
|
||||
resource_path('views/vendor/mail'),
|
||||
],
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,109 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Queue Connection Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Laravel's queue API supports an assortment of back-ends via a single
|
||||
| API, giving you convenient access to each back-end using the same
|
||||
| syntax for every one. Here you may define a default connection.
|
||||
|
|
||||
*/
|
||||
|
||||
'default' => env('QUEUE_CONNECTION', 'sync'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Queue Connections
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may configure the connection information for each server that
|
||||
| is used by your application. A default configuration has been added
|
||||
| for each back-end shipped with Laravel. You are free to add more.
|
||||
|
|
||||
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
||||
|
|
||||
*/
|
||||
|
||||
'connections' => [
|
||||
|
||||
'sync' => [
|
||||
'driver' => 'sync',
|
||||
],
|
||||
|
||||
'database' => [
|
||||
'driver' => 'database',
|
||||
'table' => 'jobs',
|
||||
'queue' => 'default',
|
||||
'retry_after' => 90,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'beanstalkd' => [
|
||||
'driver' => 'beanstalkd',
|
||||
'host' => 'localhost',
|
||||
'queue' => 'default',
|
||||
'retry_after' => 90,
|
||||
'block_for' => 0,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'sqs' => [
|
||||
'driver' => 'sqs',
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
|
||||
'queue' => env('SQS_QUEUE', 'default'),
|
||||
'suffix' => env('SQS_SUFFIX'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
'redis' => [
|
||||
'driver' => 'redis',
|
||||
'connection' => 'default',
|
||||
'queue' => env('REDIS_QUEUE', 'default'),
|
||||
'retry_after' => 90,
|
||||
'block_for' => null,
|
||||
'after_commit' => false,
|
||||
],
|
||||
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Job Batching
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The following options configure the database and table that store job
|
||||
| batching information. These options can be updated to any database
|
||||
| connection and table which has been defined by your application.
|
||||
|
|
||||
*/
|
||||
|
||||
'batching' => [
|
||||
'database' => env('DB_CONNECTION', 'mysql'),
|
||||
'table' => 'job_batches',
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Failed Queue Jobs
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| These options configure the behavior of failed queue job logging so you
|
||||
| can control which database and table are used to store the jobs that
|
||||
| have failed. You may change them to any database / table you wish.
|
||||
|
|
||||
*/
|
||||
|
||||
'failed' => [
|
||||
'driver' => env('QUEUE_FAILED_DRIVER', 'database-uuids'),
|
||||
'database' => env('DB_CONNECTION', 'mysql'),
|
||||
'table' => 'failed_jobs',
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Stateful Domains
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Requests from the following domains / hosts will receive stateful API
|
||||
| authentication cookies. Typically, these should include your local
|
||||
| and production domains which access your API via a frontend SPA.
|
||||
|
|
||||
*/
|
||||
|
||||
'stateful' => explode(',', env('SANCTUM_STATEFUL_DOMAINS', sprintf(
|
||||
'%s%s',
|
||||
'localhost,localhost:3000,127.0.0.1,127.0.0.1:8000,::1',
|
||||
Sanctum::currentApplicationUrlWithPort()
|
||||
))),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Guards
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This array contains the authentication guards that will be checked when
|
||||
| Sanctum is trying to authenticate a request. If none of these guards
|
||||
| are able to authenticate the request, Sanctum will use the bearer
|
||||
| token that's present on an incoming request for authentication.
|
||||
|
|
||||
*/
|
||||
|
||||
'guard' => ['web'],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Expiration Minutes
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This value controls the number of minutes until an issued token will be
|
||||
| considered expired. This will override any values set in the token's
|
||||
| "expires_at" attribute, but first-party sessions are not affected.
|
||||
|
|
||||
*/
|
||||
|
||||
'expiration' => null,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Token Prefix
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Sanctum can prefix new tokens in order to take advantage of numerous
|
||||
| security scanning initiatives maintained by open source platforms
|
||||
| that notify developers if they commit tokens into repositories.
|
||||
|
|
||||
| See: https://docs.github.com/en/code-security/secret-scanning/about-secret-scanning
|
||||
|
|
||||
*/
|
||||
|
||||
'token_prefix' => env('SANCTUM_TOKEN_PREFIX', ''),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Sanctum Middleware
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When authenticating your first-party SPA with Sanctum you may need to
|
||||
| customize some of the middleware Sanctum uses while processing the
|
||||
| request. You may change the middleware listed below as required.
|
||||
|
|
||||
*/
|
||||
|
||||
'middleware' => [
|
||||
'authenticate_session' => Laravel\Sanctum\Http\Middleware\AuthenticateSession::class,
|
||||
'encrypt_cookies' => App\Http\Middleware\EncryptCookies::class,
|
||||
'verify_csrf_token' => App\Http\Middleware\VerifyCsrfToken::class,
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Third Party Services
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This file is for storing the credentials for third party services such
|
||||
| as Mailgun, Postmark, AWS and more. This file provides the de facto
|
||||
| location for this type of information, allowing packages to have
|
||||
| a conventional file to locate the various service credentials.
|
||||
|
|
||||
*/
|
||||
|
||||
'mailgun' => [
|
||||
'domain' => env('MAILGUN_DOMAIN'),
|
||||
'secret' => env('MAILGUN_SECRET'),
|
||||
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
|
||||
'scheme' => 'https',
|
||||
],
|
||||
|
||||
'postmark' => [
|
||||
'token' => env('POSTMARK_TOKEN'),
|
||||
],
|
||||
|
||||
'ses' => [
|
||||
'key' => env('AWS_ACCESS_KEY_ID'),
|
||||
'secret' => env('AWS_SECRET_ACCESS_KEY'),
|
||||
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
|
||||
],
|
||||
|
||||
];
|
||||
@@ -0,0 +1,214 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Default Session Driver
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option controls the default session "driver" that will be used on
|
||||
| requests. By default, we will use the lightweight native driver but
|
||||
| you may specify any of the other wonderful drivers provided here.
|
||||
|
|
||||
| Supported: "file", "cookie", "database", "apc",
|
||||
| "memcached", "redis", "dynamodb", "array"
|
||||
|
|
||||
*/
|
||||
|
||||
'driver' => env('SESSION_DRIVER', 'file'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Lifetime
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may specify the number of minutes that you wish the session
|
||||
| to be allowed to remain idle before it expires. If you want them
|
||||
| to immediately expire on the browser closing, set that option.
|
||||
|
|
||||
*/
|
||||
|
||||
'lifetime' => env('SESSION_LIFETIME', 120),
|
||||
|
||||
'expire_on_close' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Encryption
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option allows you to easily specify that all of your session data
|
||||
| should be encrypted before it is stored. All encryption will be run
|
||||
| automatically by Laravel and you can use the Session like normal.
|
||||
|
|
||||
*/
|
||||
|
||||
'encrypt' => false,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session File Location
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the native session driver, we need a location where session
|
||||
| files may be stored. A default has been set for you but a different
|
||||
| location may be specified. This is only needed for file sessions.
|
||||
|
|
||||
*/
|
||||
|
||||
'files' => storage_path('framework/sessions'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Connection
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" or "redis" session drivers, you may specify a
|
||||
| connection that should be used to manage these sessions. This should
|
||||
| correspond to a connection in your database configuration options.
|
||||
|
|
||||
*/
|
||||
|
||||
'connection' => env('SESSION_CONNECTION'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Database Table
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| When using the "database" session driver, you may specify the table we
|
||||
| should use to manage the sessions. Of course, a sensible default is
|
||||
| provided for you; however, you are free to change this as needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'table' => 'sessions',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cache Store
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| While using one of the framework's cache driven session backends you may
|
||||
| list a cache store that should be used for these sessions. This value
|
||||
| must match with one of the application's configured cache "stores".
|
||||
|
|
||||
| Affects: "apc", "dynamodb", "memcached", "redis"
|
||||
|
|
||||
*/
|
||||
|
||||
'store' => env('SESSION_STORE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Sweeping Lottery
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Some session drivers must manually sweep their storage location to get
|
||||
| rid of old sessions from storage. Here are the chances that it will
|
||||
| happen on a given request. By default, the odds are 2 out of 100.
|
||||
|
|
||||
*/
|
||||
|
||||
'lottery' => [2, 100],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Name
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the name of the cookie used to identify a session
|
||||
| instance by ID. The name specified here will get used every time a
|
||||
| new session cookie is created by the framework for every driver.
|
||||
|
|
||||
*/
|
||||
|
||||
'cookie' => env(
|
||||
'SESSION_COOKIE',
|
||||
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
||||
),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| The session cookie path determines the path for which the cookie will
|
||||
| be regarded as available. Typically, this will be the root path of
|
||||
| your application but you are free to change this when necessary.
|
||||
|
|
||||
*/
|
||||
|
||||
'path' => '/',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Session Cookie Domain
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Here you may change the domain of the cookie used to identify a session
|
||||
| in your application. This will determine which domains the cookie is
|
||||
| available to in your application. A sensible default has been set.
|
||||
|
|
||||
*/
|
||||
|
||||
'domain' => env('SESSION_DOMAIN'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTPS Only Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| By setting this option to true, session cookies will only be sent back
|
||||
| to the server if the browser has a HTTPS connection. This will keep
|
||||
| the cookie from being sent to you when it can't be done securely.
|
||||
|
|
||||
*/
|
||||
|
||||
'secure' => env('SESSION_SECURE_COOKIE'),
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| HTTP Access Only
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will prevent JavaScript from accessing the
|
||||
| value of the cookie and the cookie will only be accessible through
|
||||
| the HTTP protocol. You are free to modify this option if needed.
|
||||
|
|
||||
*/
|
||||
|
||||
'http_only' => true,
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Same-Site Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines how your cookies behave when cross-site requests
|
||||
| take place, and can be used to mitigate CSRF attacks. By default, we
|
||||
| will set this value to "lax" since this is a secure default value.
|
||||
|
|
||||
| Supported: "lax", "strict", "none", null
|
||||
|
|
||||
*/
|
||||
|
||||
'same_site' => 'lax',
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Partitioned Cookies
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Setting this value to true will tie the cookie to the top-level site for
|
||||
| a cross-site context. Partitioned cookies are accepted by the browser
|
||||
| when flagged "secure" and the Same-Site attribute is set to "none".
|
||||
|
|
||||
*/
|
||||
|
||||
'partitioned' => false,
|
||||
|
||||
];
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
return [
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| View Storage Paths
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| Most templating systems load templates from disk. Here you may specify
|
||||
| an array of paths that should be checked for your views. Of course
|
||||
| the usual Laravel view path has already been registered for you.
|
||||
|
|
||||
*/
|
||||
|
||||
'paths' => [
|
||||
resource_path('views'),
|
||||
],
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
| Compiled View Path
|
||||
|--------------------------------------------------------------------------
|
||||
|
|
||||
| This option determines where all the compiled Blade templates will be
|
||||
| stored for your application. Typically, this is within the storage
|
||||
| directory. However, as usual, you are free to change this value.
|
||||
|
|
||||
*/
|
||||
|
||||
'compiled' => env(
|
||||
'VIEW_COMPILED_PATH',
|
||||
realpath(storage_path('framework/views'))
|
||||
),
|
||||
|
||||
];
|
||||
Loaded 100 of 15186 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in New Issue
Block a user