Anto03
UploadFile error
local.ERROR: Path cannot be empty {"userId":1,"exception":"[object] (ValueError(code: 0): Path cannot be empty at C:\laragon\www\intranetv31\vendor\laravel\framework\src\Illuminate\Filesystem\FilesystemAdapter.php:414)
[stacktrace]
5 replies
User in admin panel
<?php
namespace App\Helpers;
use Filament\Navigation\NavigationItem;
class NavigationHelper
{
public function Navigation($module, $main)
{
$modules = json_decode(file_get_contents(base_path('modules_statuses.json')), true);
$navigationItems = [];
if ($main === 'not') {
$navigationItems[] = NavigationItem::make('Main Dashboard')
->url("/admin");
}
foreach ($modules as $key => $value) {
$path = base_path("Modules/$key/Filament/Admin/Resources/*Resource.php");
$key_mod = strtolower($key);
if ($key !== $module) {
if($main !== 'not'){
$navigationItems[] = NavigationItem::make($key)
->url("admin/$key_mod")
->icon('heroicon-o-document')
->group('Modules')
->sort(1);
}else{
$navigationItems[] = NavigationItem::make($key)
->url("$key_mod")
->icon('heroicon-o-document')
->group('Modules')
->sort(1);
}
}
}
return $navigationItems;
}
}
38 replies
User in admin panel
public function Navigation($module, $main)
{
$modules = json_decode(file_get_contents(base_path('modules_statuses.json')), true);
$navigationItems = [];
if ($main === 'not') {
$navigationItems[] = NavigationItem::make('Main Dashboard')
->url("/admin");
}
foreach ($modules as $key => $value) {
$path = base_path("Modules/$key/Filament/Admin/Resources/*Resource.php");
$key_mod = strtolower($key);
if ($key !== $module) {
if($main !== 'not'){
$navigationItems[] = NavigationItem::make($key)
->url("admin/$key_mod")
->visible(fn () => auth()->user()?->hasRole('user_panel'))
->icon('heroicon-o-document')
->group('Modules')
->sort(1);
}else{
$navigationItems[] = NavigationItem::make($key)
->url("$key_mod")
->icon('heroicon-o-document')
->group('Modules')
->sort(1);
}
}
}
return $navigationItems;
}
38 replies