<?php require_once 'db_init.php'; require_once 'auth.php'; if (isset($_REQUEST['id'])) { $feed = Feed::find('id', $_REQUEST['id']); if ($feed !== NULL) { $user->addFeed($feed); echo $feed->id; } }
/** * save feed changes * @return array */ public function postSave() { User::onlyHas('feed-edit'); $id = Input::get('id'); $general = Input::get('general'); $feed = Feed::find($id); if ($feed) { $feed->name = $general['name']; $feed->enabled = isset($general['enabled']) ? 1 : 0; $feed->limit_type = $general['limit_type']; $feed->limit_value = $general['limit_value']; $feed->order_type = $general['order_type']; $feed->order_by = $general['order_by']; $feed->save(); Log::info("Edit feed #{$id}"); } else { throw new Exception("Undefined Feed #{$id} DATA: " . serialize($general)); } return array(); }
/** * Show the form for editing the specified resource. * * @param int $id * @return \Illuminate\Http\Response */ public function edit($id) { $feed = Feed::find($id); return view('feeds.edit', compact('feed')); }