How to use this relationship in Laravel Inertia JS?
My User model: public function role() { return $this->belongsTo(Role::class); } My Role model: public function count() { return User::where('role_id', $this->id)->count(); } I want to retrieve how many users have a certain role in my Index.vue component. When I type in…