src/Http/Controllers/DefaultRestController.php
public function index(Request $request, $resource)
    {
        $command = $this->translator->getCommandFromResource($resource, 'index');

        $this->runBeforeCommands($command);

        $data = $this->dispatchFrom($command, $request, [
            'modelClass' => $this->translator->getClassFromResource($resource)
        ]);

        $this->fireEventForResource($resource, 'index', $data);

        return $this->success($data);
    }
public function index(Request $request, $resource)
    {
        $command = $this->translator->getCommandFromResource($resource, 'index');

        $this->runBeforeCommands($command);

        $data = $this->dispatchFrom($command, $request, [
            'modelClass' => $this->translator->getClassFromResource($resource)
        ]);

        $this->fireEventForResource($resource, 'index', $data);

        return $this->success($data);
    }
Display a listing of the resource.

@param  Request $request
@param  string $resource
@return \Response