本文整理汇总了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'));
}
示例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);
}
示例3: index
public function index()
{
// \Auth::user()->name; //get name of Auth user
$projects = Project::get();
return view('projects.index', compact('projects', 'expenses'));
}
示例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
}
}
示例5: edit
public function edit(Expense $expense)
{
$projects = Project::get();
$subs = Sub::lists('company_name', 'id');
return view('expenses.edit', compact('projects', 'subs', 'expense'));
}