當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。