当前位置: 首页>>代码示例>>PHP>>正文


PHP Member::with方法代码示例

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


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

示例1: get

 public function get($id)
 {
     $article = Member::with('command')->find($id);
     if (!$article) {
         return response()->json(null, 404);
     }
     return response()->json($article);
 }
开发者ID:valiknet18,项目名称:FootballNewsApp,代码行数:8,代码来源:MembersController.php

示例2: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show($id)
 {
     try {
         $result = Member::with('memberships')->findOrFail($id);
         return response()->json($result);
     } catch (ModelNotFoundException $e) {
         return new JsonResponse(['error' => 'not found'], Response::HTTP_NOT_FOUND);
     }
 }
开发者ID:rit-sse,项目名称:api,代码行数:15,代码来源:MemberController.php

示例3: membersCsv

 public function membersCsv()
 {
     if (Gate::denies('admin')) {
         Auth::logout();
         return redirect('/admin/login');
     }
     $members = Member::with('group')->get();
     $columns = ['id', 'email', 'first_name', 'last_name', 'country', 'group.name', 'created_at', 'birthdate', 'faculty'];
     $headers = ['ID', 'Email', 'First Name', 'Last Name', 'Country', 'Team Name', 'Registered At', 'Birthdate', 'Faculty/School'];
     $csv = $this->exportCsv($members, $columns, $headers);
     $csvName = 'eca-members-' . date('Y-m-d-His') . '.csv';
     return response($csv, 200, ['Content-type' => 'text/csv', 'Content-Disposition' => sprintf('attachment; filename="%s"', $csvName), 'Content-Length' => strlen($csv)]);
 }
开发者ID:jirojo2,项目名称:pleem,代码行数:13,代码来源:AdminController.php

示例4: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Member::with('person.contacts', 'person.files', 'person.education')->paginate(50);
     return view('admin.index', compact('data'));
 }
开发者ID:jallowmamadou,项目名称:balance-1,代码行数:10,代码来源:AdminController.php

示例5: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return Response
  */
 public function show(Request $request, $id)
 {
     // Fetch the first match
     // detail -- [ high | med | low ]
     $detailLevel = $request->input('detail', 'low');
     // Todo: Add $detailLevel == med
     try {
         if ($detailLevel == 'high') {
             // Todo: to add more "eager loaded" relationshions, add extra args to Member::with()
             $member = Member::with('postings')->where('regt_num', $id)->withTrashed()->firstOrFail();
         } else {
             //  when $detailLevel == low
             $member = Member::where('regt_num', $id)->withTrashed()->firstOrFail();
         }
         return response()->json(['member' => $member->toArray()]);
     } catch (\Exception $ex) {
         return response()->json(['error' => ['code' => $ex->getCode(), 'reason' => $ex->getMessage()]], 404);
     }
 }
开发者ID:alansfyeung,项目名称:FLARES,代码行数:25,代码来源:MemberController.php

示例6: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     return Member::with(['experiences' => function ($query) {
         $query->with('project');
     }])->where('id', $id)->first();
 }
开发者ID:mcoyevans,项目名称:personiv-productivity-quality-report,代码行数:12,代码来源:MemberController.php

示例7: show

 /**
  * Display the specified resource.
  *
  * @param  int $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $member = Member::with('contacts', 'projects', 'sector')->find($id);
     return view('members.show', compact('member'));
 }
开发者ID:bikundo,项目名称:members,代码行数:11,代码来源:MembersController.php

示例8: index

 public function index()
 {
     return view('committee/table', ['membersJson' => Member::with('college', 'course', 'scholarship')->get()->map(function ($member) {
         return $member->setAllVisible();
     })->toJson()]);
 }
开发者ID:CUMSA,项目名称:members,代码行数:6,代码来源:MemberController.php

示例9: function

|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/home', function () {
    return view('welcome');
});
Route::get('/', function () {
    return view('welcome');
});
Route::get('/members/frontend', function () {
    //    Approved()->
    $members = \App\Member::with('sector')->approved()->get();
    return view('members.frontend', compact('members'));
});
Route::get('/thanks', ['as' => 'thank.you', function () {
    return view('members.thanks');
}]);
Route::group(['middleware' => 'auth'], function () {
    Route::get('members/create', ['uses' => 'MembersController@Create', 'as' => 'members.create']);
    Route::get('members/links/{id}', ['uses' => 'MembersController@AddLinks', 'as' => 'members.links']);
    Route::get('members/projects/{id}', ['uses' => 'MembersController@AddProjects', 'as' => 'members.projects']);
    Route::post('members/links/{id}', ['uses' => 'MembersController@SaveLinks', 'as' => 'members.links.save']);
    Route::post('member/project/{id}/save', ['uses' => 'MembersController@SaveProject', 'as' => 'members.project.save']);
    Route::post('members', ['uses' => 'MembersController@store', 'as' => 'members.save']);
    Route::get('members/', ['uses' => 'MembersController@index', 'as' => 'members.view']);
    Route::get('members/approve/{id}', ['uses' => 'MembersController@approve', 'as' => 'members.approve']);
});
开发者ID:bikundo,项目名称:members,代码行数:31,代码来源:routes.php

示例10: show

 public function show()
 {
     return view('directory/table', ['membersJson' => Member::with('college', 'course')->get()->toJson()]);
 }
开发者ID:CUMSA,项目名称:members,代码行数:4,代码来源:DirectoryController.php


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