Closed avxart closed 5 years ago
Hi there. Following our discussion from Slack.
Current code looks like this:
functions.php $form->Links('Players')->setModel('App\Models\User')
$form->Links('Players')->setModel('App\Models\User')
User.php:
class User extends WPUser { use TypeRocket\Models\Traits\Searchable; }
overridden getSearchColumn(): use TypeRocket\Models\WPUser;
public function getSearchColumn() { if($this instanceof WPUser) { return 'user_nicename'; } return $this->getIdColumn(); }
Figured it out. It couldn't find the searchable trait.
Unsure if this happens with other typerocket installs. Since I'm using the theme install.
Hi there. Following our discussion from Slack.
Current code looks like this:
functions.php
$form->Links('Players')->setModel('App\Models\User')
User.php:
overridden getSearchColumn(): use TypeRocket\Models\WPUser;