Created
December 16, 2023 13:51
-
-
Save neverything/a226c0f24d5c1716fc62b17b47d1e63c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Filament\Resources; | |
// use ... | |
class FeedbackResource extends Resource | |
{ | |
// ... rest of the class | |
public static function isTenantSubscriptionRequired(Panel $panel): bool | |
{ | |
$path = request()->path(); | |
if (! preg_match('/project\/(\d+)/', $path, $matches)) { | |
return true; | |
} | |
$tenant = $panel->getTenantModel()::findOrFail(intval($matches[1])); | |
return $tenant->isBillable(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment