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


PHP Project::all方法代码示例

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


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

示例1: mapme

 public static function mapme($objtype)
 {
     if ($objtype == "organisation") {
         $objs = Organisation::all();
     } else {
         $objs = Project::all();
     }
     if (count($objs)) {
         foreach ($objs as $obj) {
             $dum[0] = $obj->{$objtype};
             $dum[1] = $obj->latitude;
             $dum[2] = $obj->longitude;
             $dum[3] = url('/') . "/" . $objtype . "s/" . $obj->id;
             if ($objtype == "project") {
                 $dum[4] = url('/') . "/public/images/project.png";
             } else {
                 $dum[4] = url('/') . "/public/images/" . $obj->organisationtype . ".png";
             }
             $dum[5] = $obj->description;
             $fin[] = $dum;
         }
         return json_encode($fin);
     } else {
         return "No data";
     }
 }
开发者ID:bishopm,项目名称:ncc,代码行数:26,代码来源:Helpers.php

示例2: dashboard

 public function dashboard(Request $request)
 {
     //$settings = $request->session()->get('redbooth');
     ///$redbooth = Redbooth::instance($settings);
     $projects = Project::all();
     return view('admin.pages.dashboard', ['projects' => $projects]);
 }
开发者ID:ilbesculpi,项目名称:flaming,代码行数:7,代码来源:HomeController.php

示例3: index

 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index(Request $request)
 {
     $projects = Project::all()->sortByDesc('created_at');
     $categories = Category::all()->sortBy('name');
     //$user = JWTAuth::toUser(JWTAuth::getToken());
     $user = Auth::User();
     //dd($request->all());
     dd($user);
 }
开发者ID:alexjoverm,项目名称:Portfolio,代码行数:14,代码来源:DashboardController.php

示例4: show

 /**
  * Display the specified resource.
  *
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function show($id)
 {
     $data['tag'] = Tag::find($id);
     $projects = Project::all();
     foreach ($projects as $project) {
         if (in_array($id, explode(',', $project->tags))) {
             $data['projects'][] = $project;
         }
     }
     return view('tags.show', $data);
 }
开发者ID:bishopm,项目名称:ncc,代码行数:17,代码来源:TagsController.php

示例5: projectsForSelect

 public function projectsForSelect()
 {
     $projecs = [];
     $collection = Project::all();
     $i = 0;
     foreach ($collection as $value) {
         $projects[$i]['id'] = $value->id;
         $projects[$i]['text'] = $value->name;
         $i++;
     }
     return $projects;
 }
开发者ID:ronal2do,项目名称:dave_brubeck,代码行数:12,代码来源:ProjectRepository.php

示例6: all

 public function all($type = Null, $criteria = Null)
 {
     switch ($type) {
         case "project":
             if ($criteria != Null) {
                 $lists = \App\Models\Project::where('status', $criteria)->count();
             } else {
                 $lists = \App\Models\Project::all()->count();
             }
             break;
         case "user":
             $lists = \App\User::all()->count();
             break;
         case "category":
             $lists = \App\Models\Category::all()->count();
             break;
         case "genre":
             $lists = \App\Models\Genre::all()->count();
             break;
         default:
             $lists = 0;
     }
     return $lists;
 }
开发者ID:udayc,项目名称:travel,代码行数:24,代码来源:DashboardRepository.php

示例7: all

 public function all()
 {
     return Project::all();
 }
开发者ID:arisro,项目名称:upstream-tracker-tracker,代码行数:4,代码来源:EloquentProjectRepository.php

示例8: create

 public function create()
 {
     parent::create();
     $projects = Project::all()->lists('name', 'id');
     $this->setViewData(compact('projects'));
 }
开发者ID:NukaCode,项目名称:Miranda,代码行数:6,代码来源:IssueController.php

示例9: all

 /**
  * Get all projects
  *
  * @return Json Response
  */
 public function all()
 {
     $projects = Project::all();
     return response()->json($projects);
 }
开发者ID:continuous-deployment,项目名称:pipes,代码行数:10,代码来源:ProjectController.php

示例10: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $projects = Project::all();
     return view('projects.index', compact('projects'));
 }
开发者ID:Tarvald,项目名称:l5FirstSteps,代码行数:10,代码来源:ProjectsController.php


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