/** * Update the specified resource in storage. * * @param \Illuminate\Http\Request $request * @param int $id * @return \Illuminate\Http\Response */ public function update(User $user, Code $code, Request $request) { $this->validate($request, $this->rules); $input = array_except(Input::all(), '_method'); $code->update($input); $fd = fopen('blah.php', 'w'); fwrite($fd, $input['code']); fclose($fd); return Redirect::to('blah.php'); //return Redirect::route('users.codes.show', [$user->id, $code->id])->with('message', 'Code updated.'); }
/** * Update the specified resource in storage. * * @param \App\Project $project * @param \App\Task $task * @return Response */ public function update(User $user, Code $code) { //$this->validate($user, $this->rules); $input = array_except(Input::all(), '_method'); $position = strstr($input['code'], 'assign'); if ($position == false) { $code->update($input); $myfile = fopen("testfile.php", "w"); fwrite($myfile, $input['code']); fclose($myfile); return Redirect::to("testfile.php"); } else { return Redirect::route('users.codes.edit', [$user->name, $code->id])->with('message', 'Access Denied.Cannot use the term \'assign\''); } }