rnb_dev
Why Filament Custom theme generating path like this in tw config 'is it bug or im doing it wrong'
all is ok! now its generating correctly in both windows and linux! all i have to do is update the version! I started my project about 2 week ago so I thought there is no need to update any packege! -_- sorry my bad!
8 replies
Why Filament Custom theme generating path like this in tw config 'is it bug or im doing it wrong'
Although I fixed the problem by manually configure it! I will regenarate theme again after updating filament version in linux and windows and give you an update what is the situation
8 replies
Can Anyone help me with policy ?
Ow thanks brother It is working! I didn't know laravel have this kind of function to guess policy class !!
this is the code for my solution!
Gate::guessPolicyNamesUsing(function (string $modelClass) {
// Get the base name of the model class without the namespace
$modelBaseName = class_basename($modelClass);
// Determine the policy class namespace
$policyNamespace = 'App\\Policies\\';
// Handle models in subdirectories by appending the subdirectory to the policy namespace
if (Str::contains($modelClass, 'Models\\')) {
$subDirectory = Str::between($modelClass, 'Models\\', '\\' . $modelBaseName);
if (!empty($subDirectory)) {
$policyNamespace .= str_replace('\\', '\\\\', $subDirectory) . '\\';
}
}
// Construct the full policy class name
$policyClassName = $policyNamespace . $modelBaseName . 'Policy';
return $policyClassName;
});
GENERATED BY CHAT GPT 🐸7 replies