Closed minedun6 closed 9 years ago
It seems like you're not using the "inviteToTeam" method on the facade.
Could you try this again without the whole namespace and just use the Teamwork
facade instead?
yes how silly of me, i was referencing the actual class rather than the facade. and another bit of an issue come out, i was trying to get the actual number of pending invitations related to the USER but i'm surprised it was on a seperate object.
What do you mean by separate object
?
The pending invitations are related to the email address, because there is no other indication available.
normally the invitation are related to the user so logically i should be doing
$user->pendingInvitations(); and it should return a collection of objectives such as who's the sender and the receipient.
Oh you're right. I haven't thought about that. I only thought about having pending invitations to users, that aren't yet registered.
I'll add this feature in the next version :+1:
do u have a lock on the next version or is it gonna be for a little while ? Something else to keep in mind, u need to keep track of both the sender and the receipient in the database and u're not doing that, u should make that getting the pending invitations are show to the recepient properly not to the sender. U should see this repo, will help you out greatly.
I'm trying to stick with the current API - so there's at least no version 2 on the horizon. So I'm going to stick to http://semver.org
So the next version will be 1.2.0, as this feature isn't changing existing behaviour
And the invitations are in fact keeping track of both the sender and the recipient.
The sender is referenced via the user_id
and the recipient is referenced via the email
, because there is no other way to recognize a receiver just right now.
What might be possible is that you could throw in a user (or "Auth") object to the inviteToTeam
method as well, and it will extract the user_id
and email
from it.
@minedun6 the invites relation for a user already exists.
To list all pending invites of a specific user model use the invites
relation like:
Auth::user()->invites();
When i try to call this method, there is this error that pops out and says that i can't use it. is there a way to fix ?