Closed bahramzade closed 7 months ago
@bahramzade Can you share the code for the model?
error in this model
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Orbit\Concerns\Orbital;
class ChildCategory extends Model
{
use Orbital;
public function schema(Blueprint $table): void
{
$table->id();
$table->string('name')->unique();
$table->string('activeClass')->nullable();
$table->text('content')->nullable();
}
}
another model Category is worked not problem
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Factories\HasFactory;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Schema\Blueprint;
use Orbit\Concerns\Orbital;
use Orbit\Contracts\Orbit;
use Rennokki\QueryCache\Traits\QueryCacheable;
class Category extends Model implements Orbit
{
use HasFactory;
use Orbital;
use QueryCacheable;
public $timestamps = false;
public $cacheFor = 3600 * 24; // In seconds
protected static $flushCacheOnUpdate = true;
public function schema(Blueprint $table): void
{
$table->id();
$table->string('name')->unique();
$table->string('activeClass')->unique();
$table->text('content')->nullable();
}
public function packages()
{
return $this->hasMany(Package::class);
}
public function childCategories()
{
return $this->belongsTo(ChildCategories::class);
}
}
Yep, you need to implement the Orbit interface. That's the problem.
Yep, you need to implement the Orbit interface. That's the problem.
use Orbit\Contracts\Orbit;
not found why?
Orbit\Actions\MaybeCreateOrbitDirectories::execute(): Argument #1 ($model) must be of type (Orbit\Contracts\Orbit&Illuminate\Database\Eloquent\Model)|null, App\Models\ChildCategory given, called in /Users/rasulchopurov/Herd/laravel-package-ocean/vendor/ryangjchandler/orbit/src/Concerns/Orbital.php on line 29