mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-04-27 10:40:38 +00:00
ability to download log from admin
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
namespace Support\Middleware;
|
||||
|
||||
use Closure;
|
||||
|
||||
class AdminCheck
|
||||
{
|
||||
/**
|
||||
* Handle an incoming request.
|
||||
*
|
||||
* @param \Illuminate\Http\Request $request
|
||||
* @param \Closure $next
|
||||
* @return mixed
|
||||
*/
|
||||
public function handle($request, Closure $next)
|
||||
{
|
||||
// Check if user have access to administration settings
|
||||
if ( $request->user()->role !== 'admin') {
|
||||
abort(403, 'You don\'t have access for this operation!');
|
||||
}
|
||||
|
||||
return $next($request);
|
||||
}
|
||||
}
|
||||
@@ -18,6 +18,22 @@ use Domain\Localization\Models\Language;
|
||||
use Intervention\Image\ImageManagerStatic as Image;
|
||||
use Illuminate\Database\Eloquent\ModelNotFoundException;
|
||||
|
||||
if (! function_exists('getListOfLatestLogs')) {
|
||||
/**
|
||||
* Check if cron is running
|
||||
*/
|
||||
function getListOfLatestLogs(): array
|
||||
{
|
||||
return array_slice(
|
||||
array_reverse(
|
||||
array_filter(
|
||||
scandir(storage_path() . '/logs'), fn($fn) => !str_starts_with($fn, '.')
|
||||
)
|
||||
), 0, 5, true
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (! function_exists('isRunningCron')) {
|
||||
/**
|
||||
* Check if cron is running
|
||||
|
||||
Reference in New Issue
Block a user