refx pint

This commit is contained in:
Dr Masroor Ehsan 2025-01-05 12:44:15 +06:00
parent ba8a2fb28c
commit 855fb76d7e
25 changed files with 54 additions and 80 deletions

View File

@ -34,10 +34,10 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
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) {
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) {
return self::dtFormat($study->study_date);
@ -49,9 +49,9 @@ public function dataTable(QueryBuilder $query): EloquentDataTable
return self::dtFormat($study->received_at);
})
->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="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-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="btn btn-danger btn-xs deleteStudy">Delete</a>';
return $btn;
})

View File

@ -2,10 +2,10 @@
namespace App\Http\Controllers;
use Throwable;
use function Sentry\captureException;
use Throwable;
abstract class HashidActionControllerBase extends Controller
{
protected ?int $key = null;

View File

@ -2,10 +2,10 @@
namespace App\Http\Controllers;
use Throwable;
use function Sentry\captureException as gobble;
use Throwable;
abstract class HashidControllerBase extends Controller
{
protected ?int $key = null;

View File

@ -14,7 +14,7 @@ private function loadViewer(\Closure $callback)
$study = Study::findOrFail($this->key);
$url = $callback($study);
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'));
}

View File

@ -100,7 +100,7 @@ public function getMetadataLink(): string
public function sexAge(): string
{
$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)) {
return '~';
}

View File

@ -121,6 +121,6 @@ public function toString(): string
/** @param Int32BitMask $value */
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);
}
}

View File

@ -97,7 +97,7 @@ public function scopeActive($query)
public function isAdmin(): bool
{
return cache()->remember('user.is_admin:'.$this->id,
return cache()->remember('user.is_admin:' . $this->id,
5 * 60,
fn () => $this->hasRole(UserRole::Admin)
);
@ -105,7 +105,7 @@ public function isAdmin(): bool
public function isTech(): bool
{
return cache()->remember('user.is_tech:'.$this->id,
return cache()->remember('user.is_tech:' . $this->id,
5 * 60,
fn () => $this->hasRole(UserRole::Technician)
);
@ -113,7 +113,7 @@ public function isTech(): bool
public function primaryRole(): string
{
return cache()->remember('user.pri_role:'.$this->id,
return cache()->remember('user.pri_role:' . $this->id,
5 * 60,
fn () => Str::title($this->roles()->first()->name)
);
@ -136,7 +136,7 @@ public function getLastSeenAttribute(): Carbon
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

View File

@ -34,7 +34,7 @@ public function boot(): void
Fortify::resetUserPasswordsUsing(ResetUserPassword::class);
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);
});

View File

@ -22,6 +22,6 @@ public static function dateTimeToCarbon(?string $datePart, ?string $timePart, st
return null;
}
return Carbon::createFromFormat('YmdHis', $datePart.Str::before($timePart, '.'), $timezone);
return Carbon::createFromFormat('YmdHis', $datePart . Str::before($timePart, '.'), $timezone);
}
}

View File

@ -15,7 +15,7 @@ public function getClient(): Client
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);
}
@ -29,14 +29,14 @@ public function getServerStatistics(): 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);
}
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);
}
@ -46,7 +46,7 @@ public function getStudyDetails(string $study_id): array
$query = [
'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);
}
@ -57,7 +57,7 @@ public function getStudies(): array
'expand' => '1',
'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);
return json_decode($response->getBody()->getContents(), true);

View File

@ -48,7 +48,7 @@ public static function ohifSegmentation(string $study_uid): string
public static function archive(string $study_uid): string
{
$url = Uri::of(config('pacs.api.endpoint'))
->withPath('/studies/'.$study_uid.'/archive');
->withPath('/studies/' . $study_uid . '/archive');
return (string) $url;
}

View File

@ -219,7 +219,7 @@ public static function updatePageConfig($pageConfigs): void
if (isset($pageConfigs)) {
if (count($pageConfigs) > 0) {
foreach ($pageConfigs as $config => $val) {
Config::set('custom.'.$demo.'.'.$config, $val);
Config::set('custom.' . $demo . '.' . $config, $val);
}
}
}

View File

@ -7,9 +7,9 @@
return Application::configure(basePath: dirname(__DIR__))
->withRouting(
web: __DIR__.'/../routes/web.php',
api: __DIR__.'/../routes/api.php',
commands: __DIR__.'/../routes/console.php',
web: __DIR__ . '/../routes/web.php',
api: __DIR__ . '/../routes/api.php',
commands: __DIR__ . '/../routes/console.php',
health: '/up',
)
->withMiddleware(function (Middleware $middleware) {

View File

@ -91,6 +91,7 @@
"fix": "php-cs-fixer fix",
"dev": [
"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"
]
},

View File

@ -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_'),
];

View File

@ -147,7 +147,7 @@
'options' => [
'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' => [

View File

@ -40,7 +40,7 @@
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
'throw' => false,
],

View File

@ -89,7 +89,7 @@
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://'.env('PAPERTRAIL_URL').':'.env('PAPERTRAIL_PORT'),
'connectionString' => 'tls://' . env('PAPERTRAIL_URL') . ':' . env('PAPERTRAIL_PORT'),
],
'processors' => [PsrLogMessageProcessor::class],
],

View File

@ -129,7 +129,7 @@
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
Str::slug(env('APP_NAME', 'laravel'), '_') . '_session'
),
/*

View File

@ -70,7 +70,7 @@ public function withPersonalTeam(?callable $callback = null): static
return $this->has(
Team::factory()
->state(fn (array $attributes, User $user) => [
'name' => $user->name.'\'s Team',
'name' => $user->name . '\'s Team',
'user_id' => $user->id,
'personal_team' => true,
])

View File

@ -0,0 +1,11 @@
{
"preset": "laravel",
"rules": {
"concat_space": {
"spacing": "one"
},
"ordered_imports": {
"sort_algorithm": "alpha"
}
}
}

View File

@ -5,13 +5,13 @@
define('LARAVEL_START', microtime(true));
// 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;
}
// Register the Composer autoloader...
require __DIR__.'/../vendor/autoload.php';
require __DIR__ . '/../vendor/autoload.php';
// Bootstrap Laravel and handle the request...
(require_once __DIR__.'/../bootstrap/app.php')
(require_once __DIR__ . '/../bootstrap/app.php')
->handleRequest(Request::capture());

View File

@ -27,11 +27,11 @@
@endsection
@section('vendor-script')
<script src="https://code.jquery.com/jquery-3.7.1.slim.js"
integrity="sha256-UgvvN8vBkgO0luPSUl2s8TIlOSYRoGFAX4jlCIm9Adc=" crossorigin="anonymous"></script>
<script src="//code.jquery.com/jquery-3.7.1.slim.js" crossorigin="anonymous"></script>
@vite([
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js',
'resources/assets/vendor/libs/jquery/jquery.js',
'resources/assets/vendor/libs/datatables-bs5/datatables-bootstrap5.js',
])
@endsection
@ -72,42 +72,4 @@
</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

View File

@ -36,7 +36,7 @@
Event::assertDispatched(Verified::class);
expect($user->fresh()->hasVerifiedEmail())->toBeTrue();
$response->assertRedirect(route('dashboard', absolute: false).'?verified=1');
$response->assertRedirect(route('dashboard', absolute: false) . '?verified=1');
})->skip(function () {
return ! Features::enabled(Features::emailVerification());
}, 'Email verification not enabled.');

View File

@ -37,7 +37,7 @@
]);
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);