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


PHP file::where方法代码示例

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


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

示例1: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $users = User::where('id', '!=', Auth::id())->where('priviledge', '!=', 'superuser')->get();
     if (Auth::user()->priviledge != 'superuser') {
         $weights = Vote::where('user_id', '=', Auth::id())->sum('performance');
         $sum = $weights;
     }
     //echo "<pre>";
     //var_dump($users);die;
     foreach ($users as $key => $value) {
         $path[$key] = file::where('user_id', '=', $value['id'])->pluck('path');
         //echo "<pre>";
         //var_dump($path);die;
     }
     return View::make('votes.home', compact(Auth::user()->user_name, 'users', 'sum', 'path'));
 }
开发者ID:shihab-92,项目名称:votting-system,代码行数:21,代码来源:authenticationController.php

示例2: picture_update

 public function picture_update()
 {
     $validator = Validator::make(Input::all(), file::$rules);
     if ($validator->fails()) {
         Session::flash('error', 'uploaded file is not valid');
         return Redirect::back()->withInput()->withErrors($validator->messages());
     }
     $data = file::where('user_id', '=', Auth::user()->id)->pluck('path');
     $file = Input::file('image');
     $extension = $file->getClientOriginalExtension();
     $filename = Auth::user()->id . '.' . $extension;
     $file->move('uploads', $filename);
     $path = '../uploads/' . $filename;
     $picture = new file();
     $picture->user_id = Auth::user()->id;
     $picture->path = $path;
     if ($data == null) {
         $picture->save();
     } else {
         $picture->update();
     }
     return Redirect::back();
 }
开发者ID:shihab-92,项目名称:votting-system,代码行数:23,代码来源:profileController.php


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