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


PHP Project::update方法代码示例

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


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

示例1: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \App\Project $project
  * @return Response
  */
 public function update(Project $project, Request $request)
 {
     $this->validate($request, $this->rules);
     $input = array_except(Input::all(), '_method');
     $project->update($input);
     return Redirect::route('projects.show', $project->slug)->with('message', 'Project updated.');
 }
开发者ID:xMarkusSpringerx,项目名称:simple-todo-app,代码行数:13,代码来源:ProjectsController.php

示例2: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  Project $project
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Project $project)
 {
     $input = array_except(Input::all(), '_method');
     $project->update($input);
     Session::flash('flash_message', 'Project updated successfully!');
     return Redirect::route('projects.index')->with('message', 'Project created');
 }
开发者ID:stoic1979,项目名称:laravel_project,代码行数:14,代码来源:ProjectsController.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  int  Project $project
  * @return Response
  */
 public function update(Request $request, Project $project)
 {
     //
     $input = array_except(Input::all(), '_method');
     $project->update($input);
     return Redirect::route('projects.show', $project->slug)->with('message', 'Project updated.');
 }
开发者ID:vaiolis,项目名称:Laravel-todo-tutorial,代码行数:14,代码来源:ProjectsController.php

示例4: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Project $project, ProjectRequest $request)
 {
     //
     $input = $request->all();
     $project->update($input);
     return redirect('proyectos');
 }
开发者ID:AmilcarCondino,项目名称:circulo,代码行数:14,代码来源:ProjectsController.php

示例5: 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

示例6: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, Project $project)
 {
     $this->validate($request, $this->rules);
     $input = $request->except('_method');
     $input['slug'] = str_slug($request->name, '-');
     $project->update($input);
     return Redirect::route('projects.show', $project->slug)->with('message', 'Project updated.');
 }
开发者ID:GeoffSelby,项目名称:Launchpad-Mini,代码行数:15,代码来源:ProjectsController.php

示例7: testUpdateProjectName

 /**
  * @depends testCreateEmptyProject
  * @param Project $project
  */
 function testUpdateProjectName(Project $project)
 {
     $this->_userLoginIn();
     $old_name = $project->name;
     $project->update(['name' => "New project name"]);
     $this->assertNotEquals($old_name, $project->name);
     $this->assertEquals(1, $project->activity()->get()->count());
 }
开发者ID:absolux,项目名称:Collabor8-php-api,代码行数:12,代码来源:ProjectTest.php

示例8: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \App\Project $project
  * @return Response
  */
 public function update(Project $project, Request $request)
 {
     // Validate the request before continuing...
     $this->validate($request, $this->rules);
     $input = array_except(Input::all(), array('_method', 'slug'));
     $project->update($input);
     return Redirect::route('projects.show', $project->slug)->with('message', 'Project updated.');
 }
开发者ID:TimothyDJones,项目名称:laravel5-test,代码行数:14,代码来源:ProjectsController.php

示例9: saveProject

 /**
  * Save a project from a POST request
  *
  * @param Project $project
  * @param Request $request
  * @return \Illuminate\Http\RedirectResponse
  */
 public function saveProject(Project $project, Request $request)
 {
     $params = $this->filterRequest($request);
     if ($project->update($params)) {
         return redirect()->back()->with('status', '工程已更新!');
     } else {
         return redirect()->back()->with('status', '工程更新出错!');
     }
 }
开发者ID:CaliCastle,项目名称:AbletiveVIPWebsite,代码行数:16,代码来源:ManageController.php

示例10: update

 /**
  * Update the specified resource in storage.
  *
  * @param  \App\Project $project
  * @return Response
  */
 public function update(Project $project, Request $request)
 {
     $validator = Validator::make($request->all(), ['name' => 'required|min:3|max:255', 'slug' => 'required|min:3|max:255']);
     if ($validator->fails()) {
         return redirect()->back()->withInput()->withErrors($validator);
     }
     //
     $input = array_except(Input::all(), '_method');
     $project->update($input);
     return Redirect::route('projects.show', $project->slug)->with('message', 'Success: Your Project updated.');
 }
开发者ID:ikram2001,项目名称:laravel-5.1-basic-app,代码行数:17,代码来源:ProjectsController.php

示例11: patchEditProject

 /**
  * Approve the project, whilst updating any changes the Administrator has made.
  *
  * @param AdminEditProjectRequest $request
  * @param Project $project
  * @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
  */
 public function patchEditProject(AdminEditProjectRequest $request, Project $project)
 {
     $originalChildName = $project->child_name;
     $originalSlug = $project->slug;
     // Update the Project, if the Admin has altered the content.
     $project->update($request->all());
     // Update the slug, if altered.
     $project->slug = strtolower(preg_replace('/[\\s-]+/', '-', $request->get('project_name')));
     // Approve the project, and make it live.
     $project->approved = '1';
     $project->live = '1';
     // Set the time for project to end.
     $date = Carbon::now();
     $date->day = $date->day + 60;
     $project->completed_on = $date->toDateString();
     $project->save();
     // If the Administrator renames the project, we need new directories.
     $this->makeDocumentDirectory(public_path('documents/' . $project->slug));
     $this->makeImageDirectories(public_path('img/' . $project->slug));
     // In the instance the Administrator amends the child's name, project name, or both
     // Rename and move the project's images, move the project's documents.
     if ($project->child_name != $originalChildName || $project->slug != $originalSlug) {
         for ($i = 0; $i < count($project->images); $i++) {
             $extension = explode('.', $project->images[$i]->filename);
             $extension = $extension[count($extension) - 1];
             $filename = strtolower(preg_replace('/[\\s]+/', '_', $project->child_name)) . ($i + 1) . '.' . $extension;
             $orginalDirectory = public_path('img/' . $originalSlug);
             $newDirectory = public_path('img/' . $project->slug);
             // Small image.
             $image = file_get_contents($orginalDirectory . '/small/' . $project->images[$i]->filename);
             file_put_contents($newDirectory . '/small/' . $filename, $image);
             // Medium image.
             $image = file_get_contents($orginalDirectory . '/medium/' . $project->images[$i]->filename);
             file_put_contents($newDirectory . '/medium/' . $filename, $image);
             // Large image.
             $image = file_get_contents($orginalDirectory . '/large/' . $project->images[$i]->filename);
             file_put_contents($newDirectory . '/large/' . $filename, $image);
             // Update the Image Model.
             $project->images[$i]->filename = $filename;
             $project->images[$i]->save();
         }
         // Move the documents.
         foreach ($project->documents as $document) {
             $file = file_get_contents(public_path('documents/' . $originalSlug . '/' . $document->filename));
             file_put_contents(public_path('documents/' . $project->slug . '/' . $document->filename), $file);
         }
     }
     // Redirect to Admin panel.
     Session::flash('flash_message', trans('adminpanel.approved-message'));
     return redirect('admin');
 }
开发者ID:andreikainer,项目名称:kuj_abol,代码行数:58,代码来源:AdminController.php

示例12: update

 /**
  * Update the specified resource in storage.
  *
  * @param  ProjectRequest  $request
  * @param  Project  $project
  * @return \Illuminate\Http\Response
  */
 public function update(ProjectRequest $request, Project $project)
 {
     $project->update($request->all());
     $project->save();
     return redirect()->route('project.show', [$project]);
 }
开发者ID:AmilcarCondino,项目名称:Circulo_v2,代码行数:13,代码来源:ProjectController.php

示例13: update

 /**
  * Update the specified resource in storage.
  *
  * @param  Request  $request
  * @param  Project  $project
  * @return Response
  */
 public function update(Request $request, Project $project)
 {
     $project->update($request->all());
     return $this->show($project);
 }
开发者ID:absolux,项目名称:Collabor8-php-api,代码行数:12,代码来源:ProjectsController.php

示例14: store

 /**
  * Store a newly created resource in storage.
  *
  * @param  Request  $request
  * @return Response
  */
 public function store(Request $request)
 {
     //
     $rules = array('projectNum' => 'required', 'create_at' => 'required', 'pjsales' => 'required', 'pjContacter' => 'required', 'pjContacterPhone' => 'required', 'pjContacterEmail' => 'email|required', 'cmCode' => 'required', 'cmShort' => 'required', 'e_shortName' => 'required', 'customer_id' => 'required', 'c_name' => 'required', 'institute' => 'required', 'department' => 'required', 'email' => 'email|required', 'contacter' => 'required', 'contacterPhone' => 'required', 'contacterEmail' => 'email|required', 'address' => 'required', 'sales' => 'required', 'PJclass' => 'required', 'PJservice' => 'required', 'PJspecies' => 'required');
     $validator = Validator::make($request->all(), $rules);
     if ($validator->fails()) {
         return back()->withErrors($validator)->withInput();
     }
     $customer_id = $request->get('customer_id');
     if ($customer_id == 0) {
         $customer = new Customer(array('cmCode' => $request->get('cmCode'), 'cmShort' => $request->get('cmShort'), 'c_name' => $request->get('c_name'), 'e_shortName' => $request->get('e_shortName'), 'institute' => $request->get('institute'), 'department' => $request->get('department'), 'fax' => $request->get('fax'), 'phone' => $request->get('phone'), 'email' => $request->get('email'), 'contacter' => $request->get('contacter'), 'contacterPhone' => $request->get('contacterPhone'), 'contacterEmail' => $request->get('contacterEmail'), 'address' => $request->get('address'), 'salesman' => $request->get('sales')));
         $salesman = User::findOrFail($request->get('sales'));
         $customer->salesman()->associate($salesman);
         $customer->save();
         $last = DB::table('customers')->orderBy('created_at', 'desc')->first();
         $customer_id = $last->id;
     } else {
         $customer = Customer::findOrFail($customer_id);
         $customer->update(['cmCode' => $request->get('cmCode'), 'cmShort' => $request->get('cmShort'), 'c_name' => $request->get('c_name'), 'e_shortName' => $request->get('e_shortName'), 'institute' => $request->get('institute'), 'department' => $request->get('department'), 'fax' => $request->get('fax'), 'phone' => $request->get('phone'), 'email' => $request->get('email'), 'contacter' => $request->get('contacter'), 'contacterPhone' => $request->get('contacterPhone'), 'contacterEmail' => $request->get('contacterEmail'), 'address' => $request->get('address')]);
         $salesman = User::findOrFail($request->get('sales'));
         $customer->salesman()->associate($salesman);
         $customer->save();
     }
     if ($request->get('PJservice') == 'Others') {
         $PJservice = $request->get('PJserviceNote');
     } else {
         $PJservice = $request->get('PJservice');
     }
     $project = new Project(array('projectNum' => $request->get('projectNum'), 'PJtype' => $request->get('PJtype'), 'PJclass' => $request->get('PJclass'), 'PJservice' => $PJservice, 'PJspecies' => $request->get('PJspecies'), 'note' => $request->get('note'), 'contacter' => $request->get('contacter'), 'contacterPhone' => $request->get('contacterPhone'), 'contacterEmail' => $request->get('contacterEmail'), 'status' => '新建'));
     $user = \Auth::user();
     $project->user()->associate($user);
     $customer = Customer::findOrFail($customer_id);
     $project->customer()->associate($customer);
     $pjsalesman = User::findOrFail($request->get('pjsales'));
     $project->salesman = $pjsalesman->id;
     $project->save();
     if (empty($request->file('file'))) {
         $fileName = null;
     } else {
         $fileName = $project->id . '.' . $request->file('file')->getClientOriginalExtension();
         $request->file('file')->move(base_path() . '/storeFiles/ngs/quotation/', $fileName);
     }
     $project->update(['fileName' => $fileName]);
     return \Redirect::to('research/ngs/projects/index')->with('message', 'Your Project has been created!');
 }
开发者ID:a5526000,项目名称:LIMS,代码行数:51,代码来源:ProjectController.php

示例15: update

 public function update(Project $project, ProjectRequest $request)
 {
     $project->update(['id' => $request->get('id'), 'name' => $request->get('name'), 'excerpt' => $request->get('excerpt'), 'description' => $request->get('description'), 'github' => $this->convertToAbsoluteUrl($request->get('github')), 'date_created' => $request->get('date_created'), 'important' => $request->get('important') ? true : false]);
     $this->saveImage($project, $request);
     return redirect("projects/{$project->id}");
 }
开发者ID:kennethsinder,项目名称:code-in-motion,代码行数:6,代码来源:ProjectsController.php


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