本文整理匯總了PHP中app\User::owns方法的典型用法代碼示例。如果您正苦於以下問題:PHP User::owns方法的具體用法?PHP User::owns怎麽用?PHP User::owns使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類app\User
的用法示例。
在下文中一共展示了User::owns方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: delete
public function delete(User $user, Message $message)
{
if ($message->type) {
return $user->owns($message);
} else {
if ($user->id == $message->receiver_id) {
return true;
}
}
return false;
}
示例2: update
public function update(User $user, Post $post)
{
return $user->owns($post);
}
示例3: update
public function update(User $user, Message $message)
{
return $user->owns($message);
}
示例4: delete
public function delete(User $user, Transaction $transaction)
{
return $user->owns($transaction->customer);
}
示例5: edit
public function edit(User $user, Article $article)
{
//return $user->id == $article->user_id;
return $user->owns($article);
}
示例6: destroy
/**
* Determine if the given user can be deleted by the user.
*
* @param \App\User $user
* @param \App\User $target_user
* @return bool
*/
public function destroy(User $user, User $target_user)
{
return $user->owns($target_user);
}
示例7: show
public function show(User $user, Profile $profile)
{
return $user->owns($profile);
}
示例8: update
public function update(User $user, Quest $quest)
{
return $user->owns($quest);
}
示例9: update
public function update(User $user, Article $article)
{
return $user->owns($article);
}
示例10: withdraw
public function withdraw(User $user, Project $project)
{
return $user->owns($project);
}
示例11: delete
public function delete(User $user, Customer $customer)
{
return $user->owns($customer);
}
示例12: delete
public function delete(User $user, AmazonProduct $customer)
{
return $user->owns($customer);
}