Add basecontract
All checks were successful
Deploy App / deploy (push) Successful in 10s

This commit is contained in:
2025-09-04 17:57:15 +02:00
parent 1565df568d
commit aa27851bd7
7 changed files with 39 additions and 22 deletions

View File

@@ -2,10 +2,9 @@
namespace App\Livewire;
use App\Bots\BotContract;
use App\Interfaces\BaseContract;
use App\Models\Bot;
use Cron\CronExpression;
use Illuminate\Support\Arr;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\URL;
use Illuminate\Validation\Rule;
@@ -59,7 +58,7 @@ class CreateEditBot extends Component
$class = $baseNamespace . '\\' . $relativeNamespace;
// Make sure class exists and implements BotContract
if (class_exists($class) && in_array(BotContract::class, class_implements($class))) {
if (class_exists($class) && in_array(BaseContract::class, class_implements($class))) {
$label = method_exists($class, 'label')
? $class::label()
: class_basename($class);
@@ -117,7 +116,7 @@ class CreateEditBot extends Component
return;
}
if (!in_array(\App\Bots\BotContract::class, class_implements($this->class))) {
if (!in_array(BaseContract::class, class_implements($this->class))) {
$this->addError('class', 'The specified class does not exist.');
return;
}