• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP app\Member类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中app\Member的典型用法代码示例。如果您正苦于以下问题:PHP Member类的具体用法?PHP Member怎么用?PHP Member使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Member类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: postEvaluate

 public function postEvaluate(Request $request)
 {
     $data = $request->all();
     $user_id = $data['user_id'];
     $evaluation = $data['evaluation'];
     $user = User::where("id", $user_id)->first();
     $event = $this->currentEvent();
     if ($evaluation == "false") {
         $user->delete();
     } else {
         $user->standing = "active";
         $user->save();
         $position = $data['position'];
         if ($position == "Overall Activity Head") {
             $event->oah_id = $user_id;
             $event->save();
         } elseif ($position == "Committee Head") {
             $comm_id = $data['comm_id'];
             $comm = Committee::where("event_id", $event->id)->where("id", $comm_id)->first();
             $head = new Head();
             $head->position = $comm->name . " Head";
             $head->user_id = $user_id;
             $head->comm_id = $comm->id;
             $head->event_id = $event->id;
             $head->save();
         } else {
             $member = new Member();
             $member->user_id = $user_id;
             $member->comm_id = $comm_id;
             $member->save();
         }
     }
     return redirect('/admin');
 }
开发者ID:zoekayvee,项目名称:YSESTracker,代码行数:34,代码来源:AdminController.php


示例2: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     if (!isset($data['type'])) {
         $data['type'] = 'none';
     } elseif ($data['type'] == 'member') {
         Validator::make($data, ['firstname' => 'required', 'lastname' => 'required']);
         //create user
         $user = User::create(['name' => $data['firstname'] . ' ' . $data['lastname'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'contact' => $data['contact'], 'type' => $data['type']]);
         $member = new Member();
         $member->user_id = $user->id;
         $member->firstname = $data['firstname'];
         $member->lastname = $data['lastname'];
         if ($member->save()) {
             session()->flash('success', 'Member Profile Created Successfully!');
         } else {
             $user->delete();
             session()->flash('error', 'Error! Please try again..');
         }
     } elseif ($data['type'] == 'artist') {
         Validator::make($data, ['firstname' => 'required', 'lastname' => 'required']);
         //create user
         $user = User::create(['name' => $data['firstname'] . ' ' . $data['lastname'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'contact' => $data['contact'], 'type' => $data['type']]);
         $artist = new Artist();
         $artist->user_id = $user->id;
         $artist->firstname = $data['firstname'];
         $artist->lastname = $data['lastname'];
         if ($artist->save()) {
             session()->flash('success', 'Artist Profile Created Successfully!');
         } else {
             $user->delete();
             session()->flash('error', 'Error! Please try again..');
         }
     } elseif ($data['type'] == 'studio') {
         Validator::make($data, ['name' => 'required', 'title' => 'required']);
         //create user
         $user = User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password']), 'contact' => $data['contact'], 'type' => $data['type']]);
         $studio = new Studio();
         $studio->user_id = $user->id;
         $studio->name = $user->name;
         $studio->title = $data['title'];
         if ($studio->save()) {
             session()->flash('success', 'Studio Created Successfully!');
         } else {
             $user->delete();
             session()->flash('error', 'Error! Please try again..');
         }
     }
     //dd($data);
     //do your role stuffs here
     //send verification mail to user
     //--------------------------------------------------------------------------------------------------------------
     //$data['verification_code']  = $user->verification_code;
     Mail::send('emails.welcome', $data, function ($message) use($data) {
         $message->from('[email protected]', "Tattoo Cultr");
         $message->subject("Welcome to Tattoo Cultr");
         $message->to($data['email']);
     });
     return $user;
 }
开发者ID:erabhidhaliwal,项目名称:oottatcultr,代码行数:65,代码来源:AuthController.php


示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param Requests\UpdateMemberRequest|Request $request
  * @param Member $member
  * @return \Illuminate\Http\Response
  */
 public function update(Requests\UpdateMemberRequest $request, Member $member)
 {
     $input = $request->all();
     if (isset($input['loot']) && $input['loot'] != '0') {
         $member->loot()->attach($input['loot'], ['awarded_at' => $input['awarded_at']]);
         unset($input['loot']);
     }
     $member->update($input);
     return redirect('members');
 }
开发者ID:yodarian,项目名称:epgp,代码行数:17,代码来源:MembersController.php


示例4: create

 /**
  * Create a new user instance after a valid registration.
  *
  * @param  array  $data
  * @return User
  */
 protected function create(array $data)
 {
     $member = new Member();
     $member->fname = $data['firstname'];
     $member->lname = $data['lastname'];
     $member->email = $data['email'];
     $member->bday = $data['birthday'];
     $member->gender = $data['gender'];
     $member->mobile = $data['mobile'];
     $member->save();
     $inserted_id = $member->id;
     return User::create(['email' => $data['email'], 'password' => bcrypt($data['password']), 'indicator_id' => '5', 'login_id' => $inserted_id]);
 }
开发者ID:kreativjamesz,项目名称:homemalldev,代码行数:19,代码来源:AuthController.php


示例5: getCurrentMember

 /**
  * Returns the current member based on the session id
  * @return Member
  */
 private function getCurrentMember()
 {
     if (!$this->currentMember && !($this->currentMember = Member::currentMember()->first())) {
         $this->currentMember = Member::create(['session_id' => \Session::getId()]);
     }
     return $this->currentMember;
 }
开发者ID:Sparclex,项目名称:studie,代码行数:11,代码来源:SurveyController.php


示例6: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     for ($i = 0; $i < 20; $i++) {
         Member::create(['name' => "Member {$i}", 'email' => "member{$i}@gmail.com", 'phone' => "phone {$i}", 'country' => "country {$i}"]);
     }
 }
开发者ID:niscp,项目名称:To-do-app-with-Laravel-LAMP-Stack,代码行数:12,代码来源:MemberTableSeeder.php


示例7: index

 public function index()
 {
     $officialDate = Carbon::now()->subDay();
     $birthdays = Member::whereMonth('birthday', '=', $officialDate->format('m'))->whereDay('birthday', '=', $officialDate->format('d'))->get();
     //dd($members);
     return view('welcome')->with('birthdays', $birthdays);
 }
开发者ID:StivenSerna,项目名称:gym,代码行数:7,代码来源:DashboardController.php


示例8: edit

 public function edit(Request $request)
 {
     $rules = array('fullname' => 'required', 'address' => 'required', 'zipcode_id' => 'required');
     $validator = \Validator::make($request->all(), $rules);
     if ($validator->fails()) {
         return Response::json(array('result' => false, 'data' => 'ข้อมูลผิดพลาด', 'message' => $validator->messages()->all()));
     }
     $user = \Auth::user();
     if ($user == null) {
         return Response::json(array('result' => false, 'data' => 'can not define user.'));
     }
     $member = Member::where('id', $user->id)->first();
     //var_dump($member);
     $member->fullname = $request->input('fullname');
     $member->address = $request->input('address');
     $member->district_id = $request->input('district_id');
     $member->amphur_id = $request->input('amphur_id');
     $member->province_id = $request->input('province_id');
     $member->zipcode_id = $request->input('zipcode_id');
     if ($member->save()) {
         return Response::json(array('result' => true, 'data' => 'บันทึกข้อมูลเสร็จเรียบร้อย'));
     } else {
         return Response::json(array('result' => false, 'data' => 'เกิดข้อผิดพลาด'));
     }
 }
开发者ID:snookerjirayut,项目名称:unotoon-member,代码行数:25,代码来源:MemberController.php


示例9: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $users = Member::latest()->paginate(15);
     $membership_types = MembershipType::lists('type', 'id')->put('0', 'all')->sortBy('id');
     $institution_type = InstitutionType::lists('name', 'id');
     return view('backend.memberships.listing', compact('membership_types', 'users', 'institution_type', 'typeName'));
 }
开发者ID:harshiarora,项目名称:csi-1,代码行数:12,代码来源:MembershipController.php


示例10: handleProviderCallback

 /**
  * Obtain the user information from GitHub.
  *
  * @return Response
  */
 public function handleProviderCallback(Request $request)
 {
     // Used for development purposes. Hit /auth/google/callback
     // to get a dummy JWT for local use.
     if (\App::environment('local')) {
         $member = Member::findOrFail(1);
         if (!$member->hasRole('member')) {
             $member->attachRole(Role::where('name', 'member')->firstOrFail());
         }
         $token = JWTAuth::fromUser($member, ['level' => config('auth.levels.high'), 'member' => $member]);
         return response()->json($token);
     }
     $provider = new GoogleRitProvider($request);
     $user = $provider->user();
     if (array_get($user->user, 'domain', '') != 'g.rit.edu') {
         return new JsonResponse(['error' => 'domain user not authorized'], Response::HTTP_FORBIDDEN);
     }
     $member = Member::firstOrNew(['email' => $user->email]);
     $member->first_name = $user->user['name']['givenName'];
     $member->last_name = $user->user['name']['familyName'];
     $member->save();
     if (!$member->hasRole('member')) {
         $member->attachRole(Role::where('name', 'member')->firstOrFail());
     }
     $token = JWTAuth::fromUser($member, ['level' => config('auth.levels.high'), 'member' => $member]);
     if ($callback = $provider->getCallback()) {
         return redirect($callback . '?token=' . $token);
     } else {
         return response()->json(['token' => $token]);
     }
 }
开发者ID:rit-sse,项目名称:api,代码行数:36,代码来源:AuthController.php


示例11: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     //
     $member = Member::find($id);
     $member->delete();
     return \Redirect::to('admin.member.index');
 }
开发者ID:xubodreamsky,项目名称:cn.arcoss.free,代码行数:13,代码来源:MemberController.php


示例12: showMember

 public function showMember(Request $r)
 {
     $member = Member::where("id", $r->input('id'))->get();
     $hc = new HomeController();
     $vars = $hc->getVars();
     return view('member', ['member' => $member[0], "lang" => "fa", "vars" => $vars]);
 }
开发者ID:ariiiaaaaan,项目名称:sbu_testlab,代码行数:7,代码来源:MemberController.php


示例13: update

 public function update(Request $request, $id)
 {
     $member = \App\Member::findOrFail($id);
     $member->name = $request->name;
     $member->save();
     return redirect('/');
 }
开发者ID:dianahanly,项目名称:laravel-simple-CRUD,代码行数:7,代码来源:MemberController.php


示例14: run

 /**
  * Run the database seeds.
  */
 public function run()
 {
     Model::unguard();
     Member::truncate();
     $this->call('MemberTableSeeder');
     Model::reguard();
 }
开发者ID:niscp,项目名称:To-do-app-with-Laravel-LAMP-Stack,代码行数:10,代码来源:DatabaseSeeder.php


示例15: testDeleteMember

 /**
  * Fonction permettant de tester la
  * suppression d'un membre d'un projet
  *
  * @return void
  */
 public function testDeleteMember()
 {
     Member::create(["project_id" => 2, "Developer_id" => 2]);
     $cnt = new MemberController();
     $cnt->remove(2, 2);
     $this->assertEquals(null, Member::where("project_id", 2)->where("Developer_id", 2)->get()->first());
 }
开发者ID:hardwork2015,项目名称:cdp,代码行数:13,代码来源:DeleteMemberTest.php


示例16: postRegister

 /**
  * Handle a registration request for the application.
  *
  * @param  \Illuminate\Http\Request  $request
  * @return \Illuminate\Http\Response
  */
 public function postRegister(Request $request)
 {
     $validator = $this->registrar->validator($request->all());
     if ($validator->fails()) {
         $this->throwValidationException($request, $validator);
     }
     $this->auth->login($this->registrar->create($request->all()));
     $member = new Member();
     $member->first_name = $request->first_name;
     $member->last_name = $request->last_name;
     $member->save();
     $mail = new Mail();
     $mail->mail = $request->email;
     $mail->code = rand(1000000, 9999999);
     $mail->save();
     return redirect($this->redirectPath());
 }
开发者ID:BDMADE,项目名称:team1,代码行数:23,代码来源:AuthController.php


示例17: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function destroy($memberId, $pointId)
 {
     $point = Point::find($pointId);
     $member = Member::find($memberId);
     $member->update(['total_points' => $member->total_points - $point->point]);
     $point->Delete('set null');
     return redirect()->action('MembersController@show', $memberId);
 }
开发者ID:jacqhernandez,项目名称:lsopcs,代码行数:14,代码来源:PointsController.php


示例18: run

 /**
  * Run the database seeds.
  *
  * @return void
  */
 public function run()
 {
     //
     DB::table('member')->delete();
     Member::create(['account' => 'derrick', 'nick' => 'mikcy', 'name' => '张三', 'mobile' => '13819887634', 'gender' => 0, 'age' => 34, 'email' => '[email protected]', 'password' => Hash::make('123')]);
     Member::create(['account' => 'derrick2', 'nick' => 'mikcy2', 'name' => '李四', 'mobile' => '11819887634', 'gender' => 1, 'age' => 32, 'email' => '[email protected]', 'password' => Hash::make('123')]);
     Member::create(['account' => 'derrick3', 'nick' => 'micky3', 'name' => '王五', 'mobile' => '13829887634', 'gender' => 1, 'age' => 26, 'email' => '[email protected]', 'password' => Hash::make('1223')]);
 }
开发者ID:xubodreamsky,项目名称:wadmin,代码行数:13,代码来源:MemberTableSeeder.php


示例19: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     $rules = ["name" => "required|min:3", "email" => "required|email", "blog" => "url", "github" => "", "twitter" => "", "group" => "exists:groups,id", "g-recaptcha-response" => "required|captcha"];
     $validator = Validator::make($request->all(), $rules);
     if ($validator->fails()) {
         return Redirect::route("community.create")->withErrors($validator)->withInput();
     }
     $member = new Member();
     $member->name = $request->input("name");
     $member->email = $request->input("email");
     $member->blog = $request->input("blog");
     $member->github = $request->input("github");
     $member->twitter = $request->input("twitter");
     $member->group_id = $request->input("group");
     $member->save();
     return Redirect::route("community.index")->with("success", "Başarıyla topluluğa katıldınız!");
 }
开发者ID:linuxyazkampi,项目名称:linuxyazkampi,代码行数:23,代码来源:CommunityController.php


示例20: getCategory

 public static function getCategory($slug)
 {
     // get category members
     $r = Member::getCategoryMembers($slug);
     printR($r);
     exit;
     // get member social media
 }
开发者ID:nowarena,项目名称:laravel,代码行数:8,代码来源:SocialMedia.php



注:本文中的app\Member类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP app\Menu类代码示例发布时间:2022-05-23
下一篇:
PHP app\Location类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap