Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
Clubphp
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
Clubphp
Commits
6f356f13
Commit
6f356f13
authored
Apr 11, 2026
by
Mahmoud Aglan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fixedimage
parent
50171370
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
11 additions
and
10 deletions
+11
-10
Dockerfile
Dockerfile
+4
-2
BrandingController.php
app/Modules/Settings/Controllers/BrandingController.php
+4
-4
BrandingService.php
app/Modules/Settings/Services/BrandingService.php
+3
-4
No files found.
Dockerfile
View file @
6f356f13
...
...
@@ -45,13 +45,15 @@ RUN mkdir -p \
/var/www/html/storage/uploads/photos
\
/var/www/html/storage/uploads/forms
\
/var/www/html/storage/cache
\
/var/www/html/storage/sessions
/var/www/html/storage/sessions
\
/var/www/html/public/assets/uploads/branding
# ── Permissions ──
RUN
chown
-R
www-data:www-data /var/www/html/storage
\
&&
chmod
-R
775 /var/www/html/storage
\
&&
chown
-R
www-data:www-data /var/www/html/public
\
&&
chmod
-R
755 /var/www/html/public
&&
chmod
-R
755 /var/www/html/public
\
&&
chmod
-R
775 /var/www/html/public/assets/uploads
# ── Environment defaults (overridden by CapRover env vars) ──
ENV
APP_URL=http://localhost
...
...
app/Modules/Settings/Controllers/BrandingController.php
View file @
6f356f13
...
...
@@ -61,8 +61,8 @@ class BrandingController extends Controller
if
(
$ext
===
'svg'
)
$ext
=
'svg'
;
$storedFilename
=
'logo_'
.
date
(
'Ymd_His'
)
.
'_'
.
bin2hex
(
random_bytes
(
4
))
.
'.'
.
$ext
;
// Ensure upload directory exists
$uploadDir
=
App
::
getInstance
()
->
basePath
()
.
'/storage
/uploads/branding/'
;
// Ensure upload directory exists
(inside public/ so Apache serves it directly)
$uploadDir
=
App
::
getInstance
()
->
publicPath
()
.
'/assets
/uploads/branding/'
;
if
(
!
is_dir
(
$uploadDir
))
{
mkdir
(
$uploadDir
,
0755
,
true
);
}
...
...
@@ -78,8 +78,8 @@ class BrandingController extends Controller
@
unlink
(
$oldPath
);
}
// Save path to config
SystemConfig
::
set
(
'branding.logo_path'
,
'
storage
/uploads/branding/'
.
$storedFilename
);
// Save path to config
(relative to public/)
SystemConfig
::
set
(
'branding.logo_path'
,
'
assets
/uploads/branding/'
.
$storedFilename
);
BrandingService
::
clearCache
();
}
}
...
...
app/Modules/Settings/Services/BrandingService.php
View file @
6f356f13
...
...
@@ -60,9 +60,7 @@ class BrandingService
$data
=
self
::
load
();
$path
=
$data
[
'logo_path'
]
??
null
;
if
(
$path
&&
$path
!==
''
)
{
// Return as web-accessible URL relative to public/
// Logo is stored in storage/uploads/branding/ — we need to serve it
// via a relative path from the app root
// Path is relative to public/ (e.g. "assets/uploads/branding/logo_xxx.png")
$basePath
=
rtrim
(
parse_url
(
config
(
'app.url'
,
''
),
PHP_URL_PATH
)
?:
''
,
'/'
);
return
$basePath
.
'/'
.
ltrim
(
$path
,
'/'
);
}
...
...
@@ -77,7 +75,8 @@ class BrandingService
$data
=
self
::
load
();
$path
=
$data
[
'logo_path'
]
??
null
;
if
(
$path
&&
$path
!==
''
)
{
$full
=
App
::
getInstance
()
->
basePath
()
.
'/'
.
ltrim
(
$path
,
'/'
);
// Logo lives inside public/ directory
$full
=
App
::
getInstance
()
->
publicPath
()
.
'/'
.
ltrim
(
$path
,
'/'
);
return
file_exists
(
$full
)
?
$full
:
null
;
}
return
null
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment