public function getDealers($code) { $brand = Brand::whereBrandCode($code)->first(); $dealerIds = $brand->users()->lists('user_id')->toArray(); $users = User::with('profile')->whereIn('id', $dealerIds)->get(); return \Fractal::collection($users, new UserTransformer())->getArray(); }
/** * Adds a new member to the Club */ public function storeMember(Request $request) { $this->setRequestValidator(new \App\Http\Requests\StoreClubMemberRequest()); $this->validateRequest($request); $club = \App\Club::find($request->input('club_id')); $member = \App\User::find($request->input('user_id')); $club->members()->attach($member->id); return \Fractal::collection($club->members, new \App\Transformers\UserTransformer())->getArray(); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $item = \ApiHandler::parseSingle($this->model, $id)->getResult(); return \Fractal::item($item, $this->transformer)->getArray(); }
/** * Display the specified resource. * * @param int $id * @return Response */ public function show($id) { $content = App\Models\Content::with(['type', 'category'])->find($id); return Fractal::item($content, new App\Transformers\ContentTransformer())->responseJson(200); }
<?php include "fractal.class.php"; header("Content-type: image/jpeg"); $f = new Fractal(600, 400); $startAngle = 0; $startLength = 150; $startPointX = 50; $startPointY = $startLength * 2; $levels = $_POST["level"]; $lastPointX = 0; $lastPointY = 0; $f->DrawLevels($startPointX, $startPointY, $startAngle, $startLength, $levels, &$lastPointX, &$lastPointY); $f->GiveImage(); ?>
public function show(Request $request) { $likes = \DB::table('point_likes_view')->select('*')->where('point_id', $request->id)->first(); return \Fractal::item($likes, new PointLikeTransformer())->responseJson(200); }