本文整理汇总了PHP中app\Member::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Member::all方法的具体用法?PHP Member::all怎么用?PHP Member::all使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Member
的用法示例。
在下文中一共展示了Member::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAllMembers
/**
* Show the application dashboard to the user.
*
* @return Response
*/
public function getAllMembers()
{
$members = Member::all();
$data = array();
foreach ($members as $member) {
# code...
$member_data = array();
array_push($member_data, $member->member_id);
array_push($member_data, $member->first_name);
array_push($member_data, $member->last_name);
array_push($member_data, $member->gender);
array_push($member_data, $member->birthday);
array_push($member_data, $member->address);
array_push($member_data, $member->start_date);
array_push($member_data, $member->end_date);
array_push($member_data, $member->phone);
array_push($member_data, $member->balance);
array_push($member_data, $member->level);
array_push($member_data, $member->email);
array_push($member_data, "/member/" . $member->member_id);
$data[] = $member_data;
}
$returner = array('data' => $data);
echo json_encode($returner);
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$members = Member::all();
foreach ($members as $member) {
$member->load('devices', 'subgroups');
}
return response()->json($members, 200);
}
示例3: numMembers
private function numMembers()
{
$numActive = Member::all()->where('is_active', 1)->count();
$numInactive = Member::all()->where('is_active', 0)->count();
$numDischarged = Member::onlyTrashed()->count();
$numTotal = Member::withTrashed()->count();
return ['numActive' => $numActive, 'numInactive' => $numInactive, 'numDischarged' => $numDischarged, 'numTotal' => $numTotal];
}
示例4: export
public function export()
{
$data = Member::all();
Excel::create('Filename', function ($excel) use($data) {
$excel->sheet('Sheetname', function ($sheet) use($data) {
$sheet->fromArray($data);
});
})->download('xls');
}
示例5: getMembersForMultiselect
public static function getMembersForMultiselect()
{
$members = Member::all(array('id', 'name'))->toArray();
$multiselectMembers = array();
foreach ($members as $member) {
$multiselectMembers[$member['id']] = $member['name'];
}
return $multiselectMembers;
}
示例6: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$data = Employee::all();
$name = Auth::user()->name;
$pos = ProjectOfficer::all();
$adms = Admin::all();
$tls = Teamleader::all();
$mems = Member::all();
return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('data', $data);
}
示例7: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
$members = Member::all();
foreach ($members as &$member) {
$member->setPriority($member->getPriority());
$member->setLowerPriority($member->getLowerPriority());
}
$members = $members->sortByDesc('priority');
return view('members.index', compact('members'));
}
示例8: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$data = Employee::all();
$name = Auth::user()->name;
$pos = ProjectOfficer::all();
$adms = Admin::all();
$tls = Teamleader::all();
$mems = Member::all();
$proj = Project::all();
$ac = Auth::user()->id;
$acc = AccessClient::where('id_users', $ac)->get();
return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('projs', $proj)->with('accss', $acc)->with('datas', $data);
}
示例9: create
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$members = [];
foreach (Member::all() as $member) {
$members += [$member->id => $member->name()];
}
$loans = Loan::all();
$ltypes = [];
foreach ($loans as $loan) {
$ltypes += [$loan->id => $loan->name];
}
return view('admin.account.create', compact('ltypes', 'members', 'loans'));
}
示例10: index
public function index(Request $request)
{
if (!Auth::check()) {
return response()->json($this->notLoginJson, 401);
} else {
$user = Auth::user();
if (!$user->hasRole('user')) {
return response()->json($this->needPermissionsJson, 401);
}
}
$members = Member::all();
return response()->json($members);
}
示例11: index
public function index()
{
foreach (Member::all() as $item) {
sleep(2);
// ip-api.com ban any IP addresses doing over 150 requests per minute
$json = json_decode(file_get_contents("http://ip-api.com/json/{$item->ip}"));
$item->city = $json->city;
$item->country = $json->country;
$member = Member::find($item->id);
$member->city = $item->city;
$member->country = $item->country;
$member->save();
}
return "Ready";
}
示例12: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// Start Check Authorization
$invalid_auth = 1;
$authRole = Auth::user()->UserRoles->role;
if ($authRole == 1 or $authRole == 3 or $authRole == 5 or $authRole == 7 or $authRole == 9) {
$invalid_auth = 0;
}
if ($invalid_auth == 1) {
Alert::error('Anda tidak memilik akses ini')->persistent('close');
return redirect('dashboard');
}
// End Check Authorization
$data = Employee::all();
$name = Auth::user()->name;
$pos = ProjectOfficer::all();
$adms = Admin::all();
$tls = Teamleader::all();
$mems = Member::all();
return view('dropmin.record.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('datas', $data);
}
示例13: globalView
/**
* List of all member devices and their pertinent information
*
* @return \Illuminate\Http\Response
*/
public function globalView(Request $request)
{
$validator = Validator::make($request->all(), ['type' => array('regex:/^[\\d]$/i')]);
if ($validator->fails()) {
return response()->json(["error" => "validator failed", "cause" => $validator->failed()], 400);
} else {
$ret = array();
$members = Member::all();
foreach ($members as $member) {
$devices;
if ($request->has('type')) {
$devices = $member->devices->where('type', $request->type);
} else {
$devices = $member->devices;
}
foreach ($devices as $device) {
$entry = ['mid' => $member->id, 'did' => $device->id, 'deviceID' => $device->deviceID, 'deviceName' => $device->name, 'memberName' => $member->name, 'deviceType' => $device->type];
array_push($ret, $entry);
}
}
return response()->json($ret, 200);
}
}
示例14: sendRead
/**
* Update the specified resource in storage.
*
* @param int $id
* @return Response
*/
public function sendRead()
{
$members = Member::all();
//all data of member collection
$inbox_id = HelperController::getPage();
$id = Auth::id();
$author = User::find($id);
$inbox = Inbox::find($inbox_id);
//find data in Inbox collection
$unread = Inbox::where('mail_read', '=', '0')->where('member_id', '=', $id)->get()->count();
//mailbox view
return view('vendor/flatAdmin/mailRead', compact(array('members', 'author', 'inbox', 'unread', 'id')));
}
示例15: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$membersObj = Member::all();
return view('members.index', compact('membersObj'));
}