本文整理汇总了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";
}
}
示例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]);
}
示例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);
}
示例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);
}
示例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;
}
示例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;
}
示例7: all
public function all()
{
return Project::all();
}
示例8: create
public function create()
{
parent::create();
$projects = Project::all()->lists('name', 'id');
$this->setViewData(compact('projects'));
}
示例9: all
/**
* Get all projects
*
* @return Json Response
*/
public function all()
{
$projects = Project::all();
return response()->json($projects);
}
示例10: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$projects = Project::all();
return view('projects.index', compact('projects'));
}