Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oa
Project
Project
Details
Activity
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
朱招明
oa
Commits
29f8e5ab
Commit
29f8e5ab
authored
Oct 30, 2023
by
朱招明
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update
parent
4ad0a7b3
Show whitespace changes
Inline
Side-by-side
Showing
34 changed files
with
1394 additions
and
174 deletions
+1394
-174
.gitignore
.gitignore
+1
-0
2023_10_20_092649_create_admin_table.php
...abase/Migrations/2023_10_20_092649_create_admin_table.php
+9
-8
2023_10_28_182533_create_files_table.php
...abase/Migrations/2023_10_28_182533_create_files_table.php
+37
-0
AdminMenu.php
Modules/Admin/Entities/AdminMenu.php
+31
-2
AdminRole.php
Modules/Admin/Entities/AdminRole.php
+5
-1
File.php
Modules/Admin/Entities/File.php
+10
-0
AuthController.php
Modules/Admin/Http/Controllers/AuthController.php
+10
-5
FilesController.php
Modules/Admin/Http/Controllers/FilesController.php
+65
-0
MenuController.php
Modules/Admin/Http/Controllers/MenuController.php
+30
-10
RoleController.php
Modules/Admin/Http/Controllers/RoleController.php
+40
-5
UserController.php
Modules/Admin/Http/Controllers/UserController.php
+1
-1
RoleMenu.php
Modules/Admin/Http/Middleware/RoleMenu.php
+7
-6
FileRequest.php
Modules/Admin/Http/Requests/FileRequest.php
+28
-0
MenuRequest.php
Modules/Admin/Http/Requests/MenuRequest.php
+6
-13
BaseService.php
Modules/Admin/Http/Service/BaseService.php
+32
-0
FileService.php
Modules/Admin/Http/Service/FileService.php
+38
-0
AdminMenuTransformer.php
Modules/Admin/Http/Transformers/AdminMenuTransformer.php
+4
-3
AdminRoleTransformer.php
Modules/Admin/Http/Transformers/AdminRoleTransformer.php
+7
-3
AdminUserTransformer.php
Modules/Admin/Http/Transformers/AdminUserTransformer.php
+17
-5
FileTransformer.php
Modules/Admin/Http/Transformers/FileTransformer.php
+37
-0
Helper.php
Modules/Admin/Http/Utils/Helper.php
+90
-4
api.php
Modules/Admin/Routes/api.php
+7
-2
autoload.php
Modules/Admin/vendor/autoload.php
+25
-0
ClassLoader.php
Modules/Admin/vendor/composer/ClassLoader.php
+579
-0
LICENSE
Modules/Admin/vendor/composer/LICENSE
+21
-0
autoload_classmap.php
Modules/Admin/vendor/composer/autoload_classmap.php
+10
-0
autoload_files.php
Modules/Admin/vendor/composer/autoload_files.php
+10
-0
autoload_namespaces.php
Modules/Admin/vendor/composer/autoload_namespaces.php
+9
-0
autoload_psr4.php
Modules/Admin/vendor/composer/autoload_psr4.php
+10
-0
autoload_real.php
Modules/Admin/vendor/composer/autoload_real.php
+48
-0
autoload_static.php
Modules/Admin/vendor/composer/autoload_static.php
+40
-0
composer.lock
composer.lock
+108
-106
filesystems.php
config/filesystems.php
+6
-0
upload.php
config/upload.php
+16
-0
No files found.
.gitignore
View file @
29f8e5ab
...
...
@@ -3,6 +3,7 @@
/public/build
/public/hot
/public/storage
/public/uploads
/storage/*.key
/vendor
.env
...
...
Modules/Admin/Database/Migrations/2023_10_20_092649_create_admin_table.php
View file @
29f8e5ab
...
...
@@ -26,18 +26,19 @@ return new class extends Migration
Schema
::
create
(
'admin_roles'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
string
(
'name'
,
50
)
->
unique
()
;
$table
->
string
(
'slug'
,
50
)
->
unique
()
;
$table
->
string
(
'name'
,
50
);
$table
->
string
(
'slug'
,
50
);
$table
->
timestamps
();
});
Schema
::
create
(
'admin_menus'
,
function
(
Blueprint
$table
)
{
$table
->
increments
(
'id'
);
$table
->
integer
(
'parent_id'
)
->
default
(
0
);
$table
->
integer
(
'order'
)
->
default
(
0
);
$table
->
string
(
'title'
,
50
);
$table
->
string
(
'key'
,
50
)
->
comment
(
'前端路由标识'
);
$table
->
string
(
'title'
,
50
)
->
comment
(
'标题'
)
;
$table
->
string
(
'icon'
,
50
)
->
nullable
();
$table
->
string
(
'uri'
)
->
nullable
();
$table
->
string
(
'api'
)
->
nullable
()
->
comment
(
'api接口地址'
);
$table
->
boolean
(
'is_menu'
)
->
default
(
1
)
->
comment
(
'是否菜单 0否 1是'
);
$table
->
timestamps
();
});
...
...
@@ -95,9 +96,9 @@ return new class extends Migration
{
Schema
::
dropIfExists
(
'admin_users'
);
Schema
::
dropIfExists
(
'admin_roles'
);
Schema
::
dropIfExists
(
'admin_menu'
);
Schema
::
dropIfExists
(
'admin_menu
s
'
);
Schema
::
dropIfExists
(
'admin_role_users'
);
Schema
::
dropIfExists
(
'admin_role_menu'
);
Schema
::
dropIfExists
(
'admin_operation_log'
);
Schema
::
dropIfExists
(
'admin_role_menu
s
'
);
Schema
::
dropIfExists
(
'admin_operation_log
s
'
);
}
};
Modules/Admin/Database/Migrations/2023_10_28_182533_create_files_table.php
0 → 100644
View file @
29f8e5ab
<?php
use
Illuminate\Support\Facades\Schema
;
use
Illuminate\Database\Schema\Blueprint
;
use
Illuminate\Database\Migrations\Migration
;
return
new
class
extends
Migration
{
/**
* Run the migrations.
*
* @return void
*/
public
function
up
()
{
Schema
::
create
(
'files'
,
function
(
Blueprint
$table
)
{
$table
->
id
();
$table
->
integer
(
'user_id'
)
->
index
()
->
comment
(
'用户ID'
);
$table
->
string
(
'type'
)
->
index
()
->
comment
(
'文件类型'
);
$table
->
string
(
'path'
)
->
comment
(
'文件路径'
);
$table
->
integer
(
'size'
)
->
default
(
0
)
->
comment
(
'文件大小'
);
$table
->
string
(
'mime'
)
->
enablenull
()
->
comment
(
'文件类型'
);
$table
->
string
(
'name'
)
->
comment
(
'文件名称'
);
$table
->
timestamps
();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public
function
down
()
{
Schema
::
dropIfExists
(
'files'
);
}
};
Modules/Admin/Entities/AdminMenu.php
View file @
29f8e5ab
...
...
@@ -16,15 +16,43 @@ use Modules\Admin\Http\Utils\Helper;
class
AdminMenu
extends
Model
{
protected
$fillable
=
[
'title'
,
'
uri'
,
'parent_id'
,
'icon
'
'title'
,
'
key'
,
'api'
,
'parent_id'
,
'icon'
,
'is_menu
'
];
public
static
function
boot
()
{
parent
::
boot
();
static
::
sav
ing
(
function
(
$model
)
{
static
::
sav
ed
(
function
(
$model
)
{
Helper
::
getAllMenu
(
true
);
Helper
::
getAllApi
(
true
);
});
}
public
function
child
()
{
return
$this
->
hasMany
(
AdminMenu
::
class
,
'parent_id'
,
'id'
);
}
public
function
childrenIds
(){
return
$this
->
child
->
pluck
(
'id'
);
}
public
function
descendantsIds
(){
$ids
=
[];
$this
->
getChildrenIds
(
$this
,
$ids
);
return
$ids
;
}
public
function
getChildrenIds
(
AdminMenu
$menu
,
&
$ids
){
$child
=
$menu
->
child
;
if
(
$child
){
$child
->
each
(
function
(
$item
)
use
(
&
$ids
){
$ids
[]
=
$item
->
id
;
$ids
=
self
::
getChildrenIds
(
$item
,
$ids
);
});
}
return
$ids
;
}
}
\ No newline at end of file
Modules/Admin/Entities/AdminRole.php
View file @
29f8e5ab
...
...
@@ -11,13 +11,17 @@ namespace Modules\Admin\Entities;
use
Illuminate\Database\Eloquent\Model
;
use
Illuminate\Database\Eloquent\Relations\BelongsToMany
;
use
Illuminate\Database\Eloquent\Relations\HasMany
;
use
Modules\Admin\Http\Utils\Helper
;
class
AdminRole
extends
Model
{
protected
$fillable
=
[
'name'
,
'slug'
,
];
public
static
function
boot
()
{
parent
::
boot
();
}
public
function
menu
()
:
BelongsToMany
{
return
$this
->
belongsToMany
(
AdminMenu
::
class
,
'admin_role_menus'
,
'role_id'
,
'menu_id'
);
...
...
Modules/Admin/Entities/File.php
0 → 100644
View file @
29f8e5ab
<?php
namespace
Modules\Admin\Entities
;
use
Illuminate\Database\Eloquent\Model
;
class
File
extends
Model
{
protected
$fillable
=
[
'user_id'
,
'type'
,
'path'
,
'size'
,
'mime'
,
'name'
];
}
Modules/Admin/Http/Controllers/AuthController.php
View file @
29f8e5ab
...
...
@@ -11,6 +11,7 @@ use Illuminate\Support\Facades\DB;
use
Modules\Admin\Entities\AdminMenu
;
use
Modules\Admin\Entities\AdminUser
;
use
Modules\Admin\Http\Transformers\AccessTokenTransformer
;
use
Modules\Admin\Http\Transformers\AdminUserTransformer
;
use
Modules\Admin\Http\Transformers\BaseTransformer
;
use
Modules\Admin\Http\Utils\Helper
;
...
...
@@ -54,7 +55,7 @@ class AuthController extends BaseController
*/
public
function
login
(
Request
$request
)
{
$req
=
$request
->
all
();
$req
=
$request
->
all
(
[
'username'
,
'password'
]
);
$username
=
$req
[
"username"
];
$password
=
$req
[
"password"
];
if
(
$username
==
""
||
$password
==
""
)
...
...
@@ -118,10 +119,16 @@ class AuthController extends BaseController
*
*/
public
function
loginOut
(){
if
(
$this
->
user
){
auth
(
'api'
)
->
logout
(
true
);
}
return
$this
->
response
->
noContent
()
->
statusCode
(
'204'
);
}
public
function
userInfo
(){
return
$this
->
response
->
item
(
$this
->
user
,
new
AdminUserTransformer
());
}
/**
*
* @OA\Put(
...
...
@@ -150,11 +157,9 @@ class AuthController extends BaseController
$user
=
$this
->
user
;
$role
=
$user
->
roles
()
->
first
();
$menu
=
Helper
::
getRoleMenu
(
$role
,
true
);
$menu
=
Helper
::
makeTree
(
$menu
);
$data
=
[
"menus"
=>
$menu
,
"menus"
=>
Helper
::
getRoleMenu
(
$role
,
true
),
"apis"
=>
Helper
::
getRoleApi
(
$role
,
true
),
];
return
$this
->
response
->
array
([
'data'
=>
$data
]);
...
...
Modules/Admin/Http/Controllers/FilesController.php
0 → 100644
View file @
29f8e5ab
<?php
namespace
Modules\Admin\Http\Controllers
;
use
Modules\Admin\Http\Requests\FileRequest
;
use
Modules\Admin\Http\Service\FileService
;
use
Modules\Admin\Http\Transformers\FileTransformer
;
class
FilesController
extends
BaseController
{
/**
* Store a newly created resource in storage.
*
* @param FileRequest $request
* @param FileService $file
*
* @return \Dingo\Api\Http\Response $response
*
* @OA\Post(
* tags={"基础接口"},
* summary="上传文件",
* path="/api/files",
* security={
* {"jwt_auth": {}}
* },
* @OA\RequestBody(
* required=true,
* @OA\MediaType(
* mediaType="multipart/form-data",
* @OA\Schema(
* type="object",
* required={"type","file"},
* @OA\Property(
* property="type",
* type="string",
* enum={"avatar"}
* ),
* @OA\Property(
* property="file",
* type="string",
* format="binary"
* ),
* )
* )
* ),
* @OA\Response(
* response="201",
* description="成功",
* @OA\MediaType(
* mediaType="application/json",
* @OA\Schema(type="object",
* @OA\Property(property="data", type="object", ref="#/components/schemas/File")
* )
* )
* )
* )
*/
public
function
store
(
FileRequest
$request
,
FileService
$file
)
{
$info
=
$file
->
process
(
$request
->
file
,
$request
->
input
(
'type'
));
return
$this
->
response
->
item
(
$info
,
new
FileTransformer
())
->
setStatusCode
(
201
);
}
}
Modules/Admin/Http/Controllers/MenuController.php
View file @
29f8e5ab
...
...
@@ -66,15 +66,28 @@ class MenuController extends BaseController
* required={"title"},
* @OA\Property(
* property="title",
* type="string"
* type="string",
* description="标题"
* ),
* @OA\Property(
* property="uri",
* type="string"
* property="icon",
* type="string",
* description="图标"
* ),
* @OA\Property(
* property="key",
* type="string",
* description="标识"
* ),
* @OA\Property(
* property="api",
* type="string",
* description="api地址"
* ),
* @OA\Property(
* property="parent_id",
* type="string"
* type="string",
* description="父级菜单id"
* ),
* )
* )
...
...
@@ -87,7 +100,7 @@ class MenuController extends BaseController
*
*/
public
function
add
(
MenuRequest
$request
){
$params
=
$request
->
all
([
'title'
,
'
uri
'
,
'parent_id'
]);
$params
=
$request
->
all
([
'title'
,
'
key'
,
'icon'
,
'api'
,
'is_menu
'
,
'parent_id'
]);
AdminMenu
::
create
(
$params
);
...
...
@@ -163,15 +176,19 @@ class MenuController extends BaseController
*
*/
public
function
edit
(
MenuRequest
$request
,
$id
){
$params
=
$request
->
all
([
'title'
,
'
uri
'
,
'parent_id'
]);
$params
=
$request
->
all
([
'title'
,
'
key'
,
'icon'
,
'api'
,
'is_menu
'
,
'parent_id'
]);
$menu
=
AdminMenu
::
where
(
'id'
,
$id
)
->
first
();
if
(
!
$menu
){
abort
(
500
,
'菜单不存在'
);
}
if
(
$params
[
'uri'
]
&&
$menu
->
uri
!=
$params
[
'uri'
]
&&
AdminMenu
::
where
(
'uri'
,
$params
[
'uri'
])
->
first
()){
abort
(
500
,
'uri重复'
);
if
(
$menu
->
key
!=
$params
[
'key'
]
&&
AdminMenu
::
where
(
'key'
,
$params
[
'key'
])
->
first
()){
abort
(
500
,
'路由标识重复'
);
}
if
(
$menu
->
id
===
$params
[
'parent_id'
]){
abort
(
500
,
'父级菜单不能选择自己'
);
}
$menu
->
update
(
$params
);
...
...
@@ -196,12 +213,15 @@ class MenuController extends BaseController
*/
public
function
delete
(
$id
){
$menu
=
AdminMenu
::
where
(
'id'
,
$id
)
->
first
();
if
(
$menu
){
DB
::
transaction
(
function
()
use
(
$menu
){
$menu
->
delete
();
AdminRoleMenu
::
where
(
'menu_id'
,
$menu
->
id
)
->
delete
();
#子菜单删除
$descendantsIds
=
$menu
->
descendantsIds
();
AdminMenu
::
whereIn
(
'id'
,
$descendantsIds
)
->
delete
();
AdminRoleMenu
::
whereIn
(
'menu_id'
,
$descendantsIds
)
->
delete
();
});
}
return
$this
->
response
->
noContent
()
->
statusCode
(
204
);
...
...
Modules/Admin/Http/Controllers/RoleController.php
View file @
29f8e5ab
...
...
@@ -16,6 +16,7 @@ use Modules\Admin\Entities\AdminRoleMenu;
use
Modules\Admin\Entities\AdminRoleUser
;
use
Modules\Admin\Http\Requests\RoleRequest
;
use
Modules\Admin\Http\Transformers\AdminRoleTransformer
;
use
Modules\Admin\Http\Utils\Helper
;
class
RoleController
extends
BaseController
{
...
...
@@ -84,11 +85,38 @@ class RoleController extends BaseController
*
*/
public
function
add
(
RoleRequest
$request
){
$params
=
$request
->
all
([
'name'
,
'slug'
]);
$params
=
$request
->
all
([
'name'
,
'slug'
,
'menus'
]);
AdminRole
::
create
(
$params
);
logger
(
$params
);
if
(
!
is_array
(
$params
[
'menus'
])){
abort
(
422
,
'菜单格式错误'
);
}
$menus
=
AdminMenu
::
all
()
->
toArray
();
if
(
$error
=
$this
->
checkMenu
(
$menus
,
$params
[
'menus'
])){
abort
(
500
,
$error
);
}
$role
=
DB
::
transaction
(
function
()
use
(
$params
){
$role
=
AdminRole
::
create
(
$params
);
$insert
=
[];
foreach
(
$params
[
'menus'
]
as
$item
){
$insert
[]
=
[
'role_id'
=>
$role
->
id
,
'menu_id'
=>
(
int
)
$item
,
];
}
if
(
$insert
){
AdminRoleMenu
::
insert
(
$insert
);
}
return
$role
;
});
return
$this
->
response
->
item
(
$role
,
new
AdminRoleTransformer
());
return
$this
->
response
->
noContent
()
->
statusCode
(
201
);
}
/**
...
...
@@ -166,7 +194,7 @@ class RoleController extends BaseController
abort
(
422
,
'菜单格式错误'
);
}
if
(
$role_id
==
1
){
if
(
Helper
::
isAdministrator
(
$role_id
)
){
abort
(
500
,
'超级管理员不可编辑权限'
);
}
...
...
@@ -192,6 +220,10 @@ class RoleController extends BaseController
if
(
$insert
){
AdminRoleMenu
::
insert
(
$insert
);
}
Helper
::
getRoleMenu
(
$role
,
true
);
Helper
::
getRoleApi
(
$role
,
true
);
});
return
$this
->
response
->
noContent
()
->
statusCode
(
204
);
}
...
...
@@ -214,8 +246,11 @@ class RoleController extends BaseController
public
function
delete
(
$role_id
){
$role
=
AdminRole
::
where
(
'id'
,
$role_id
)
->
first
();
if
(
$role
){
if
(
Helper
::
isAdministrator
(
$role_id
)){
abort
(
500
,
'超级管理员不可删除'
);
}
if
(
AdminRoleUser
::
where
(
'role_id'
,
$role
->
id
)
->
count
()
>
0
){
abort
(
"此角色还有关联的用户,无法删除"
);
}
...
...
Modules/Admin/Http/Controllers/UserController.php
View file @
29f8e5ab
...
...
@@ -122,7 +122,7 @@ class UserController extends BaseController
return
$user
;
});
return
$this
->
response
->
item
(
$user
,
new
AdminUserTransformer
());
return
$this
->
response
->
item
(
$user
,
new
AdminUserTransformer
(
true
));
}
/**
...
...
Modules/Admin/Http/Middleware/RoleMenu.php
View file @
29f8e5ab
...
...
@@ -21,17 +21,18 @@ class RoleMenu
$user
=
auth
()
->
user
();
#角色
$role
=
$user
->
roles
()
->
first
();
$menus
=
Helper
::
getRoleMenu
(
$role
);
$role_uris
=
array_filter
(
array_column
(
$menus
,
'uri'
));
$uris
=
array_filter
(
array_column
(
Helper
::
getAllMenu
(),
'uri'
));
$role_apis
=
array_filter
(
array_column
(
Helper
::
getRoleApi
(
$role
),
'api'
));
$apis
=
array_filter
(
array_column
(
Helper
::
getAllApi
(),
'api'
));
$route
=
str_replace
(
"."
,
"/"
,
Route
::
currentRouteName
());
logger
(
$route
);
logger
(
$role_apis
);
logger
(
$apis
);
#验证菜单权限
if
(
!
Helper
::
isAdministrator
(
$role
->
id
)
&&
in_array
(
$route
,
$
ur
is
)
&&
!
in_array
(
$route
,
$role_
ur
is
)
&&
in_array
(
$route
,
$
ap
is
)
&&
!
in_array
(
$route
,
$role_
ap
is
)
){
abort
(
403
,
'没有权限'
);
}
...
...
Modules/Admin/Http/Requests/FileRequest.php
0 → 100644
View file @
29f8e5ab
<?php
namespace
Modules\Admin\Http\Requests
;
class
FileRequest
extends
BaseRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
rules
()
{
$upload
=
config
(
'upload'
,
[]);
$types
=
implode
(
','
,
array_keys
(
$upload
));
$validate
=
isset
(
$upload
[
$this
->
type
])
?
'required|file|'
.
$upload
[
$this
->
type
][
'validate'
]
:
'required|file'
;
return
[
'type'
=>
'required|in:'
.
$types
,
'file'
=>
$validate
,
];
}
public
function
messages
()
{
return
config
(
'upload.'
.
$this
->
type
.
'.validate_msg'
,
[]);
}
}
Modules/Admin/Http/Requests/MenuRequest.php
View file @
29f8e5ab
...
...
@@ -4,11 +4,6 @@ namespace Modules\Admin\Http\Requests;
class
MenuRequest
extends
BaseRequest
{
/**
* Get the validation rules that apply to the request.
*
* @return array
*/
public
function
postRules
()
{
if
(
empty
(
$this
->
parent_id
)){
...
...
@@ -18,16 +13,11 @@ class MenuRequest extends BaseRequest
$parent_id_rule
=
[
'exists:admin_menus,id'
];
}
if
(
empty
(
$this
->
uri
)){
$uri_rule
=
[];
}
else
{
$uri_rule
=
[
'unique:admin_menus,uri'
];
}
return
[
'parent_id'
=>
$parent_id_rule
,
'title'
=>
'bail|required'
,
'uri'
=>
$uri_rule
,
//'path' => ['required'],
'key'
=>
[
'required'
,
'unique:admin_menus,key'
],
];
}
...
...
@@ -43,6 +33,7 @@ class MenuRequest extends BaseRequest
return
[
'parent_id'
=>
$parent_id_rule
,
'title'
=>
'bail|required'
,
'key'
=>
[
'required'
],
];
}
...
...
@@ -51,7 +42,9 @@ class MenuRequest extends BaseRequest
return
[
'title.required'
=>
'菜单名称必须'
,
'parent_id.exists'
=>
'父菜单不存在'
,
'uri.unique'
=>
'uri重复'
,
//'api.unique' => '接口地址重复',
'key.required'
=>
'路由标识必填'
,
'key.unique'
=>
'路由标识重复'
,
];
}
}
Modules/Admin/Http/Service/BaseService.php
0 → 100644
View file @
29f8e5ab
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/6/13
* Time: 9:52
*/
namespace
Modules\Admin\Http\Service
;
class
BaseService
{
protected
$model
;
public
function
create
(
$data
)
{
return
$this
->
model
=
$this
->
model
->
create
(
$data
)
->
refresh
();
}
public
function
update
(
$id
,
$data
)
{
$this
->
model
=
$this
->
model
->
find
(
$id
);
$this
->
model
->
fill
(
$data
);
return
$this
->
model
->
save
();
}
public
function
getModel
()
{
return
$this
->
model
;
}
}
Modules/Admin/Http/Service/FileService.php
0 → 100644
View file @
29f8e5ab
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/6/14
* Time: 14:47
*/
namespace
Modules\Admin\Http\Service
;
use
Modules\Admin\Entities\File
;
class
FileService
extends
BaseService
{
public
function
__construct
(
File
$file
)
{
$this
->
model
=
$file
;
}
public
function
process
(
$file
,
$type
)
{
$config
=
config
(
'upload'
,
[]);
$folder
=
$config
[
$type
][
'folder'
];
$folder_name
=
"
$folder
/"
.
date
(
'Ym'
,
time
())
.
'/'
.
date
(
'd'
,
time
());
$path
=
$file
->
store
(
$folder_name
,
$config
[
$type
][
'filesystem'
]);
$info
=
[];
$info
[
'user_id'
]
=
\Auth
::
id
();
$info
[
'type'
]
=
$type
;
$info
[
'path'
]
=
$path
;
$info
[
'size'
]
=
$file
->
getSize
();
$info
[
'mime'
]
=
$file
->
getMimeType
();
$info
[
'name'
]
=
$file
->
getClientOriginalName
();
$this
->
create
(
$info
);
return
$this
->
model
;
}
}
Modules/Admin/Http/Transformers/AdminMenuTransformer.php
View file @
29f8e5ab
...
...
@@ -29,15 +29,16 @@ class AdminMenuTransformer extends BaseTransformer
* @OA\Property(property="id", type="integer", description="ID"),
* @OA\Property(property="parent_id", type="string", description="上级ID"),
* @OA\Property(property="title", type="string", description="标题"),
* @OA\Property(property="uri", type="string", description="uri"),
* @OA\Property(property="icon", type="string", description="图标"),
* @OA\Property(property="key", type="string", description="路由标识"),
* @OA\Property(property="is_menu", type="integer", description="是否菜单"),
* @OA\Property(property="created_at", type="string", description="创建时间"),
* )
*/
public
function
transform
(
AdminMenu
$menu
)
{
$return
=
[
'id'
,
'parent_id'
,
'title'
,
'
uri
'
,
'created_at'
];
$return
=
[
'id'
,
'parent_id'
,
'title'
,
'
key'
,
'icon'
,
'is_menu
'
,
'created_at'
];
return
Helper
::
mapAttr
(
$menu
,
$return
);
}
...
...
Modules/Admin/Http/Transformers/AdminRoleTransformer.php
View file @
29f8e5ab
...
...
@@ -16,7 +16,7 @@ class AdminRoleTransformer extends BaseTransformer
{
use
Macroable
;
protected
$show_menu
;
public
function
__construct
(
$show_menu
=
fals
e
)
public
function
__construct
(
$show_menu
=
tru
e
)
{
$this
->
show_menu
=
$show_menu
;
parent
::
__construct
();
...
...
@@ -29,17 +29,21 @@ class AdminRoleTransformer extends BaseTransformer
* schema="Role",
* @OA\Property(property="name", type="integer", description="名称"),
* @OA\Property(property="slug", type="string", description="描述"),
* @OA\Property(property="is_admin", type="string", description="是否超级管理员"),
* @OA\Property(property="menus", type="string", description="菜单id列表"),
* @OA\Property(property="created_at", type="string", description="创建时间"),
* )
*/
public
function
transform
(
AdminRole
$role
)
{
$return
=
[
'name'
,
'slug'
,
'created_at'
];
$return
=
[
'
id'
,
'
name'
,
'slug'
,
'created_at'
];
$return
=
Helper
::
mapAttr
(
$role
,
$return
);
$return
[
'is_admin'
]
=
Helper
::
isAdministrator
(
$return
[
'id'
]);
if
(
$this
->
show_menu
){
$return
[
'menu
_id
s'
]
=
array_column
(
$role
->
menu
->
toArray
(),
'id'
);
$return
[
'menus'
]
=
array_column
(
$role
->
menu
->
toArray
(),
'id'
);
}
return
$return
;
}
}
Modules/Admin/Http/Transformers/AdminUserTransformer.php
View file @
29f8e5ab
...
...
@@ -15,11 +15,13 @@ class AdminUserTransformer extends BaseTransformer
{
use
Macroable
;
protected
$hideDetail
=
false
;
protected
array
$availableIncludes
=
[
'roles'
]
;
public
function
__construct
(
$hideDetail
=
false
)
protected
$show_role
=
false
;
public
function
__construct
(
$show_role
=
false
)
{
$this
->
hideDetail
=
$hideDetail
;
$this
->
show_role
=
$show_role
;
parent
::
__construct
();
}
...
...
@@ -38,8 +40,18 @@ class AdminUserTransformer extends BaseTransformer
*/
public
function
transform
(
AdminUser
$user
)
{
$return
=
[
'id'
,
'username'
,
'avatar'
,
'name'
,
'created_at'
,
'updated_at'
];
$return
=
[
'id'
,
'username'
,
'avatar'
,
'avatar_full_url'
,
'name'
,
'created_at'
,
'updated_at'
];
$return
=
Helper
::
mapAttr
(
$user
,
$return
);
$return
[
'is_admin'
]
=
Helper
::
isAdministrator
(
$return
[
'id'
]);
if
(
$this
->
show_role
){
$return
[
'role'
]
=
$user
->
roles
()
->
first
();
}
return
Helper
::
mapAttr
(
$user
,
$return
);
return
$return
;
}
public
function
includeRoles
(
$user
)
{
return
$user
->
roles
()
?
$this
->
item
(
$user
->
roles
()
->
first
(),
new
AdminRoleTransformer
(
false
))
:
null
;
}
}
Modules/Admin/Http/Transformers/FileTransformer.php
0 → 100644
View file @
29f8e5ab
<?php
/**
* Created by PhpStorm.
* User: Administrator
* Date: 2018/6/15
* Time: 9:47
*/
namespace
Modules\Admin\Http\Transformers
;
use
Modules\Admin\Entities\File
;
use
Modules\Admin\Http\Utils\Helper
;
class
FileTransformer
extends
BaseTransformer
{
/**
* @OA\Schema(
* description="文件信息",
* type="object",
* schema="File",
* @OA\Property(property="id", type="integer", description="ID"),
* @OA\Property(property="name", type="string", description="文件名"),
* @OA\Property(property="path", type="string", description="文件路径"),
* @OA\Property(property="mime", type="string", description="MIME类型"),
* @OA\Property(property="type", type="string", description="文件类型"),
* @OA\Property(property="url", type="string", description="访问URL"),
* @OA\Property(property="created_at", type="string", description="注册时间"),
* @OA\Property(property="updated_at", type="string", description="更新时间")
* )
*/
public
function
transform
(
File
$file
)
{
return
Helper
::
mapAttr
(
$file
,
[
'id'
,
'name'
,
'path'
,
'type'
,
'mime'
,
'created_at'
,
'updated_at'
,
'url'
=>
Helper
::
getFileUrl
(
$file
->
path
,
$file
->
type
),
]);
}
}
Modules/Admin/Http/Utils/Helper.php
View file @
29f8e5ab
...
...
@@ -21,7 +21,7 @@ class Helper {
if
(
!
$refresh
&&
$menu
=
Cache
::
get
(
"ALL_MENU"
)){
return
json_decode
(
$menu
,
true
);
}
$menu
=
AdminMenu
::
all
()
->
toArray
();
$menu
=
AdminMenu
::
where
(
'is_menu'
,
1
)
->
get
()
->
toArray
();
if
(
$menu
){
Cache
::
put
(
"ALL_MENU"
,
json_encode
(
$menu
));
}
...
...
@@ -29,6 +29,28 @@ class Helper {
}
/**
* 获取全部接口地址
* @desc
*
* @param false $refresh
*
* @return mixed|mixed[]
* @author [ZZM]
* @since 2023/10/30
* @modify
*/
static
function
getAllApi
(
$refresh
=
false
){
if
(
!
$refresh
&&
$apis
=
Cache
::
get
(
"ALL_API"
)){
return
json_decode
(
$apis
,
true
);
}
$apis
=
AdminMenu
::
all
()
->
toArray
();
if
(
$apis
){
Cache
::
put
(
"ALL_API"
,
json_encode
(
$apis
));
}
return
$apis
;
}
/**
* 获取角色菜单
* @desc
*
...
...
@@ -42,14 +64,14 @@ class Helper {
static
function
getRoleMenu
(
$role
,
$refresh
=
false
){
if
(
Helper
::
isAdministrator
(
$role
->
id
)){
#超级管理员默认获取全部菜单
return
self
::
getAllMenu
();
return
self
::
getAllMenu
(
true
);
}
if
(
!
$refresh
&&
$menu
=
Cache
::
get
(
"ROLE_MENU_
{
$role
->
id
}
"
)){
return
json_decode
(
$menu
,
true
);
}
$menu
=
$role
->
menu
;
$menu
=
$role
->
menu
()
->
where
(
'is_menu'
,
1
)
->
get
()
;
$menu
=
$menu
->
toArray
();
if
(
$menu
){
...
...
@@ -60,6 +82,38 @@ class Helper {
}
/**
* 获取角色接口地址
* @desc
*
* @param $role
* @param false $refresh
*
* @return mixed|mixed[]
* @since 2023/10/30
* @modify
* @author [ZZM]
*/
static
function
getRoleApi
(
$role
,
$refresh
=
false
){
if
(
Helper
::
isAdministrator
(
$role
->
id
)){
#超级管理员默认获取全部菜单
return
self
::
getAllApi
(
$refresh
);
}
if
(
!
$refresh
&&
$apis
=
Cache
::
get
(
"ROLE_API_
{
$role
->
id
}
"
)){
return
json_decode
(
$apis
,
true
);
}
$apis
=
$role
->
menu
()
->
get
();
$apis
=
$apis
->
toArray
();
if
(
$apis
){
Cache
::
put
(
"ROLE_API_
{
$role
->
id
}
"
,
json_encode
(
$apis
));
}
return
$apis
;
}
/**
* 是否超级管理员
* @desc
*
...
...
@@ -147,7 +201,7 @@ class Helper {
if
(
is_string
(
$key
)
&&
\Illuminate\Support\Str
::
endsWith
(
$key
,
'_full_url'
))
{
$key2
=
substr
(
$key
,
0
,
-
9
);
$temp
[
$key
]
=
$obj
->
$key
??
file_u
rl
(
$obj
->
$key2
);
$temp
[
$key
]
=
$obj
->
$key
??
self
::
fileU
rl
(
$obj
->
$key2
);
}
else
{
$temp
[
$key
]
=
(
is_object
(
$obj
->
$key
)
&&
(
$obj
->
$key
instanceof
Carbon
))
?
$obj
->
$key
->
toDateTimeString
()
:
$obj
->
$key
;
}
...
...
@@ -156,4 +210,36 @@ class Helper {
}
return
$temp
;
}
static
function
getFileUrl
(
$path
,
$type
)
{
$file_config
=
config
(
'upload.'
.
$type
,
[]);
$key
=
'fileststems.disks.'
.
$file_config
[
'filesystem'
]
.
'.url'
;
$prefix
=
$file_config
[
'url'
]
??
config
(
$key
,
null
);
return
$prefix
?
$prefix
.
$path
:
null
;
}
static
function
fileUrl
(
$file_path
)
{
if
(
$file_path
==
null
)
{
return
null
;
}
if
(
is_array
(
$file_path
))
{
return
array_map
(
'Helper::fileUrl'
,
$file_path
);
}
if
(
substr
(
$file_path
,
0
,
4
)
==
'http'
)
{
return
$file_path
;
}
$host_prefix
=
config
(
'app.file_url'
,
config
(
'app.url'
,
''
));
if
(
substr
(
$file_path
,
0
,
1
)
==
'/'
)
{
return
$host_prefix
.
$file_path
;
}
return
$host_prefix
.
config
(
'app.file_prefix'
,
'/uploads/'
)
.
$file_path
;
}
}
Modules/Admin/Routes/api.php
View file @
29f8e5ab
...
...
@@ -21,13 +21,18 @@ $api->version('v1', [
],
function
(
$api
)
{
#登录
$api
->
post
(
'auth/login'
,
'AuthController@login'
);
#登出
$api
->
put
(
'auth/login_out'
,
'AuthController@loginOut'
);
$api
->
group
([
'middleware'
=>
'api.auth'
],
function
(
$api
)
{
#刷新token
$api
->
put
(
'auth/refresh'
,
'AuthController@refreshToken'
);
#
登出
$api
->
put
(
'auth/login_out'
,
'AuthController@loginOut
'
);
#
用户信息
$api
->
get
(
'auth/info'
,
'AuthController@userInfo
'
);
#配置
$api
->
get
(
'configs'
,
'AuthController@apiConfig'
);
#上传文件
$api
->
post
(
'files'
,
'FilesController@store'
);
$api
->
group
([
'middleware'
=>
'role_menu'
],
function
(
$api
){
#菜单
...
...
Modules/Admin/vendor/autoload.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload.php @generated by Composer
if
(
PHP_VERSION_ID
<
50600
)
{
if
(
!
headers_sent
())
{
header
(
'HTTP/1.1 500 Internal Server Error'
);
}
$err
=
'Composer 2.3.0 dropped support for autoloading on PHP <5.6 and you are running '
.
PHP_VERSION
.
', please upgrade PHP or use Composer 2.2 LTS via "composer self-update --2.2". Aborting.'
.
PHP_EOL
;
if
(
!
ini_get
(
'display_errors'
))
{
if
(
PHP_SAPI
===
'cli'
||
PHP_SAPI
===
'phpdbg'
)
{
fwrite
(
STDERR
,
$err
);
}
elseif
(
!
headers_sent
())
{
echo
$err
;
}
}
trigger_error
(
$err
,
E_USER_ERROR
);
}
require_once
__DIR__
.
'/composer/autoload_real.php'
;
return
ComposerAutoloaderInita0dc2b1cb3bf0cf97958da9a77dfb137
::
getLoader
();
Modules/Admin/vendor/composer/ClassLoader.php
0 → 100644
View file @
29f8e5ab
<?php
/*
* This file is part of Composer.
*
* (c) Nils Adermann <naderman@naderman.de>
* Jordi Boggiano <j.boggiano@seld.be>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace
Composer\Autoload
;
/**
* ClassLoader implements a PSR-0, PSR-4 and classmap class loader.
*
* $loader = new \Composer\Autoload\ClassLoader();
*
* // register classes with namespaces
* $loader->add('Symfony\Component', __DIR__.'/component');
* $loader->add('Symfony', __DIR__.'/framework');
*
* // activate the autoloader
* $loader->register();
*
* // to enable searching the include path (eg. for PEAR packages)
* $loader->setUseIncludePath(true);
*
* In this example, if you try to use a class in the Symfony\Component
* namespace or one of its children (Symfony\Component\Console for instance),
* the autoloader will first look for the class under the component/
* directory, and it will then fallback to the framework/ directory if not
* found before giving up.
*
* This class is loosely based on the Symfony UniversalClassLoader.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Jordi Boggiano <j.boggiano@seld.be>
* @see https://www.php-fig.org/psr/psr-0/
* @see https://www.php-fig.org/psr/psr-4/
*/
class
ClassLoader
{
/** @var \Closure(string):void */
private
static
$includeFile
;
/** @var string|null */
private
$vendorDir
;
// PSR-4
/**
* @var array<string, array<string, int>>
*/
private
$prefixLengthsPsr4
=
array
();
/**
* @var array<string, list<string>>
*/
private
$prefixDirsPsr4
=
array
();
/**
* @var list<string>
*/
private
$fallbackDirsPsr4
=
array
();
// PSR-0
/**
* List of PSR-0 prefixes
*
* Structured as array('F (first letter)' => array('Foo\Bar (full prefix)' => array('path', 'path2')))
*
* @var array<string, array<string, list<string>>>
*/
private
$prefixesPsr0
=
array
();
/**
* @var list<string>
*/
private
$fallbackDirsPsr0
=
array
();
/** @var bool */
private
$useIncludePath
=
false
;
/**
* @var array<string, string>
*/
private
$classMap
=
array
();
/** @var bool */
private
$classMapAuthoritative
=
false
;
/**
* @var array<string, bool>
*/
private
$missingClasses
=
array
();
/** @var string|null */
private
$apcuPrefix
;
/**
* @var array<string, self>
*/
private
static
$registeredLoaders
=
array
();
/**
* @param string|null $vendorDir
*/
public
function
__construct
(
$vendorDir
=
null
)
{
$this
->
vendorDir
=
$vendorDir
;
self
::
initializeIncludeClosure
();
}
/**
* @return array<string, list<string>>
*/
public
function
getPrefixes
()
{
if
(
!
empty
(
$this
->
prefixesPsr0
))
{
return
call_user_func_array
(
'array_merge'
,
array_values
(
$this
->
prefixesPsr0
));
}
return
array
();
}
/**
* @return array<string, list<string>>
*/
public
function
getPrefixesPsr4
()
{
return
$this
->
prefixDirsPsr4
;
}
/**
* @return list<string>
*/
public
function
getFallbackDirs
()
{
return
$this
->
fallbackDirsPsr0
;
}
/**
* @return list<string>
*/
public
function
getFallbackDirsPsr4
()
{
return
$this
->
fallbackDirsPsr4
;
}
/**
* @return array<string, string> Array of classname => path
*/
public
function
getClassMap
()
{
return
$this
->
classMap
;
}
/**
* @param array<string, string> $classMap Class to filename map
*
* @return void
*/
public
function
addClassMap
(
array
$classMap
)
{
if
(
$this
->
classMap
)
{
$this
->
classMap
=
array_merge
(
$this
->
classMap
,
$classMap
);
}
else
{
$this
->
classMap
=
$classMap
;
}
}
/**
* Registers a set of PSR-0 directories for a given prefix, either
* appending or prepending to the ones previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 root directories
* @param bool $prepend Whether to prepend the directories
*
* @return void
*/
public
function
add
(
$prefix
,
$paths
,
$prepend
=
false
)
{
$paths
=
(
array
)
$paths
;
if
(
!
$prefix
)
{
if
(
$prepend
)
{
$this
->
fallbackDirsPsr0
=
array_merge
(
$paths
,
$this
->
fallbackDirsPsr0
);
}
else
{
$this
->
fallbackDirsPsr0
=
array_merge
(
$this
->
fallbackDirsPsr0
,
$paths
);
}
return
;
}
$first
=
$prefix
[
0
];
if
(
!
isset
(
$this
->
prefixesPsr0
[
$first
][
$prefix
]))
{
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
$paths
;
return
;
}
if
(
$prepend
)
{
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
array_merge
(
$paths
,
$this
->
prefixesPsr0
[
$first
][
$prefix
]
);
}
else
{
$this
->
prefixesPsr0
[
$first
][
$prefix
]
=
array_merge
(
$this
->
prefixesPsr0
[
$first
][
$prefix
],
$paths
);
}
}
/**
* Registers a set of PSR-4 directories for a given namespace, either
* appending or prepending to the ones previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
* @param bool $prepend Whether to prepend the directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public
function
addPsr4
(
$prefix
,
$paths
,
$prepend
=
false
)
{
$paths
=
(
array
)
$paths
;
if
(
!
$prefix
)
{
// Register directories for the root namespace.
if
(
$prepend
)
{
$this
->
fallbackDirsPsr4
=
array_merge
(
$paths
,
$this
->
fallbackDirsPsr4
);
}
else
{
$this
->
fallbackDirsPsr4
=
array_merge
(
$this
->
fallbackDirsPsr4
,
$paths
);
}
}
elseif
(
!
isset
(
$this
->
prefixDirsPsr4
[
$prefix
]))
{
// Register directories for a new namespace.
$length
=
strlen
(
$prefix
);
if
(
'\\'
!==
$prefix
[
$length
-
1
])
{
throw
new
\InvalidArgumentException
(
"A non-empty PSR-4 prefix must end with a namespace separator."
);
}
$this
->
prefixLengthsPsr4
[
$prefix
[
0
]][
$prefix
]
=
$length
;
$this
->
prefixDirsPsr4
[
$prefix
]
=
$paths
;
}
elseif
(
$prepend
)
{
// Prepend directories for an already registered namespace.
$this
->
prefixDirsPsr4
[
$prefix
]
=
array_merge
(
$paths
,
$this
->
prefixDirsPsr4
[
$prefix
]
);
}
else
{
// Append directories for an already registered namespace.
$this
->
prefixDirsPsr4
[
$prefix
]
=
array_merge
(
$this
->
prefixDirsPsr4
[
$prefix
],
$paths
);
}
}
/**
* Registers a set of PSR-0 directories for a given prefix,
* replacing any others previously set for this prefix.
*
* @param string $prefix The prefix
* @param list<string>|string $paths The PSR-0 base directories
*
* @return void
*/
public
function
set
(
$prefix
,
$paths
)
{
if
(
!
$prefix
)
{
$this
->
fallbackDirsPsr0
=
(
array
)
$paths
;
}
else
{
$this
->
prefixesPsr0
[
$prefix
[
0
]][
$prefix
]
=
(
array
)
$paths
;
}
}
/**
* Registers a set of PSR-4 directories for a given namespace,
* replacing any others previously set for this namespace.
*
* @param string $prefix The prefix/namespace, with trailing '\\'
* @param list<string>|string $paths The PSR-4 base directories
*
* @throws \InvalidArgumentException
*
* @return void
*/
public
function
setPsr4
(
$prefix
,
$paths
)
{
if
(
!
$prefix
)
{
$this
->
fallbackDirsPsr4
=
(
array
)
$paths
;
}
else
{
$length
=
strlen
(
$prefix
);
if
(
'\\'
!==
$prefix
[
$length
-
1
])
{
throw
new
\InvalidArgumentException
(
"A non-empty PSR-4 prefix must end with a namespace separator."
);
}
$this
->
prefixLengthsPsr4
[
$prefix
[
0
]][
$prefix
]
=
$length
;
$this
->
prefixDirsPsr4
[
$prefix
]
=
(
array
)
$paths
;
}
}
/**
* Turns on searching the include path for class files.
*
* @param bool $useIncludePath
*
* @return void
*/
public
function
setUseIncludePath
(
$useIncludePath
)
{
$this
->
useIncludePath
=
$useIncludePath
;
}
/**
* Can be used to check if the autoloader uses the include path to check
* for classes.
*
* @return bool
*/
public
function
getUseIncludePath
()
{
return
$this
->
useIncludePath
;
}
/**
* Turns off searching the prefix and fallback directories for classes
* that have not been registered with the class map.
*
* @param bool $classMapAuthoritative
*
* @return void
*/
public
function
setClassMapAuthoritative
(
$classMapAuthoritative
)
{
$this
->
classMapAuthoritative
=
$classMapAuthoritative
;
}
/**
* Should class lookup fail if not found in the current class map?
*
* @return bool
*/
public
function
isClassMapAuthoritative
()
{
return
$this
->
classMapAuthoritative
;
}
/**
* APCu prefix to use to cache found/not-found classes, if the extension is enabled.
*
* @param string|null $apcuPrefix
*
* @return void
*/
public
function
setApcuPrefix
(
$apcuPrefix
)
{
$this
->
apcuPrefix
=
function_exists
(
'apcu_fetch'
)
&&
filter_var
(
ini_get
(
'apc.enabled'
),
FILTER_VALIDATE_BOOLEAN
)
?
$apcuPrefix
:
null
;
}
/**
* The APCu prefix in use, or null if APCu caching is not enabled.
*
* @return string|null
*/
public
function
getApcuPrefix
()
{
return
$this
->
apcuPrefix
;
}
/**
* Registers this instance as an autoloader.
*
* @param bool $prepend Whether to prepend the autoloader or not
*
* @return void
*/
public
function
register
(
$prepend
=
false
)
{
spl_autoload_register
(
array
(
$this
,
'loadClass'
),
true
,
$prepend
);
if
(
null
===
$this
->
vendorDir
)
{
return
;
}
if
(
$prepend
)
{
self
::
$registeredLoaders
=
array
(
$this
->
vendorDir
=>
$this
)
+
self
::
$registeredLoaders
;
}
else
{
unset
(
self
::
$registeredLoaders
[
$this
->
vendorDir
]);
self
::
$registeredLoaders
[
$this
->
vendorDir
]
=
$this
;
}
}
/**
* Unregisters this instance as an autoloader.
*
* @return void
*/
public
function
unregister
()
{
spl_autoload_unregister
(
array
(
$this
,
'loadClass'
));
if
(
null
!==
$this
->
vendorDir
)
{
unset
(
self
::
$registeredLoaders
[
$this
->
vendorDir
]);
}
}
/**
* Loads the given class or interface.
*
* @param string $class The name of the class
* @return true|null True if loaded, null otherwise
*/
public
function
loadClass
(
$class
)
{
if
(
$file
=
$this
->
findFile
(
$class
))
{
$includeFile
=
self
::
$includeFile
;
$includeFile
(
$file
);
return
true
;
}
return
null
;
}
/**
* Finds the path to the file where the class is defined.
*
* @param string $class The name of the class
*
* @return string|false The path if found, false otherwise
*/
public
function
findFile
(
$class
)
{
// class map lookup
if
(
isset
(
$this
->
classMap
[
$class
]))
{
return
$this
->
classMap
[
$class
];
}
if
(
$this
->
classMapAuthoritative
||
isset
(
$this
->
missingClasses
[
$class
]))
{
return
false
;
}
if
(
null
!==
$this
->
apcuPrefix
)
{
$file
=
apcu_fetch
(
$this
->
apcuPrefix
.
$class
,
$hit
);
if
(
$hit
)
{
return
$file
;
}
}
$file
=
$this
->
findFileWithExtension
(
$class
,
'.php'
);
// Search for Hack files if we are running on HHVM
if
(
false
===
$file
&&
defined
(
'HHVM_VERSION'
))
{
$file
=
$this
->
findFileWithExtension
(
$class
,
'.hh'
);
}
if
(
null
!==
$this
->
apcuPrefix
)
{
apcu_add
(
$this
->
apcuPrefix
.
$class
,
$file
);
}
if
(
false
===
$file
)
{
// Remember that this class does not exist.
$this
->
missingClasses
[
$class
]
=
true
;
}
return
$file
;
}
/**
* Returns the currently registered loaders keyed by their corresponding vendor directories.
*
* @return array<string, self>
*/
public
static
function
getRegisteredLoaders
()
{
return
self
::
$registeredLoaders
;
}
/**
* @param string $class
* @param string $ext
* @return string|false
*/
private
function
findFileWithExtension
(
$class
,
$ext
)
{
// PSR-4 lookup
$logicalPathPsr4
=
strtr
(
$class
,
'\\'
,
DIRECTORY_SEPARATOR
)
.
$ext
;
$first
=
$class
[
0
];
if
(
isset
(
$this
->
prefixLengthsPsr4
[
$first
]))
{
$subPath
=
$class
;
while
(
false
!==
$lastPos
=
strrpos
(
$subPath
,
'\\'
))
{
$subPath
=
substr
(
$subPath
,
0
,
$lastPos
);
$search
=
$subPath
.
'\\'
;
if
(
isset
(
$this
->
prefixDirsPsr4
[
$search
]))
{
$pathEnd
=
DIRECTORY_SEPARATOR
.
substr
(
$logicalPathPsr4
,
$lastPos
+
1
);
foreach
(
$this
->
prefixDirsPsr4
[
$search
]
as
$dir
)
{
if
(
file_exists
(
$file
=
$dir
.
$pathEnd
))
{
return
$file
;
}
}
}
}
}
// PSR-4 fallback dirs
foreach
(
$this
->
fallbackDirsPsr4
as
$dir
)
{
if
(
file_exists
(
$file
=
$dir
.
DIRECTORY_SEPARATOR
.
$logicalPathPsr4
))
{
return
$file
;
}
}
// PSR-0 lookup
if
(
false
!==
$pos
=
strrpos
(
$class
,
'\\'
))
{
// namespaced class name
$logicalPathPsr0
=
substr
(
$logicalPathPsr4
,
0
,
$pos
+
1
)
.
strtr
(
substr
(
$logicalPathPsr4
,
$pos
+
1
),
'_'
,
DIRECTORY_SEPARATOR
);
}
else
{
// PEAR-like class name
$logicalPathPsr0
=
strtr
(
$class
,
'_'
,
DIRECTORY_SEPARATOR
)
.
$ext
;
}
if
(
isset
(
$this
->
prefixesPsr0
[
$first
]))
{
foreach
(
$this
->
prefixesPsr0
[
$first
]
as
$prefix
=>
$dirs
)
{
if
(
0
===
strpos
(
$class
,
$prefix
))
{
foreach
(
$dirs
as
$dir
)
{
if
(
file_exists
(
$file
=
$dir
.
DIRECTORY_SEPARATOR
.
$logicalPathPsr0
))
{
return
$file
;
}
}
}
}
}
// PSR-0 fallback dirs
foreach
(
$this
->
fallbackDirsPsr0
as
$dir
)
{
if
(
file_exists
(
$file
=
$dir
.
DIRECTORY_SEPARATOR
.
$logicalPathPsr0
))
{
return
$file
;
}
}
// PSR-0 include paths.
if
(
$this
->
useIncludePath
&&
$file
=
stream_resolve_include_path
(
$logicalPathPsr0
))
{
return
$file
;
}
return
false
;
}
/**
* @return void
*/
private
static
function
initializeIncludeClosure
()
{
if
(
self
::
$includeFile
!==
null
)
{
return
;
}
/**
* Scope isolated include.
*
* Prevents access to $this/self from included files.
*
* @param string $file
* @return void
*/
self
::
$includeFile
=
\Closure
::
bind
(
static
function
(
$file
)
{
include
$file
;
},
null
,
null
);
}
}
Modules/Admin/vendor/composer/LICENSE
0 → 100644
View file @
29f8e5ab
Copyright (c) Nils Adermann, Jordi Boggiano
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.
Modules/Admin/vendor/composer/autoload_classmap.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload_classmap.php @generated by Composer
$vendorDir
=
dirname
(
__DIR__
);
$baseDir
=
dirname
(
$vendorDir
);
return
array
(
'Composer\\InstalledVersions'
=>
$vendorDir
.
'/composer/InstalledVersions.php'
,
);
Modules/Admin/vendor/composer/autoload_files.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload_files.php @generated by Composer
$vendorDir
=
dirname
(
__DIR__
);
$baseDir
=
dirname
(
$vendorDir
);
return
array
(
'0be7e9e0829558786ef70afd7f14439f'
=>
$baseDir
.
'/Utils/helpers.php'
,
);
Modules/Admin/vendor/composer/autoload_namespaces.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload_namespaces.php @generated by Composer
$vendorDir
=
dirname
(
__DIR__
);
$baseDir
=
dirname
(
$vendorDir
);
return
array
(
);
Modules/Admin/vendor/composer/autoload_psr4.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload_psr4.php @generated by Composer
$vendorDir
=
dirname
(
__DIR__
);
$baseDir
=
dirname
(
$vendorDir
);
return
array
(
'Modules\\Admin\\'
=>
array
(
$baseDir
.
'/'
),
);
Modules/Admin/vendor/composer/autoload_real.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload_real.php @generated by Composer
class
ComposerAutoloaderInita0dc2b1cb3bf0cf97958da9a77dfb137
{
private
static
$loader
;
public
static
function
loadClassLoader
(
$class
)
{
if
(
'Composer\Autoload\ClassLoader'
===
$class
)
{
require
__DIR__
.
'/ClassLoader.php'
;
}
}
/**
* @return \Composer\Autoload\ClassLoader
*/
public
static
function
getLoader
()
{
if
(
null
!==
self
::
$loader
)
{
return
self
::
$loader
;
}
spl_autoload_register
(
array
(
'ComposerAutoloaderInita0dc2b1cb3bf0cf97958da9a77dfb137'
,
'loadClassLoader'
),
true
,
true
);
self
::
$loader
=
$loader
=
new
\Composer\Autoload\ClassLoader
(
\dirname
(
__DIR__
));
spl_autoload_unregister
(
array
(
'ComposerAutoloaderInita0dc2b1cb3bf0cf97958da9a77dfb137'
,
'loadClassLoader'
));
require
__DIR__
.
'/autoload_static.php'
;
call_user_func
(
\Composer\Autoload\ComposerStaticInita0dc2b1cb3bf0cf97958da9a77dfb137
::
getInitializer
(
$loader
));
$loader
->
register
(
true
);
$filesToLoad
=
\Composer\Autoload\ComposerStaticInita0dc2b1cb3bf0cf97958da9a77dfb137
::
$files
;
$requireFile
=
\Closure
::
bind
(
static
function
(
$fileIdentifier
,
$file
)
{
if
(
empty
(
$GLOBALS
[
'__composer_autoload_files'
][
$fileIdentifier
]))
{
$GLOBALS
[
'__composer_autoload_files'
][
$fileIdentifier
]
=
true
;
require
$file
;
}
},
null
,
null
);
foreach
(
$filesToLoad
as
$fileIdentifier
=>
$file
)
{
$requireFile
(
$fileIdentifier
,
$file
);
}
return
$loader
;
}
}
Modules/Admin/vendor/composer/autoload_static.php
0 → 100644
View file @
29f8e5ab
<?php
// autoload_static.php @generated by Composer
namespace
Composer\Autoload
;
class
ComposerStaticInita0dc2b1cb3bf0cf97958da9a77dfb137
{
public
static
$files
=
array
(
'0be7e9e0829558786ef70afd7f14439f'
=>
__DIR__
.
'/../..'
.
'/Utils/helpers.php'
,
);
public
static
$prefixLengthsPsr4
=
array
(
'M'
=>
array
(
'Modules\\Admin\\'
=>
14
,
),
);
public
static
$prefixDirsPsr4
=
array
(
'Modules\\Admin\\'
=>
array
(
0
=>
__DIR__
.
'/../..'
.
'/'
,
),
);
public
static
$classMap
=
array
(
'Composer\\InstalledVersions'
=>
__DIR__
.
'/..'
.
'/composer/InstalledVersions.php'
,
);
public
static
function
getInitializer
(
ClassLoader
$loader
)
{
return
\Closure
::
bind
(
function
()
use
(
$loader
)
{
$loader
->
prefixLengthsPsr4
=
ComposerStaticInita0dc2b1cb3bf0cf97958da9a77dfb137
::
$prefixLengthsPsr4
;
$loader
->
prefixDirsPsr4
=
ComposerStaticInita0dc2b1cb3bf0cf97958da9a77dfb137
::
$prefixDirsPsr4
;
$loader
->
classMap
=
ComposerStaticInita0dc2b1cb3bf0cf97958da9a77dfb137
::
$classMap
;
},
null
,
ClassLoader
::
class
);
}
}
composer.lock
View file @
29f8e5ab
...
...
@@ -1319,16 +1319,16 @@
},
{
"name": "laravel/framework",
"version": "v10.2
8
.0",
"version": "v10.2
9
.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/framework.git",
"reference": "
09137f50f715c1efc649788a26092dcb1ec4ab6e
"
"reference": "
2d002849a16ad131110a50cbea4d64dbb78515a3
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/framework/zipball/
09137f50f715c1efc649788a26092dcb1ec4ab6e
",
"reference": "
09137f50f715c1efc649788a26092dcb1ec4ab6e
",
"url": "https://api.github.com/repos/laravel/framework/zipball/
2d002849a16ad131110a50cbea4d64dbb78515a3
",
"reference": "
2d002849a16ad131110a50cbea4d64dbb78515a3
",
"shasum": ""
},
"require": {
...
...
@@ -1361,7 +1361,7 @@
"symfony/console": "^6.2",
"symfony/error-handler": "^6.2",
"symfony/finder": "^6.2",
"symfony/http-foundation": "^6.
2
",
"symfony/http-foundation": "^6.
3
",
"symfony/http-kernel": "^6.2",
"symfony/mailer": "^6.2",
"symfony/mime": "^6.2",
...
...
@@ -1428,13 +1428,15 @@
"league/flysystem-read-only": "^3.3",
"league/flysystem-sftp-v3": "^3.0",
"mockery/mockery": "^1.5.1",
"nyholm/psr7": "^1.2",
"orchestra/testbench-core": "^8.12",
"pda/pheanstalk": "^4.0",
"phpstan/phpstan": "^1.4.7",
"phpunit/phpunit": "^10.0.7",
"predis/predis": "^2.0.2",
"symfony/cache": "^6.2",
"symfony/http-client": "^6.2.4"
"symfony/http-client": "^6.2.4",
"symfony/psr-http-message-bridge": "^2.0"
},
"suggest": {
"ably/ably-php": "Required to use the Ably broadcast driver (^1.0).",
...
...
@@ -1515,27 +1517,27 @@
"issues": "https://github.com/laravel/framework/issues",
"source": "https://github.com/laravel/framework"
},
"time": "2023-10-
10T13:01:37
+00:00"
"time": "2023-10-
24T13:48:53
+00:00"
},
{
"name": "laravel/prompts",
"version": "v0.1.1
1
",
"version": "v0.1.1
2
",
"source": {
"type": "git",
"url": "https://github.com/laravel/prompts.git",
"reference": "
cce65a90e64712909ea1adc033e1d88de8455ffd
"
"reference": "
b35f249028c22016e45e48626e19e5d42fd827ff
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/prompts/zipball/
cce65a90e64712909ea1adc033e1d88de8455ffd
",
"reference": "
cce65a90e64712909ea1adc033e1d88de8455ffd
",
"url": "https://api.github.com/repos/laravel/prompts/zipball/
b35f249028c22016e45e48626e19e5d42fd827ff
",
"reference": "
b35f249028c22016e45e48626e19e5d42fd827ff
",
"shasum": ""
},
"require": {
"ext-mbstring": "*",
"illuminate/collections": "^10.0|^11.0",
"php": "^8.1",
"symfony/console": "^6.2"
"symfony/console": "^6.2
|^7.0
"
},
"conflict": {
"illuminate/console": ">=10.17.0 <10.25.0",
...
...
@@ -1570,22 +1572,22 @@
],
"support": {
"issues": "https://github.com/laravel/prompts/issues",
"source": "https://github.com/laravel/prompts/tree/v0.1.1
1
"
"source": "https://github.com/laravel/prompts/tree/v0.1.1
2
"
},
"time": "2023-10-
03T01:07:35
+00:00"
"time": "2023-10-
18T14:18:57
+00:00"
},
{
"name": "laravel/serializable-closure",
"version": "v1.3.
1
",
"version": "v1.3.
2
",
"source": {
"type": "git",
"url": "https://github.com/laravel/serializable-closure.git",
"reference": "
e5a3057a5591e1cfe8183034b0203921abe2c902
"
"reference": "
076fe2cf128bd54b4341cdc6d49b95b34e101e4c
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/
e5a3057a5591e1cfe8183034b0203921abe2c902
",
"reference": "
e5a3057a5591e1cfe8183034b0203921abe2c902
",
"url": "https://api.github.com/repos/laravel/serializable-closure/zipball/
076fe2cf128bd54b4341cdc6d49b95b34e101e4c
",
"reference": "
076fe2cf128bd54b4341cdc6d49b95b34e101e4c
",
"shasum": ""
},
"require": {
...
...
@@ -1632,7 +1634,7 @@
"issues": "https://github.com/laravel/serializable-closure/issues",
"source": "https://github.com/laravel/serializable-closure"
},
"time": "2023-
07-14T13:56:28
+00:00"
"time": "2023-
10-17T13:38:16
+00:00"
},
{
"name": "laravel/tinker",
...
...
@@ -2031,16 +2033,16 @@
},
{
"name": "league/flysystem",
"version": "3.1
7
.0",
"version": "3.1
8
.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem.git",
"reference": "
bd4c9b26849d82364119c68429541f1631fba94b
"
"reference": "
015633a05aee22490495159237a5944091d8281e
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/
bd4c9b26849d82364119c68429541f1631fba94b
",
"reference": "
bd4c9b26849d82364119c68429541f1631fba94b
",
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/
015633a05aee22490495159237a5944091d8281e
",
"reference": "
015633a05aee22490495159237a5944091d8281e
",
"shasum": ""
},
"require": {
...
...
@@ -2069,7 +2071,7 @@
"google/cloud-storage": "^1.23",
"microsoft/azure-storage-blob": "^1.1",
"phpseclib/phpseclib": "^3.0.14",
"phpstan/phpstan": "^
0.12.26
",
"phpstan/phpstan": "^
1.10
",
"phpunit/phpunit": "^9.5.11|^10.0",
"sabre/dav": "^4.3.1"
},
...
...
@@ -2105,7 +2107,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem/issues",
"source": "https://github.com/thephpleague/flysystem/tree/3.1
7
.0"
"source": "https://github.com/thephpleague/flysystem/tree/3.1
8
.0"
},
"funding": [
{
...
...
@@ -2117,20 +2119,20 @@
"type": "github"
}
],
"time": "2023-10-
05T20:15:05
+00:00"
"time": "2023-10-
20T17:59:40
+00:00"
},
{
"name": "league/flysystem-local",
"version": "3.1
6
.0",
"version": "3.1
8
.0",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/flysystem-local.git",
"reference": "e
c7383f25642e6fd4bb0c9554fc2311245391781
"
"reference": "e
7381ef7643f658b87efb7dbe98fe538fb1bbf32
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e
c7383f25642e6fd4bb0c9554fc2311245391781
",
"reference": "e
c7383f25642e6fd4bb0c9554fc2311245391781
",
"url": "https://api.github.com/repos/thephpleague/flysystem-local/zipball/e
7381ef7643f658b87efb7dbe98fe538fb1bbf32
",
"reference": "e
7381ef7643f658b87efb7dbe98fe538fb1bbf32
",
"shasum": ""
},
"require": {
...
...
@@ -2165,7 +2167,7 @@
],
"support": {
"issues": "https://github.com/thephpleague/flysystem-local/issues",
"source": "https://github.com/thephpleague/flysystem-local/tree/3.1
6
.0"
"source": "https://github.com/thephpleague/flysystem-local/tree/3.1
8
.0"
},
"funding": [
{
...
...
@@ -2177,7 +2179,7 @@
"type": "github"
}
],
"time": "2023-
08-30T10:23:59
+00:00"
"time": "2023-
10-19T20:07:13
+00:00"
},
{
"name": "league/fractal",
...
...
@@ -2307,16 +2309,16 @@
},
{
"name": "monolog/monolog",
"version": "3.
4
.0",
"version": "3.
5
.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
"reference": "
e2392369686d420ca32df3803de28b5d6f76867d
"
"reference": "
c915e2634718dbc8a4a15c61b0e62e7a44e14448
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/
e2392369686d420ca32df3803de28b5d6f76867d
",
"reference": "
e2392369686d420ca32df3803de28b5d6f76867d
",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/
c915e2634718dbc8a4a15c61b0e62e7a44e14448
",
"reference": "
c915e2634718dbc8a4a15c61b0e62e7a44e14448
",
"shasum": ""
},
"require": {
...
...
@@ -2392,7 +2394,7 @@
],
"support": {
"issues": "https://github.com/Seldaek/monolog/issues",
"source": "https://github.com/Seldaek/monolog/tree/3.
4
.0"
"source": "https://github.com/Seldaek/monolog/tree/3.
5
.0"
},
"funding": [
{
...
...
@@ -2404,7 +2406,7 @@
"type": "tidelift"
}
],
"time": "2023-
06-21T08:46:1
1+00:00"
"time": "2023-
10-27T15:32:3
1+00:00"
},
{
"name": "namshi/jose",
...
...
@@ -2643,16 +2645,16 @@
},
{
"name": "nette/utils",
"version": "v4.0.
2
",
"version": "v4.0.
3
",
"source": {
"type": "git",
"url": "https://github.com/nette/utils.git",
"reference": "
cead6637226456b35e1175cc53797dd585d8554
5"
"reference": "
a9d127dd6a203ce6d255b2e2db49759f7506e01
5"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/nette/utils/zipball/
cead6637226456b35e1175cc53797dd585d8554
5",
"reference": "
cead6637226456b35e1175cc53797dd585d8554
5",
"url": "https://api.github.com/repos/nette/utils/zipball/
a9d127dd6a203ce6d255b2e2db49759f7506e01
5",
"reference": "
a9d127dd6a203ce6d255b2e2db49759f7506e01
5",
"shasum": ""
},
"require": {
...
...
@@ -2723,9 +2725,9 @@
],
"support": {
"issues": "https://github.com/nette/utils/issues",
"source": "https://github.com/nette/utils/tree/v4.0.
2
"
"source": "https://github.com/nette/utils/tree/v4.0.
3
"
},
"time": "2023-
09-19T11:58:07
+00:00"
"time": "2023-
10-29T21:02:13
+00:00"
},
{
"name": "nikic/php-parser",
...
...
@@ -4102,16 +4104,16 @@
},
{
"name": "swagger-api/swagger-ui",
"version": "v5.9.
0
",
"version": "v5.9.
1
",
"source": {
"type": "git",
"url": "https://github.com/swagger-api/swagger-ui.git",
"reference": "
cbfc3e949d3d9e2b71d566fb722cb3970036f593
"
"reference": "
bb59bcf36dff8b6476299ab7d45cc87957999d36
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/
cbfc3e949d3d9e2b71d566fb722cb3970036f593
",
"reference": "
cbfc3e949d3d9e2b71d566fb722cb3970036f593
",
"url": "https://api.github.com/repos/swagger-api/swagger-ui/zipball/
bb59bcf36dff8b6476299ab7d45cc87957999d36
",
"reference": "
bb59bcf36dff8b6476299ab7d45cc87957999d36
",
"shasum": ""
},
"type": "library",
...
...
@@ -4157,9 +4159,9 @@
],
"support": {
"issues": "https://github.com/swagger-api/swagger-ui/issues",
"source": "https://github.com/swagger-api/swagger-ui/tree/v5.9.
0
"
"source": "https://github.com/swagger-api/swagger-ui/tree/v5.9.
1
"
},
"time": "2023-
09-29T12:27:07
+00:00"
"time": "2023-
10-25T08:21:35
+00:00"
},
{
"name": "symfony/console",
...
...
@@ -4679,16 +4681,16 @@
},
{
"name": "symfony/http-foundation",
"version": "v6.3.
5
",
"version": "v6.3.
7
",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-foundation.git",
"reference": "
b50f5e281d722cb0f4c296f908bacc3e2b721957
"
"reference": "
59d1837d5d992d16c2628cd0d6b76acf8d69b33e
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/
b50f5e281d722cb0f4c296f908bacc3e2b721957
",
"reference": "
b50f5e281d722cb0f4c296f908bacc3e2b721957
",
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/
59d1837d5d992d16c2628cd0d6b76acf8d69b33e
",
"reference": "
59d1837d5d992d16c2628cd0d6b76acf8d69b33e
",
"shasum": ""
},
"require": {
...
...
@@ -4698,12 +4700,12 @@
"symfony/polyfill-php83": "^1.27"
},
"conflict": {
"symfony/cache": "<6.
2
"
"symfony/cache": "<6.
3
"
},
"require-dev": {
"doctrine/dbal": "^2.13.1|^3
.0
",
"doctrine/dbal": "^2.13.1|^3
|^4
",
"predis/predis": "^1.1|^2.0",
"symfony/cache": "^
5.4|^6.0
",
"symfony/cache": "^
6.3
",
"symfony/dependency-injection": "^5.4|^6.0",
"symfony/expression-language": "^5.4|^6.0",
"symfony/http-kernel": "^5.4.12|^6.0.12|^6.1.4",
...
...
@@ -4736,7 +4738,7 @@
"description": "Defines an object-oriented layer for the HTTP specification",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-foundation/tree/v6.3.
5
"
"source": "https://github.com/symfony/http-foundation/tree/v6.3.
7
"
},
"funding": [
{
...
...
@@ -4752,20 +4754,20 @@
"type": "tidelift"
}
],
"time": "2023-
09-04T21:33:54
+00:00"
"time": "2023-
10-28T23:55:27
+00:00"
},
{
"name": "symfony/http-kernel",
"version": "v6.3.
5
",
"version": "v6.3.
7
",
"source": {
"type": "git",
"url": "https://github.com/symfony/http-kernel.git",
"reference": "
9f991a964368bee8d883e8d57ced4fe9fff04dfc
"
"reference": "
6d4098095f93279d9536a0e9124439560cc764d0
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/
9f991a964368bee8d883e8d57ced4fe9fff04dfc
",
"reference": "
9f991a964368bee8d883e8d57ced4fe9fff04dfc
",
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/
6d4098095f93279d9536a0e9124439560cc764d0
",
"reference": "
6d4098095f93279d9536a0e9124439560cc764d0
",
"shasum": ""
},
"require": {
...
...
@@ -4849,7 +4851,7 @@
"description": "Provides a structured process for converting a Request into a Response",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/http-kernel/tree/v6.3.
5
"
"source": "https://github.com/symfony/http-kernel/tree/v6.3.
7
"
},
"funding": [
{
...
...
@@ -4865,7 +4867,7 @@
"type": "tidelift"
}
],
"time": "2023-
09-30T06:37:04
+00:00"
"time": "2023-
10-29T14:31:45
+00:00"
},
{
"name": "symfony/mailer",
...
...
@@ -6151,16 +6153,16 @@
},
{
"name": "symfony/translation",
"version": "v6.3.
3
",
"version": "v6.3.
7
",
"source": {
"type": "git",
"url": "https://github.com/symfony/translation.git",
"reference": "3
ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd
"
"reference": "3
0212e7c87dcb79c83f6362b00bde0e0b1213499
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/translation/zipball/3
ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd
",
"reference": "3
ed078c54bc98bbe4414e1e9b2d5e85ed5a5c8bd
",
"url": "https://api.github.com/repos/symfony/translation/zipball/3
0212e7c87dcb79c83f6362b00bde0e0b1213499
",
"reference": "3
0212e7c87dcb79c83f6362b00bde0e0b1213499
",
"shasum": ""
},
"require": {
...
...
@@ -6226,7 +6228,7 @@
"description": "Provides tools to internationalize your application",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/translation/tree/v6.3.
3
"
"source": "https://github.com/symfony/translation/tree/v6.3.
7
"
},
"funding": [
{
...
...
@@ -6242,7 +6244,7 @@
"type": "tidelift"
}
],
"time": "2023-
07-31T07:08:24
+00:00"
"time": "2023-
10-28T23:11:45
+00:00"
},
{
"name": "symfony/translation-contracts",
...
...
@@ -6398,16 +6400,16 @@
},
{
"name": "symfony/var-dumper",
"version": "v6.3.
5
",
"version": "v6.3.
6
",
"source": {
"type": "git",
"url": "https://github.com/symfony/var-dumper.git",
"reference": "
3d9999376be5fea8de47752837a3e1d1c5f69ef5
"
"reference": "
999ede244507c32b8e43aebaa10e9fce20de7c97
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/
3d9999376be5fea8de47752837a3e1d1c5f69ef5
",
"reference": "
3d9999376be5fea8de47752837a3e1d1c5f69ef5
",
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/
999ede244507c32b8e43aebaa10e9fce20de7c97
",
"reference": "
999ede244507c32b8e43aebaa10e9fce20de7c97
",
"shasum": ""
},
"require": {
...
...
@@ -6462,7 +6464,7 @@
"dump"
],
"support": {
"source": "https://github.com/symfony/var-dumper/tree/v6.3.
5
"
"source": "https://github.com/symfony/var-dumper/tree/v6.3.
6
"
},
"funding": [
{
...
...
@@ -6478,20 +6480,20 @@
"type": "tidelift"
}
],
"time": "2023-
09-12T10:11:35
+00:00"
"time": "2023-
10-12T18:45:56
+00:00"
},
{
"name": "symfony/yaml",
"version": "v6.3.
3
",
"version": "v6.3.
7
",
"source": {
"type": "git",
"url": "https://github.com/symfony/yaml.git",
"reference": "
e23292e8c07c85b971b44c1c4b87af52133e2add
"
"reference": "
9758b6c69d179936435d0ffb577c3708d57e38a8
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/yaml/zipball/
e23292e8c07c85b971b44c1c4b87af52133e2add
",
"reference": "
e23292e8c07c85b971b44c1c4b87af52133e2add
",
"url": "https://api.github.com/repos/symfony/yaml/zipball/
9758b6c69d179936435d0ffb577c3708d57e38a8
",
"reference": "
9758b6c69d179936435d0ffb577c3708d57e38a8
",
"shasum": ""
},
"require": {
...
...
@@ -6534,7 +6536,7 @@
"description": "Loads and dumps YAML files",
"homepage": "https://symfony.com",
"support": {
"source": "https://github.com/symfony/yaml/tree/v6.3.
3
"
"source": "https://github.com/symfony/yaml/tree/v6.3.
7
"
},
"funding": [
{
...
...
@@ -6550,7 +6552,7 @@
"type": "tidelift"
}
],
"time": "2023-
07-31T07:08:24
+00:00"
"time": "2023-
10-28T23:31:00
+00:00"
},
{
"name": "tijsverkoyen/css-to-inline-styles",
...
...
@@ -7093,16 +7095,16 @@
},
{
"name": "laravel/pint",
"version": "v1.13.
3
",
"version": "v1.13.
5
",
"source": {
"type": "git",
"url": "https://github.com/laravel/pint.git",
"reference": "
93b2d0d49719bc6e444ba21cd4dbbccec935413d
"
"reference": "
df105cf8ce7a8f0b8a9425ff45cd281a5448e423
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/pint/zipball/
93b2d0d49719bc6e444ba21cd4dbbccec935413d
",
"reference": "
93b2d0d49719bc6e444ba21cd4dbbccec935413d
",
"url": "https://api.github.com/repos/laravel/pint/zipball/
df105cf8ce7a8f0b8a9425ff45cd281a5448e423
",
"reference": "
df105cf8ce7a8f0b8a9425ff45cd281a5448e423
",
"shasum": ""
},
"require": {
...
...
@@ -7114,12 +7116,12 @@
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^3.34.1",
"illuminate/view": "^10.2
3.1
",
"illuminate/view": "^10.2
6.2
",
"laravel-zero/framework": "^10.1.2",
"mockery/mockery": "^1.6.6",
"nunomaduro/larastan": "^2.6.4",
"nunomaduro/termwind": "^1.15.1",
"pestphp/pest": "^2.
18.2
"
"pestphp/pest": "^2.
20.0
"
},
"bin": [
"builds/pint"
...
...
@@ -7155,31 +7157,31 @@
"issues": "https://github.com/laravel/pint/issues",
"source": "https://github.com/laravel/pint"
},
"time": "2023-10-
10T15:39:09
+00:00"
"time": "2023-10-
26T09:26:10
+00:00"
},
{
"name": "laravel/sail",
"version": "v1.2
5
.0",
"version": "v1.2
6
.0",
"source": {
"type": "git",
"url": "https://github.com/laravel/sail.git",
"reference": "
e81a7bd7ac1a745ccb25572830fecf74a89bb48a
"
"reference": "
c60fe037004e272efd0d81f416ed2bfc623d70b4
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/sail/zipball/
e81a7bd7ac1a745ccb25572830fecf74a89bb48a
",
"reference": "
e81a7bd7ac1a745ccb25572830fecf74a89bb48a
",
"url": "https://api.github.com/repos/laravel/sail/zipball/
c60fe037004e272efd0d81f416ed2bfc623d70b4
",
"reference": "
c60fe037004e272efd0d81f416ed2bfc623d70b4
",
"shasum": ""
},
"require": {
"illuminate/console": "^
8.0|^9.0|^10
.0",
"illuminate/contracts": "^
8.0|^9.0|^10
.0",
"illuminate/support": "^
8.0|^9.0|^10
.0",
"illuminate/console": "^
9.0|^10.0|^11
.0",
"illuminate/contracts": "^
9.0|^10.0|^11
.0",
"illuminate/support": "^
9.0|^10.0|^11
.0",
"php": "^8.0",
"symfony/yaml": "^6.0"
"symfony/yaml": "^6.0
|^7.0
"
},
"require-dev": {
"orchestra/testbench": "^
6.0|^7.0|^8
.0",
"orchestra/testbench": "^
7.0|^8.0|^9
.0",
"phpstan/phpstan": "^1.10"
},
"bin": [
...
...
@@ -7220,7 +7222,7 @@
"issues": "https://github.com/laravel/sail/issues",
"source": "https://github.com/laravel/sail"
},
"time": "2023-
09-11T17:37:09
+00:00"
"time": "2023-
10-18T13:57:15
+00:00"
},
{
"name": "mnabialek/laravel-sql-logger",
...
...
@@ -8024,16 +8026,16 @@
},
{
"name": "phpunit/phpunit",
"version": "10.4.
1
",
"version": "10.4.
2
",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "
62bd7af13d282deeb95650077d28ba3600ca321c
"
"reference": "
cacd8b9dd224efa8eb28beb69004126c7ca1a1a1
"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/
62bd7af13d282deeb95650077d28ba3600ca321c
",
"reference": "
62bd7af13d282deeb95650077d28ba3600ca321c
",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/
cacd8b9dd224efa8eb28beb69004126c7ca1a1a1
",
"reference": "
cacd8b9dd224efa8eb28beb69004126c7ca1a1a1
",
"shasum": ""
},
"require": {
...
...
@@ -8105,7 +8107,7 @@
"support": {
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.
1
"
"source": "https://github.com/sebastianbergmann/phpunit/tree/10.4.
2
"
},
"funding": [
{
...
...
@@ -8121,7 +8123,7 @@
"type": "tidelift"
}
],
"time": "2023-10-
08T05:01:11
+00:00"
"time": "2023-10-
26T07:21:45
+00:00"
},
{
"name": "sebastian/cli-parser",
...
...
config/filesystems.php
View file @
29f8e5ab
...
...
@@ -29,6 +29,12 @@ return [
*/
'disks'
=>
[
'admin'
=>
[
'driver'
=>
'local'
,
'root'
=>
public_path
(
'uploads'
),
'visibility'
=>
'public'
,
'url'
=>
env
(
'APP_URL'
)
.
'/uploads'
,
],
'local'
=>
[
'driver'
=>
'local'
,
...
...
config/upload.php
0 → 100644
View file @
29f8e5ab
<?php
$default_filesystem
=
"admin"
;
$url
=
"/uploads/"
;
return
[
'avatar'
=>
[
"validate"
=>
'mimes:jpeg,jpg,bmp,png,gif|dimensions:min_width=200,min_height=200'
,
"validate_msg"
=>
[],
"folder"
=>
"avatar"
,
"filesystem"
=>
$default_filesystem
,
//使用的储存系统
"url"
=>
$url
,
'image_processor'
=>
'resize:200,null,constraint=aspectRatio&upsize|crop:200,200'
,
],
];
\ No newline at end of file
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