/**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id)
 {
     if ($this->checkProjectOwner($id) == false) {
         return ['error' => 'Access Forbidden'];
     }
     return $this->service->update($request->all(), $id);
 }
Пример #2
0
 /**
  * @covers Nash\Client\Services\ClienteService::update
  * @param \Nash\Client\Models\Cliente $cliente
  * @depends testRead
  */
 public function testUpdate(Cliente $cliente)
 {
     $cliente->setNomeFantasia("Test Update!");
     $cliente->setRetencaoISS(RetencaoISS::Retem);
     $cliente->setComplemento("complemento...");
     $cliente->setInscricaoMunicipal("1234567");
     $result = $this->object->update($cliente);
     $this->assertEquals(Result::SUCCESS, $result->getStatus());
     $this->assertNotNull($result->getModel());
     $this->assertEquals($cliente->getId(), $result->getModel()->Id);
     $result = $this->object->read($cliente->getId());
     $this->assertEquals(Result::SUCCESS, $result->getStatus());
     $this->assertNotNull($result->getModel());
     $this->assertInstanceOf("Cliente", $result->getModel());
     $this->assertEquals($cliente->getId(), $result->getModel()->getId());
     $this->assertEquals("Test Update!", $result->getModel()->getNomeFantasia());
     $this->assertEquals(RetencaoISS::Retem, $result->getModel()->getRetencaoISS());
     $this->assertEquals("complemento...", $result->getModel()->getComplemento());
     $this->assertEquals("1234567", $result->getModel()->getInscricaoMunicipal());
 }
 /**
  * Update the specified resource in storage.
  *
  * @param  \Illuminate\Http\Request  $request
  * @param  int  $id
  * @return \Illuminate\Http\Response
  */
 public function update(Request $request, $id, $noteId)
 {
     return $this->service->update($request->all(), $noteId);
 }