Skip to content

Commit

Permalink
new app version
Browse files Browse the repository at this point in the history
  • Loading branch information
Thiritin committed Jul 14, 2024
1 parent a58b719 commit 1651991
Show file tree
Hide file tree
Showing 32 changed files with 2,483 additions and 3,426 deletions.
20 changes: 5 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM php:8.2-bullseye as base
FROM php:8.3-alpine as base
WORKDIR /app

ENV COMPOSER_MEMORY_LIMIT=-1
Expand All @@ -7,11 +7,12 @@ ENV COMPOSER_MEMORY_LIMIT=-1
######################################################
COPY .github/docker/install-php-extensions /usr/local/bin/

RUN apt-get update \
RUN apk update \
&& chmod +x /usr/local/bin/install-php-extensions \
&& apt-get install -y curl git unzip openssl tar ca-certificates \
&& apk add --no-cache curl git unzip openssl tar ca-certificates \
&& install-php-extensions gd bcmath pdo_mysql zip intl opcache pcntl redis swoole @composer \
&& apt-get clean -y
&& rm -rf /var/cache/apk/*

######################################################
# Copy Configuration
######################################################
Expand All @@ -27,17 +28,6 @@ RUN composer install --no-dev --no-scripts --no-autoloader
# Local Stage
######################################################
FROM base as local
RUN addgroup -gid 1024 app \
&& adduser -uid 1024 --disabled-password --ingroup app app \
&& adduser www-data app \
&& curl -fsSL https://deb.nodesource.com/setup_16.x | bash - \
&& apt-get update \
&& apt-get install -y nodejs \
&& apt-get clean -y \
&& install-php-extensions xdebug
USER app
# yarn install as command
CMD sh -c "composer install && php artisan octane:start --watch --host=0.0.0.0 --port=80"
######################################################
# Build Ziggy Package - Vite needs ziggy package available
######################################################
Expand Down
99 changes: 0 additions & 99 deletions app/Http/Controllers/Auth/Authenticators/OidcClientController.php

This file was deleted.

2 changes: 1 addition & 1 deletion app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function submit(LoginRequest $request)

if (Auth::once($loginData) === true) {
$user = Auth::user();

$hydra = new Client();
$loginRequest = $hydra->getLoginRequest($request->get('login_challenge'));

Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/Staff/DashboardController.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public function __invoke()
$q->whereDate('ends_at', '>=', now())->orWhereNull('ends_at');
});
})->orderBy('priority')->get(['id', 'name', 'description', 'icon', 'url']);

return inertia('Staff/Dashboard', [
'apps' => $apps,
]);
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Controllers/Staff/DepartmentsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,19 @@ public function show(Group $department, Request $request)
{
return Inertia::render('Staff/Departments/ShowDepartment', [
'group' => $department->loadCount('users')->only(['hashid', 'name', 'users_count']),
// Sort Owner, Admin, Moderator, Member and then by name
'users' => $department->users()->withPivot('level')->get(['id', 'name', 'profile_photo_path'])->map(fn($user
) => [
'id' => $user->hashid,
'name' => $user->name,
'profile_photo_path' => (is_null($user->profile_photo_path)) ? null : Storage::drive('s3-avatars')->url($user->profile_photo_path),
'level' => $user->pivot->level,
'title' => $user->pivot->title,
])->sortBy(fn($user) => [
$user['level'] === 'owner' ? 0 : 1,
$user['level'] === 'admin' ? 1 : 2,
$user['level'] === 'moderator' ? 2 : 3,
$user['name']
]),
'canEdit' => $department->isAdmin($request->user())
]);
Expand Down
7 changes: 6 additions & 1 deletion app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,12 @@ public function share(Request $request)
"avatar" => ($request->user()->profile_photo_path) ? Storage::disk('s3-avatars')->url($request->user()->profile_photo_path) : null,
"isAdmin" => $request->user()->hasRole(['admin', 'superadmin']),
"roles" => $request->user()->getRoleNames(),
"language" => "en"
"language" => "en",
'departments' => $request->user()->groups()
->where('type', 'department')
->limit(10)
->orderBy('name')
->get(['id', 'name'])->values(),
], $request->user()->only('name', 'email'));
}
return array_merge(parent::share($request), [
Expand Down
17 changes: 6 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,38 +20,33 @@
"firebase/php-jwt": "^6.0",
"genl/matice": "^1.1",
"guzzlehttp/guzzle": "^7.5",
"inertiajs/inertia-laravel": "^0.6.4",
"inertiajs/inertia-laravel": "^1.0",
"intervention/image": "^2.7.2",
"jumbojett/openid-connect-php": "^0.9.2",
"laravel/framework": "^10.0",
"laravel/framework": "^11.0",
"laravel/horizon": "^5.7",
"laravel/octane": "*",
"laravel/sanctum": "^3.2",
"laravel/octane": "^2.3",
"laravel/sanctum": "^4.0",
"laravel/socialite": "^5.11",
"laravel/tinker": "^2.5",
"league/flysystem-aws-s3-v3": "^3.0",
"league/flysystem-path-prefixing": "^3.0",
"league/oauth2-client": "^2.6",
"mtvs/eloquent-hashids": "^3.3",
"robthree/twofactorauth": "^2.1",
"sentry/sentry-laravel": "^3.2",
"sentry/sentry-laravel": "^4.7",
"spatie/laravel-activitylog": "^4.7",
"spatie/laravel-permission": "^6.2.0",
"spatie/laravel-query-builder": "^5.1",
"spatie/laravel-translatable": "^6",
"tightenco/ziggy": "^1.0",
"ext-simplexml": "*"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"filament/upgrade": "^3.1",
"itsgoingd/clockwork": "^5.1",
"laracasts/generators": "^2.0",
"laravel/dusk": "^7.6",
"laravel/pint": "^1.0",
"laravel/sail": "^1.26",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^7.0",
"nunomaduro/collision": "^8.1",
"pestphp/pest-plugin-laravel": "*",
"phpunit/phpunit": "^10.0",
"spatie/laravel-ignition": "^2.0"
Expand Down
Loading

0 comments on commit 1651991

Please sign in to comment.