<?php

    class EntryController extends Controller
    {
        /**
         * Display the specified resource.
         *
         * @param  int $id
         * @return Response
         */
        public function show($id)
        {
            $query = Entry::full()
                ->select('id', 'language_id', 'title')
                ->with(['blocks' => function ($query) {
                    $query->full()
                        ->select('blocks.id','blocks.type')
                        ->orderBy('block_entry.position', 'asc');
                }])
                ->where('lang_slug', $id)
                ->first();

            return Response::json($query);
        }
    }
