D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home
/
etb1lp46s9ed
/
public_html
/
wabulk.whatzi.online
/
app
/
Http
/
Middleware
/
Filename :
EnsureUserMediaFolder.php
back
Copy
<?php namespace App\Http\Middleware; use Closure; use Illuminate\Support\Facades\Auth; use Illuminate\Support\Facades\Storage; class EnsureUserMediaFolder { public function handle($request, Closure $next) { $is_installed = env('APP_INSTALLED', false); if ($is_installed === 'false' || $is_installed === false) { return $next($request); } if (Auth::check()) { $path = 'files/'.Auth::id(); if (!Storage::disk('public')->exists($path)) { Storage::disk('public')->makeDirectory($path); } } return $next($request); } }