本文整理汇总了PHP中Illuminate\Http\Response::view方法的典型用法代码示例。如果您正苦于以下问题:PHP Response::view方法的具体用法?PHP Response::view怎么用?PHP Response::view使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Illuminate\Http\Response
的用法示例。
在下文中一共展示了Response::view方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addUserGang
/**
* Ajout d'un jouer dans un gang
*/
public function addUserGang(Request $request, Guard $auth)
{
if ($request->isMethod('POST')) {
$playerId = $request->get("playerid");
$groupId = $request->get("groupId");
$gang = DB::table('gangs')->where('id', $groupId)->first();
$suppr = array("\"", "`", "[", "]");
$lineGang = str_replace($suppr, "", $gang->members);
$ArrayGang = preg_split("/,/", $lineGang);
$gangMembers = array();
if ($auth->user()->arma == $gang->owner) {
if (count($ArrayGang) <= $gang->maxmembers) {
foreach ($ArrayGang as $member) {
$gangMembers[] = $member;
}
if (env('DB_EXTDB') == 1) {
$gangMembersString = '[';
} elseif (env('DB_EXTDB') == 2) {
$gangMembersString = '"[';
}
$gangList = "";
foreach ($gangMembers as $gangMember) {
$gangList .= "`" . $gangMember . "`,";
}
$gangList .= "`" . $playerId . "`,";
$gangList = rtrim($gangList, ",");
$gangMembersString .= $gangList;
if (env('DB_EXTDB') == 1) {
$gangMembersString .= ']';
} elseif (env('DB_EXTDB') == 2) {
$gangMembersString .= ']"';
}
DB::table('gangs')->where('id', $groupId)->update(array('members' => $gangMembersString));
return redirect(url('player'))->with('success', 'Le joueur à bien rajouté au gang');
} else {
return redirect(url('player'))->with('error', 'Vous avez atteint le nombre maximum de membres');
}
} else {
return Response::view('errors.403', array(), 403);
}
}
}