refx pint
This commit is contained in:
parent
ba8a2fb28c
commit
855fb76d7e
@ -34,10 +34,10 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
return '<img class="rounded-circle me-2" height="24px" width="24px" src="'.$study->readingPhysician->avatar().'"></img>'.$study->readingPhysician->display_name;
|
return '<img class="rounded-circle me-2" height="24px" width="24px" src="' . $study->readingPhysician->avatar() . '"></img>' . $study->readingPhysician->display_name;
|
||||||
})
|
})
|
||||||
->editColumn('images', function (Study $study) {
|
->editColumn('images', function (Study $study) {
|
||||||
return $study->numInstances().'<small class="text-muted ms-2 fw-lighter fs-xsmall">'.human_filesize($study->disk_size).'</small>';
|
return $study->numInstances() . '<small class="text-muted ms-2 fw-lighter fs-xsmall">' . human_filesize($study->disk_size) . '</small>';
|
||||||
})
|
})
|
||||||
->editColumn('study_date', function (Study $study) {
|
->editColumn('study_date', function (Study $study) {
|
||||||
return self::dtFormat($study->study_date);
|
return self::dtFormat($study->study_date);
|
||||||
@ -49,9 +49,9 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
|
|||||||
return self::dtFormat($study->received_at);
|
return self::dtFormat($study->received_at);
|
||||||
})
|
})
|
||||||
->editColumn('show_study', function (Study $study) {
|
->editColumn('show_study', function (Study $study) {
|
||||||
$btn = '<a href="#" data-id="'._h($study->id).'" class="btn btn-outline-facebook btn-xs showStudy">Show</a>';
|
$btn = '<a href="#" data-id="' . _h($study->id) . '" class="btn btn-outline-facebook btn-xs showStudy">Show</a>';
|
||||||
$btn .= ' <a href="#" data-id="'._h($study->id).'" class="edit btn btn-primary btn-xs editStudy">Edit</a>';
|
$btn .= ' <a href="#" data-id="' . _h($study->id) . '" class="edit btn btn-primary btn-xs editStudy">Edit</a>';
|
||||||
$btn .= ' <a href="#" data-id="'._h($study->id).'" class="btn btn-danger btn-xs deleteStudy">Delete</a>';
|
$btn .= ' <a href="#" data-id="' . _h($study->id) . '" class="btn btn-danger btn-xs deleteStudy">Delete</a>';
|
||||||
|
|
||||||
return $btn;
|
return $btn;
|
||||||
})
|
})
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Throwable;
|
|
||||||
|
|
||||||
use function Sentry\captureException;
|
use function Sentry\captureException;
|
||||||
|
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
abstract class HashidActionControllerBase extends Controller
|
abstract class HashidActionControllerBase extends Controller
|
||||||
{
|
{
|
||||||
protected ?int $key = null;
|
protected ?int $key = null;
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace App\Http\Controllers;
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
use Throwable;
|
|
||||||
|
|
||||||
use function Sentry\captureException as gobble;
|
use function Sentry\captureException as gobble;
|
||||||
|
|
||||||
|
use Throwable;
|
||||||
|
|
||||||
abstract class HashidControllerBase extends Controller
|
abstract class HashidControllerBase extends Controller
|
||||||
{
|
{
|
||||||
protected ?int $key = null;
|
protected ?int $key = null;
|
||||||
|
@ -14,7 +14,7 @@ private function loadViewer(\Closure $callback)
|
|||||||
$study = Study::findOrFail($this->key);
|
$study = Study::findOrFail($this->key);
|
||||||
$url = $callback($study);
|
$url = $callback($study);
|
||||||
abort_if(blank($url), 404);
|
abort_if(blank($url), 404);
|
||||||
$title = Str::limit($study->patient_name, 20).' | '.config('app.name');
|
$title = Str::limit($study->patient_name, 20) . ' | ' . config('app.name');
|
||||||
|
|
||||||
return view('staff.studies.viewer', compact('url', 'title'));
|
return view('staff.studies.viewer', compact('url', 'title'));
|
||||||
}
|
}
|
||||||
|
@ -100,7 +100,7 @@ public function getMetadataLink(): string
|
|||||||
public function sexAge(): string
|
public function sexAge(): string
|
||||||
{
|
{
|
||||||
$dob = $this->patient_birthdate;
|
$dob = $this->patient_birthdate;
|
||||||
$age = $dob ? (int) Carbon::make($dob)->diffInYears().'Y' : null;
|
$age = $dob ? (int) Carbon::make($dob)->diffInYears() . 'Y' : null;
|
||||||
if (blank($age) && blank($this->patient_sex)) {
|
if (blank($age) && blank($this->patient_sex)) {
|
||||||
return '~';
|
return '~';
|
||||||
}
|
}
|
||||||
|
@ -121,6 +121,6 @@ public function toString(): string
|
|||||||
/** @param Int32BitMask $value */
|
/** @param Int32BitMask $value */
|
||||||
public static function valueToString(int $value): string
|
public static function valueToString(int $value): string
|
||||||
{
|
{
|
||||||
return '0b'.substr(chunk_split(sprintf('%\'032b', $value), 4, '_'), 0, -1);
|
return '0b' . substr(chunk_split(sprintf('%\'032b', $value), 4, '_'), 0, -1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -97,7 +97,7 @@ public function scopeActive($query)
|
|||||||
|
|
||||||
public function isAdmin(): bool
|
public function isAdmin(): bool
|
||||||
{
|
{
|
||||||
return cache()->remember('user.is_admin:'.$this->id,
|
return cache()->remember('user.is_admin:' . $this->id,
|
||||||
5 * 60,
|
5 * 60,
|
||||||
fn () => $this->hasRole(UserRole::Admin)
|
fn () => $this->hasRole(UserRole::Admin)
|
||||||
);
|
);
|
||||||
@ -105,7 +105,7 @@ public function isAdmin(): bool
|
|||||||
|
|
||||||
public function isTech(): bool
|
public function isTech(): bool
|
||||||
{
|
{
|
||||||
return cache()->remember('user.is_tech:'.$this->id,
|
return cache()->remember('user.is_tech:' . $this->id,
|
||||||
5 * 60,
|
5 * 60,
|
||||||
fn () => $this->hasRole(UserRole::Technician)
|
fn () => $this->hasRole(UserRole::Technician)
|
||||||
);
|
);
|
||||||
@ -113,7 +113,7 @@ public function isTech(): bool
|
|||||||
|
|
||||||
public function primaryRole(): string
|
public function primaryRole(): string
|
||||||
{
|
{
|
||||||
return cache()->remember('user.pri_role:'.$this->id,
|
return cache()->remember('user.pri_role:' . $this->id,
|
||||||
5 * 60,
|
5 * 60,
|
||||||
fn () => Str::title($this->roles()->first()->name)
|
fn () => Str::title($this->roles()->first()->name)
|
||||||
);
|
);
|
||||||
@ -136,7 +136,7 @@ public function getLastSeenAttribute(): Carbon
|
|||||||
|
|
||||||
public function getFullNameAttribute(): string
|
public function getFullNameAttribute(): string
|
||||||
{
|
{
|
||||||
return trim($this->first_name.' '.$this->last_name);
|
return trim($this->first_name . ' ' . $this->last_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function avatar(bool $gravatar = false): string
|
public function avatar(bool $gravatar = false): string
|
||||||
|
@ -34,7 +34,7 @@ public function boot(): void
|
|||||||
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
|
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
|
||||||
|
|
||||||
RateLimiter::for('login', function (Request $request) {
|
RateLimiter::for('login', function (Request $request) {
|
||||||
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())).'|'.$request->ip());
|
$throttleKey = Str::transliterate(Str::lower($request->input(Fortify::username())) . '|' . $request->ip());
|
||||||
|
|
||||||
return Limit::perMinute(5)->by($throttleKey);
|
return Limit::perMinute(5)->by($throttleKey);
|
||||||
});
|
});
|
||||||
|
@ -22,6 +22,6 @@ public static function dateTimeToCarbon(?string $datePart, ?string $timePart, st
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Carbon::createFromFormat('YmdHis', $datePart.Str::before($timePart, '.'), $timezone);
|
return Carbon::createFromFormat('YmdHis', $datePart . Str::before($timePart, '.'), $timezone);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -15,7 +15,7 @@ public function getClient(): Client
|
|||||||
|
|
||||||
public function getStudyStatistics(string $study_id): array
|
public function getStudyStatistics(string $study_id): array
|
||||||
{
|
{
|
||||||
$response = $this->getClient()->get('/studies/'.$study_id.'/statistics');
|
$response = $this->getClient()->get('/studies/' . $study_id . '/statistics');
|
||||||
|
|
||||||
return json_decode($response->getBody()->getContents(), true);
|
return json_decode($response->getBody()->getContents(), true);
|
||||||
}
|
}
|
||||||
@ -29,14 +29,14 @@ public function getServerStatistics(): array
|
|||||||
|
|
||||||
public function getStudySeries(string $study_id): array
|
public function getStudySeries(string $study_id): array
|
||||||
{
|
{
|
||||||
$response = $this->getClient()->get('/studies/'.$study_id.'/series?expand');
|
$response = $this->getClient()->get('/studies/' . $study_id . '/series?expand');
|
||||||
|
|
||||||
return json_decode($response->getBody()->getContents(), true);
|
return json_decode($response->getBody()->getContents(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getStudyInstances(string $study_id): array
|
public function getStudyInstances(string $study_id): array
|
||||||
{
|
{
|
||||||
$response = $this->getClient()->get('/studies/'.$study_id.'/instances?expand');
|
$response = $this->getClient()->get('/studies/' . $study_id . '/instances?expand');
|
||||||
|
|
||||||
return json_decode($response->getBody()->getContents(), true);
|
return json_decode($response->getBody()->getContents(), true);
|
||||||
}
|
}
|
||||||
@ -46,7 +46,7 @@ public function getStudyDetails(string $study_id): array
|
|||||||
$query = [
|
$query = [
|
||||||
'requested-tags' => implode(';', array_column(DicomTags::cases(), 'value')),
|
'requested-tags' => implode(';', array_column(DicomTags::cases(), 'value')),
|
||||||
];
|
];
|
||||||
$response = $this->getClient()->get('/studies/'.$study_id.'?'.http_build_query($query));
|
$response = $this->getClient()->get('/studies/' . $study_id . '?' . http_build_query($query));
|
||||||
|
|
||||||
return json_decode($response->getBody()->getContents(), true);
|
return json_decode($response->getBody()->getContents(), true);
|
||||||
}
|
}
|
||||||
@ -57,7 +57,7 @@ public function getStudies(): array
|
|||||||
'expand' => '1',
|
'expand' => '1',
|
||||||
'requested-tags' => implode(';', array_column(DicomTags::cases(), 'value')),
|
'requested-tags' => implode(';', array_column(DicomTags::cases(), 'value')),
|
||||||
];
|
];
|
||||||
$url = '/studies?'.http_build_query($query);
|
$url = '/studies?' . http_build_query($query);
|
||||||
$response = $this->getClient()->get($url);
|
$response = $this->getClient()->get($url);
|
||||||
|
|
||||||
return json_decode($response->getBody()->getContents(), true);
|
return json_decode($response->getBody()->getContents(), true);
|
||||||
|
@ -48,7 +48,7 @@ public static function ohifSegmentation(string $study_uid): string
|
|||||||
public static function archive(string $study_uid): string
|
public static function archive(string $study_uid): string
|
||||||
{
|
{
|
||||||
$url = Uri::of(config('pacs.api.endpoint'))
|
$url = Uri::of(config('pacs.api.endpoint'))
|
||||||
->withPath('/studies/'.$study_uid.'/archive');
|
->withPath('/studies/' . $study_uid . '/archive');
|
||||||
|
|
||||||
return (string) $url;
|
return (string) $url;
|
||||||
}
|
}
|
||||||
|
@ -219,7 +219,7 @@ public static function updatePageConfig($pageConfigs): void
|
|||||||
if (isset($pageConfigs)) {
|
if (isset($pageConfigs)) {
|
||||||
if (count($pageConfigs) > 0) {
|
if (count($pageConfigs) > 0) {
|
||||||
foreach ($pageConfigs as $config => $val) {
|
foreach ($pageConfigs as $config => $val) {
|
||||||
Config::set('custom.'.$demo.'.'.$config, $val);
|
Config::set('custom.' . $demo . '.' . $config, $val);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,9 +7,9 @@
|
|||||||
|
|
||||||
return Application::configure(basePath: dirname(__DIR__))
|
return Application::configure(basePath: dirname(__DIR__))
|
||||||
->withRouting(
|
->withRouting(
|
||||||
web: __DIR__.'/../routes/web.php',
|
web: __DIR__ . '/../routes/web.php',
|
||||||
api: __DIR__.'/../routes/api.php',
|
api: __DIR__ . '/../routes/api.php',
|
||||||
commands: __DIR__.'/../routes/console.php',
|
commands: __DIR__ . '/../routes/console.php',
|
||||||
health: '/up',
|
health: '/up',
|
||||||
)
|
)
|
||||||
->withMiddleware(function (Middleware $middleware) {
|
->withMiddleware(function (Middleware $middleware) {
|
||||||
|
@ -91,6 +91,7 @@
|
|||||||
"fix": "php-cs-fixer fix",
|
"fix": "php-cs-fixer fix",
|
||||||
"dev": [
|
"dev": [
|
||||||
"Composer\\Config::disableProcessTimeout",
|
"Composer\\Config::disableProcessTimeout",
|
||||||
|
"sail up -d",
|
||||||
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
"npx concurrently -c \"#93c5fd,#c4b5fd,#fb7185,#fdba74\" \"php artisan serve\" \"php artisan queue:listen --tries=1\" \"php artisan pail --timeout=0\" \"npm run dev\" --names=server,queue,logs,vite"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
@ -103,6 +103,6 @@
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache_'),
|
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_cache_'),
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -147,7 +147,7 @@
|
|||||||
|
|
||||||
'options' => [
|
'options' => [
|
||||||
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
'cluster' => env('REDIS_CLUSTER', 'redis'),
|
||||||
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
|
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_') . '_database_'),
|
||||||
],
|
],
|
||||||
|
|
||||||
'default' => [
|
'default' => [
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
'public' => [
|
'public' => [
|
||||||
'driver' => 'local',
|
'driver' => 'local',
|
||||||
'root' => storage_path('app/public'),
|
'root' => storage_path('app/public'),
|
||||||
'url' => env('APP_URL').'/storage',
|
'url' => env('APP_URL') . '/storage',
|
||||||
'visibility' => 'public',
|
'visibility' => 'public',
|
||||||
'throw' => false,
|
'throw' => false,
|
||||||
],
|
],
|
||||||
|
@ -89,7 +89,7 @@
|
|||||||
'handler_with' => [
|
'handler_with' => [
|
||||||
'host' => env('PAPERTRAIL_URL'),
|
'host' => env('PAPERTRAIL_URL'),
|
||||||
'port' => env('PAPERTRAIL_PORT'),
|
'port' => env('PAPERTRAIL_PORT'),
|
||||||
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
|
'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'),
|
||||||
],
|
],
|
||||||
'processors' => [PsrLogMessageProcessor::class],
|
'processors' => [PsrLogMessageProcessor::class],
|
||||||
],
|
],
|
||||||
|
@ -129,7 +129,7 @@
|
|||||||
|
|
||||||
'cookie' => env(
|
'cookie' => env(
|
||||||
'SESSION_COOKIE',
|
'SESSION_COOKIE',
|
||||||
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
|
Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'
|
||||||
),
|
),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -70,7 +70,7 @@ public function withPersonalTeam(?callable $callback = null): static
|
|||||||
return $this->has(
|
return $this->has(
|
||||||
Team::factory()
|
Team::factory()
|
||||||
->state(fn (array $attributes, User $user) => [
|
->state(fn (array $attributes, User $user) => [
|
||||||
'name' => $user->name.'\'s Team',
|
'name' => $user->name . '\'s Team',
|
||||||
'user_id' => $user->id,
|
'user_id' => $user->id,
|
||||||
'personal_team' => true,
|
'personal_team' => true,
|
||||||
])
|
])
|
||||||
|
11
pint.json
11
pint.json
@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"preset": "laravel",
|
||||||
|
"rules": {
|
||||||
|
"concat_space": {
|
||||||
|
"spacing": "one"
|
||||||
|
},
|
||||||
|
"ordered_imports": {
|
||||||
|
"sort_algorithm": "alpha"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -5,13 +5,13 @@
|
|||||||
define('LARAVEL_START', microtime(true));
|
define('LARAVEL_START', microtime(true));
|
||||||
|
|
||||||
// Determine if the application is in maintenance mode...
|
// Determine if the application is in maintenance mode...
|
||||||
if (file_exists($maintenance = __DIR__.'/../storage/framework/maintenance.php')) {
|
if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) {
|
||||||
require $maintenance;
|
require $maintenance;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register the Composer autoloader...
|
// Register the Composer autoloader...
|
||||||
require __DIR__.'/../vendor/autoload.php';
|
require __DIR__ . '/../vendor/autoload.php';
|
||||||
|
|
||||||
// Bootstrap Laravel and handle the request...
|
// Bootstrap Laravel and handle the request...
|
||||||
(require_once __DIR__.'/../bootstrap/app.php')
|
(require_once __DIR__ . '/../bootstrap/app.php')
|
||||||
->handleRequest(Request::capture());
|
->handleRequest(Request::capture());
|
||||||
|
@ -27,10 +27,10 @@
|
|||||||
@endsection
|
@endsection
|
||||||
|
|
||||||
@section('vendor-script')
|
@section('vendor-script')
|
||||||
<script src="https://code.jquery.com/jquery-3.7.1.slim.js"
|
<script src="//code.jquery.com/jquery-3.7.1.slim.js" crossorigin="anonymous"></script>
|
||||||
integrity="sha256-UgvvN8vBkgO0luPSUl2s8TIlOSYRoGFAX4jlCIm9Adc=" crossorigin="anonymous"></script>
|
|
||||||
|
|
||||||
@vite([
|
@vite([
|
||||||
|
'resources/assets/vendor/libs/jquery/jquery.js',
|
||||||
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js',
|
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js',
|
||||||
])
|
])
|
||||||
@endsection
|
@endsection
|
||||||
@ -72,42 +72,4 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="modal fade" id="ajaxModel" aria-hidden="true">
|
|
||||||
<div class="modal-dialog">
|
|
||||||
<div class="modal-content">
|
|
||||||
|
|
||||||
<div class="modal-header">
|
|
||||||
<h4 class="modal-title" id="modelHeading"></h4>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="modal-body">
|
|
||||||
<form id="productForm" name="productForm" class="form-horizontal">
|
|
||||||
<input type="hidden" name="product_id" id="product_id">
|
|
||||||
<div class="form-group">
|
|
||||||
<label for="name" class="col-sm-2 control-label">Name</label>
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<input type="text" class="form-control" id="name" name="name" placeholder="Enter Name"
|
|
||||||
value="" maxlength="50" required="">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<label class="col-sm-2 control-label">Details</label>
|
|
||||||
<div class="col-sm-12">
|
|
||||||
<textarea id="detail" name="detail" required="" placeholder="Enter Details"
|
|
||||||
class="form-control"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col-sm-offset-2 col-sm-10">
|
|
||||||
<button type="submit" class="btn btn-primary" id="saveBtn" value="create">Save changes
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@endsection
|
@endsection
|
||||||
|
@ -36,7 +36,7 @@
|
|||||||
Event::assertDispatched(Verified::class);
|
Event::assertDispatched(Verified::class);
|
||||||
|
|
||||||
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
|
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
|
||||||
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
|
$response->assertRedirect(route('dashboard', absolute: false) . '?verified=1');
|
||||||
})->skip(function () {
|
})->skip(function () {
|
||||||
return ! Features::enabled(Features::emailVerification());
|
return ! Features::enabled(Features::emailVerification());
|
||||||
}, 'Email verification not enabled.');
|
}, 'Email verification not enabled.');
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
]);
|
]);
|
||||||
|
|
||||||
Notification::assertSentTo($user, ResetPassword::class, function (object $notification) {
|
Notification::assertSentTo($user, ResetPassword::class, function (object $notification) {
|
||||||
$response = $this->get('/reset-password/'.$notification->token);
|
$response = $this->get('/reset-password/' . $notification->token);
|
||||||
|
|
||||||
$response->assertStatus(200);
|
$response->assertStatus(200);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user