示例#1
0
文件: Helpers.php 项目: bishopm/ncc
 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
0
 public function dashboard(Request $request)
 {
     //$settings = $request->session()->get('redbooth');
     ///$redbooth = Redbooth::instance($settings);
     $projects = Project::all();
     return view('admin.pages.dashboard', ['projects' => $projects]);
 }
 /**
  * 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
0
 /**
  * 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);
 }
 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
0
 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;
 }
 public function all()
 {
     return Project::all();
 }
示例#8
0
 public function create()
 {
     parent::create();
     $projects = Project::all()->lists('name', 'id');
     $this->setViewData(compact('projects'));
 }
 /**
  * Get all projects
  *
  * @return Json Response
  */
 public function all()
 {
     $projects = Project::all();
     return response()->json($projects);
 }
示例#10
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $projects = Project::all();
     return view('projects.index', compact('projects'));
 }