public function post_getbank() { $data = Input::all(); $ccBin = substr($data['cc'], 0, 6); $Information = Binlist::with('getBankInformation')->where('bin', '=', $ccBin)->first(); return Response::eloquent($Information); }
/** * Return a specific tag by ID. * * @param mixed $id The ID. * * @access public * * @return mixed Value. */ public function get_show($id) { $tag = Slendertag::find($id); if ($tag !== null) { return Response::eloquent($tag); } else { return Response::json(array('error' => 'The tag with an ID of ' . $id . ' could not be found.')); } }
public function delete_index($id = null) { $todo = Todo::find($id); if ($todo->user_id != Auth::user()->id) { return Response::json('You are not the owner of this todo', 404); } if (is_null($todo)) { return Response::json('Todo not found', 404); } $deletedtodo = $todo; $todo->delete(); return Response::eloquent($deletedtodo); }
public function post_setAddress() { $data = Input::all(); //get user cart cache $Cart = Cache::get("user_cart." . Sentry::user()->id); switch ($data['type']) { case 'delivery': $Cart['Addresses']['delivery'] = $data['addrID']; break; case 'billing': $Cart['Addresses']['billing'] = $data['addrID']; break; } Cache::forever("user_cart." . Sentry::user()->id, $Cart); $AddressInfo = Address::with(array('getCity', 'getTown'))->where('id', '=', $data['addrID'])->first(); return Response::eloquent($AddressInfo); }
$u->save(); return Redirect::to('/'); } else { return Redirect::to('change-password')->with('message', 'Original Password does not match'); } } }); Route::get('subscriptions', function () { Asset::add('subs', 'js/subscriptions.js'); return View::make('subscriptions.list'); }); Route::get('subscriptions/find/(:any)', function ($uuid) { return Response::eloquent(SubscriptionHistory::where('uuid', '=', $uuid)->order_by('activity_date', 'asc')->get()); }); Route::get('notifications/(:any)', function ($id) { return Response::eloquent(RawNotification::find($id)); }); Route::get('/', function () { //get stats $today = date('Y-m-d'); $thisweeknum = date('W'); $thismonthstart = date('Y-m-01'); $thismonthend = date('Y-m-t'); //find the start of week $wkday = date('l'); switch ($wkday) { case 'Monday': $numDaysToMon = 0; break; case 'Tuesday': $numDaysToMon = 1;
public function post_productAttribute() { $data = Input::all(); // $attrsTop = AttributeGroup::with(array('getTopGroup','getAttributes'))->where('id','=',$data['id'])->first(); $result = Category::with(array("getAttributeListing", "getAttributeListing.getTopGroup"))->where('id', '=', $data['id'])->first(); $topGroups = array(); foreach ($result->getAttributeListing as $item) { array_push($topGroups, $item->getTopGroup->id); } $topGroups = array_unique($topGroups); $belongedGroups = array(); foreach ($result->getAttributeListing as $item) { array_push($belongedGroups, $item->id); } $belongedGroups = array_unique($belongedGroups); /*Now we held only top groups($tmp) and Attributes groups($belongedGroups) only related to a category*/ $attrs = AttributeGroup::with(array('getParentGroup' => function ($query) use($belongedGroups) { $query->order_by('sort_order', 'ASC'); $query->where_in('id', $belongedGroups); }, 'getParentGroup.getAttributes'))->where_in('id', $topGroups)->get(); return Response::eloquent($attrs); }
public function post_user_town() { $data = Input::all(); $towns = Town::where('city_id', '=', $data['id'])->get(); return Response::eloquent($towns); }