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


PHP Project::get方法代码示例

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


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

示例1: create

 public function create(Project $project)
 {
     $projects = Project::get();
     //sends an array of  'first_name' => 'id'
     $subs = Sub::where('employee', '=', 1)->lists('first_name', 'id');
     //where 'employee refers to if they're a GS employee..not an ID
     //$clients = Client::lists('first_name', 'id'); //sends an array of  'first_name' => 'id'
     return view('hours.create', compact('projects', 'subs'));
 }
开发者ID:patrykszady,项目名称:gstest,代码行数:9,代码来源:HoursController.php

示例2: index

 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $project = Project::get();
     return $project;
     // return response([ 'error' => false, 'data' => $project], 200);
 }
开发者ID:jasonraimondi,项目名称:angularavel,代码行数:11,代码来源:ProjectsController.php

示例3: index

 public function index()
 {
     // \Auth::user()->name; //get name of Auth user
     $projects = Project::get();
     return view('projects.index', compact('projects', 'expenses'));
 }
开发者ID:patrykszady,项目名称:gstest,代码行数:6,代码来源:ProjectsController.php

示例4: addProjects

 public function addProjects(StoreProjectDetailsRequest $request)
 {
     //Add new project to the database
     $owner = $request->owner;
     $users = User::where("name", $owner)->get();
     //Verifying the user_id of the project owner
     $user_id = $users[0]->id;
     $project_name = $request->project_name;
     $description = $request->description;
     $technologies = $request->technologies;
     $deadline = $request->deadline;
     $project = new Project();
     $project->user_id = $user_id;
     $project->name = $project_name;
     $project->description = $description;
     $project->technologies = $technologies;
     $project->deadline = $deadline;
     $project->save();
     //Save data to the "project" table
     //Display added projects
     $user = Auth::user();
     $type = $user->type;
     $name = $user->name;
     $project = Project::get();
     //Get all the projects from the Projects table
     $reservation = Reservations::where('user', $name)->get();
     //Get reserved projects
     $reserved = array();
     //Create array to store reserved project ids
     foreach ($reservation as $res) {
         array_push($reserved, $res->project_id);
         //Save each reserved project id to the array
     }
     $projectR = Project::whereNotIn('id', $reserved)->get();
     //Get projects which are not reserved
     $volunteer = Volunteers::where('user', $name)->get();
     //Get volunteered projects
     $volunteered = array();
     //Create array to store volunteered project ids
     foreach ($volunteer as $vol) {
         array_push($volunteered, $vol->project_id);
         //Save each volunteered project id to the array
     }
     $projectV = Project::whereNotIn('id', $volunteered)->get();
     //Get projects which are not volunteered
     $finalizedProject = FinalizedProjects::where('user', $name)->get();
     //Get finalized project
     $finalized_pn = "";
     if (sizeof($finalizedProject) != 0) {
         $finalized_pn = $finalizedProject[0]->project_name;
     }
     if ($type == "lecturer") {
         return view('pages.ViewProjectsLecturer', compact('projectV', 'volunteer'));
         //Return the web page to view projects for a lecturer
     } elseif ($type == "student") {
         return view('pages.ViewProjectsStudent', compact('projectR', 'reservation', 'finalized_pn'));
         //Return the web page to view projects for a student
     } elseif ($type == "coordinato") {
         return view('pages.ViewProjects', compact('project'));
         //Return the web page to view projects for the coordinator
     }
 }
开发者ID:npamudika,项目名称:Projex,代码行数:62,代码来源:PageController.php

示例5: edit

 public function edit(Expense $expense)
 {
     $projects = Project::get();
     $subs = Sub::lists('company_name', 'id');
     return view('expenses.edit', compact('projects', 'subs', 'expense'));
 }
开发者ID:patrykszady,项目名称:gstest,代码行数:6,代码来源:ExpensesController.php


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