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


PHP app\Project类代码示例

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


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

示例1: destroy

 public function destroy(Project $project)
 {
     if (!$project->hasOne(Todo::class)->exists()) {
         $project->delete();
     }
     return redirect('/projects');
 }
开发者ID:NeoCortexBg,项目名称:laravel-todo,代码行数:7,代码来源:ProjectController.php

示例2: store

 public function store(Request $request)
 {
     $user = Auth::user();
     $user_id = $user['id'];
     $directory = "images/" . $user["username"] . "/";
     if ($request->image) {
         $file = $request->image;
         $file->move($directory, $file->getClientOriginalName());
     }
     $project = new Project();
     $project->type = $request->type;
     $project->title = $request->title;
     $project->user_id = $user_id;
     if ($request->image) {
         $project->image = $directory . $file->getClientOriginalName();
     }
     $project->size_width = $request->size_width;
     $project->size_length = $request->size_length;
     $project->measurement = $request->measurement;
     $project->location = $request->location;
     $project->status = $request->status;
     $project->story = $request->story;
     $project->save();
     return redirect()->route('showroom')->with('info', 'Your project has been showcased!');
 }
开发者ID:bambangsusanto,项目名称:planatrium,代码行数:25,代码来源:ShowcaseController.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(ProjectUpdateRequest $request, $id)
 {
     $project = new Project($request->all());
     Project::where('id', $id)->update($project->getAttributes());
     flash()->success(trans('project.label.name'), trans('project.message_alert.update_success'));
     return redirect('/projects');
 }
开发者ID:vasitjuntong,项目名称:mixed,代码行数:14,代码来源:ProjectController.php

示例4: update

 public function update(Project $project, ProjectRequest $request)
 {
     //Client $client refrences a Route Model Binding method found is RouteServiceProvider.php
     $project->update($request->all());
     \Session::flash('flash_message', 'Project ' . $project->project_name . ' was updated.');
     return redirect('projects');
 }
开发者ID:patrykszady,项目名称:gstest,代码行数:7,代码来源:HoursController.php

示例5: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update(Project $project, User $user, Request $request)
 {
     $this->validate($request, ['type' => 'in:owner,developer,client', 'user_id' => 'exists:users_projects']);
     $data = ['type' => $request->get('type')];
     $project->users()->updateExistingPivot($user->id, $data);
     return response()->json(['success' => true, 'message' => 'Project Member updated.']);
 }
开发者ID:bluecipherz,项目名称:bczapi,代码行数:13,代码来源:UserController.php

示例6: boot

 /**
  * Define your route model bindings, pattern filters, etc.
  *
  * @param  \Illuminate\Routing\Router  $router
  * @return void
  */
 public function boot(Router $router)
 {
     $router->bind('article', function ($value) {
         return $this->getArticle()->where('slug', $value)->firstOrFail();
     });
     $router->bind('cong-ty', function ($value) {
         return \App\Company::where('slug', $value)->firstOrFail();
     });
     $router->bind('thiet-ke-thi-cong', function ($value) {
         return $this->designModel->getDesigns()->where('designs.slug', $value)->firstOrFail();
     });
     $router->bind('house', function ($value) {
         return $this->houseModel->getHouses()->where('houses.slug', $value)->firstOrFail();
     });
     $router->bind('company', function ($value) {
         return \App\Company::where('slug', $value)->firstOrFail();
     });
     $router->bind('project', function ($value) {
         return $this->projectModel->getProjects()->where('projects.slug', $value)->firstOrFail();
     });
     $router->model('owner', 'App\\House');
     $router->model('agency', 'App\\House');
     $router->model('message', 'App\\Message');
     parent::boot($router);
 }
开发者ID:khanhpnk,项目名称:sbds,代码行数:31,代码来源:RouteServiceProvider.php

示例7: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Project $project, Request $request)
 {
     $user = JWTAuth::parseToken()->authenticate();
     $backlog = Backlog::create($request->only('name'));
     $project->backlogs()->save($backlog);
     $user->backlogs()->save($backlog);
     return response()->json(['status' => 'success', 'backlog' => $backlog]);
 }
开发者ID:bluecipherz,项目名称:bczapi,代码行数:13,代码来源:BacklogController.php

示例8: show

 /**
  * @param Project $project
  * @return \Illuminate\View\View
  */
 public function show(Project $project)
 {
     $projectsRelation = $this->projectModel->getProjects()->limit(6)->get();
     $contactInfo = User::join('profiles', 'users.id', '=', 'profiles.user_id')->where('user_id', $project->user_id)->first();
     $preview = Project::isApproved(1)->where('id', '<', $project->id)->orderBy('id', 'desc')->first();
     $next = Project::isApproved(1)->where('id', '>', $project->id)->orderBy('id', 'asc')->first();
     return view('front.projects.show', compact('project', 'projectsRelation', 'contactInfo', 'preview', 'next'));
 }
开发者ID:khanhpnk,项目名称:sbds,代码行数:12,代码来源:ProjectController.php

示例9: store

 public function store(Project $project, Request $request)
 {
     $user = JWTAuth::parseToken()->authenticate();
     $story = Story::create($request->only('name'));
     $project->stories()->save($story);
     $user->stories()->save($story);
     return response()->json(['status' => 'success', 'story' => $story, 'message' => 'Story created.']);
 }
开发者ID:bluecipherz,项目名称:bczapi,代码行数:8,代码来源:StoryController.php

示例10: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Project $project, Request $request)
 {
     $user = JWTAuth::parseToken()->authenticate();
     $sprint = App::make('App\\Sprint')->create($request->only('name', 'release'));
     // $sprint = Sprint::create($request->only('name','release'));
     $project->sprints()->save($sprint);
     // $user->sprints()->save($sprint);
     return response()->json(['status' => 'success']);
 }
开发者ID:bluecipherz,项目名称:bczapi,代码行数:14,代码来源:SprintController.php

示例11: store

 function store(ProjectRequest $r)
 {
     $project = new Project($r->only('name', 'description'));
     $project->user_id = $r->user()->id;
     $project->save();
     if (!WalletController::generateAddress($project, true)) {
         return redirect()->back()->withErrors("Sorry. The address pool is low, so we were unable to create your project at this time. Try again in an hour");
     }
     return redirect('/projects/' . $project->id);
 }
开发者ID:Someguy123,项目名称:litecoinpledge,代码行数:10,代码来源:ProjectController.php

示例12: composeSidebar

 /**
  * Hiển thị 10 bài viết mới nhất ở sidebar (layout)
  *
  * @return void
  */
 public function composeSidebar()
 {
     view()->composer('_sidebar', function ($view) {
         // recommend
         $view->with('houseSaleRecommend', $this->houseModel->getHouses()->saleType(SaleTypeOptions::BAN)->first());
         $view->with('houseRentRecommend', $this->houseModel->getHouses()->saleType(SaleTypeOptions::CHO_THUE)->first());
         $view->with('houseProjectRecommend', $this->projectModel->getProjects()->first());
         $view->with('designRecommend', $this->designModel->getDesigns()->first());
     });
 }
开发者ID:khanhpnk,项目名称:sbds,代码行数:15,代码来源:ViewComposerServiceProvider.php

示例13: addNewProject

 public function addNewProject($client_id, Request $request)
 {
     $project = new Project();
     $project->client_id = $client_id;
     $project->user_id = Auth::user()->id;
     $project->name = $request->name;
     $project->desc = $request->desc;
     $project->save();
     return $project;
 }
开发者ID:naughton-and-ross,项目名称:clientapp,代码行数:10,代码来源:APIController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @return Response
  */
 public function store(Project $project, Backlog $backlog, Request $request)
 {
     $user = JWTAuth::parseToken()->authenticate();
     // $sprint = App::make('App\Sprint')->create($request->only('name','release'));
     $sprint = Sprint::create($request->only('name'));
     $project->sprints()->save($sprint);
     $user->sprints()->save($sprint);
     event(new FeedableEvent('SprintCreated', $user, $sprint, $project));
     return response()->json(['status' => 'success', 'Sprint' => $sprint, 'Message' => 'Sprint created.']);
 }
开发者ID:bluecipherz,项目名称:bczapi,代码行数:15,代码来源:SprintController.php

示例15: store

 /**
  * Store a newly created task.
  *
  * @param Request $request
  * @param Project $project
  * @return Task
  */
 public function store(Request $request, Project $project)
 {
     $task = new Task($request->all());
     if (!empty($user_id = $request->input('user_id'))) {
         $user = \App\User::findOrFail($user_id);
         $task->assignee()->associate($user);
     }
     $project->tasks()->save($task);
     return $task;
 }
开发者ID:absolux,项目名称:Collabor8-php-api,代码行数:17,代码来源:TasksController.php


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