How to access resource from resource?

Help me, i want to access resource from resource
i want to create "promo" from cars

expected url like:
http://127.0.0.1:8000/car/{carId}/promos

so, when i create new promo, it will be related the car_id


this is my code:
Action::make('view_promo')
  ->url(fn ($record) => PromoResource::getUrl('view', ['record' => $record->id])),


this is the result:
Route [filament.admin.resources.car.promos.view] not defined.

i have 2 models:
"Cars" and "Promo"

class Car extends Model implements HasMedia
{
    use HasFactory;
    use InteractsWithMedia;

    /**
     * @var string
     */
    protected $table = 'cars';

    public function promos(): HasMany
    {
        return $this->hasMany(Promo::class, 'car_id');
    }

    ...
}


class Original extends Model implements HasMedia
{
    use HasFactory;
    use InteractsWithMedia;

    /**
     * @var string
     */
    protected $table = 'photos_car_original';

    public function car(): BelongsTo
    {
        return $this->belongsTo(Car::class, 'car_id');
    }
}


can u help me? thanks
Was this page helpful?