Select ->relationship table not found.

Hey guys, run into a little trouble using Select->relationship. Advice appreciated. Thanks.

The follow code is in the Action::make('accept_offer')->form()

Select::make('branch_id')
      ->label('Branch')
      ->exists('shop_branches', 'id')
      ->relationship(
         name: 'shopBranch',
         titleAttribute: 'name',
         modifyQueryUsing: fn (Builder $query, Offer|AutoOffer $record) => $query->where(['staff_id' => $record->staff_id, 'enabled' => true])->orderBy('name'),)
      ->required()
      ->live(),


Error: SQLSTATE[HY000]: General error: 1 no such table: shop_branches

I am using the same code in the default admin panel resource and it work well. It also work well in v2 for v2 when using the old ways.
But when I use it on user panel which I created and render the widget via .

  <div class="mb-5">
     @livewire(\App\Filament\User\Widgets\AutoOfferWidget::class)
  </div>


in the blade file, it throw the error above. The table do exist in my db.
Was this page helpful?