• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP app\Project类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: showDashboard

 public function showDashboard()
 {
     $projects = new Project();
     $projectCount = $projects->count();
     $published = $projects->where('published', 1)->count();
     $unpublished = $projects->where('published', 0)->count();
     $illustrations = Illustration::count();
     $logos = Logo::count();
     return view('dashboard/dashboard', compact('projectCount', 'published', 'unpublished', 'illustrations', 'logos'));
 }
开发者ID:harequ,项目名称:redesign-laravel,代码行数:10,代码来源:DashboardController.php


示例17: saveImage

 private function saveImage(Project $project, ProjectRequest $request)
 {
     if ($request->file('image')) {
         $imageName = $project->id . '.' . $request->file('image')->getClientOriginalExtension();
         $newExt = 'images/catalog/projects' . $imageName;
         $img = Image::make($request->file('image'))->orientate()->heighten(300);
         $img->save(public_path($newExt));
         $project->image_url = $newExt;
         $project->save();
     }
 }
开发者ID:kennethsinder,项目名称:code-in-motion,代码行数:11,代码来源:ProjectsController.php


示例18: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(ProjectStoreRequest $request)
 {
     $project = new Project();
     $project->name = $request->input('name');
     $project->uid = str_random(12);
     $project->owner_id = Auth::user()->id;
     if ($project->save()) {
         Notification::success(trans('messages.project.created'));
         return redirect()->route('projects.show', $project->uid);
     }
     Notification::error(trans('messages.project.createFailed'));
     return back()->withInput();
 }
开发者ID:hewerthomn,项目名称:user-stories,代码行数:19,代码来源:ProjectsController.php


示例19: postStar

 /**
  * User stars/un-stars a project (POST)
  *
  * @param Project $project
  * @return array JSON response
  */
 public function postStar(Project $project)
 {
     $response = array();
     $response['project'] = $project->toArray();
     if (!in_array(Auth::user()->id, $project->users()->lists('id')->toArray())) {
         Auth::user()->projects()->attach($project->id);
         $response['message'] = "成功收藏&nbsp;<span>" . $project->title . "</span>";
     } else {
         Auth::user()->projects()->detach($project->id);
         $response['message'] = "已取消收藏&nbsp;<span>" . $project->title . "</span>";
     }
     return $response;
 }
开发者ID:CaliCastle,项目名称:AbletiveVIPWebsite,代码行数:19,代码来源:ProjectController.php


示例20: destroy

 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $project = Project::findOrFail($id);
     $project->delete();
     flash('Your Project Was Deleted Successfully');
     return redirect()->back();
 }
开发者ID:agoiabel,项目名称:ocupidconcept,代码行数:13,代码来源:UploadRecentProjectController.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP app\Question类代码示例发布时间:2022-05-23
下一篇:
PHP app\Profile类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap