Skip to content

Instantly share code, notes, and snippets.

@coreymcmahon
Created March 25, 2014 03:03
Show Gist options
  • Save coreymcmahon/9754521 to your computer and use it in GitHub Desktop.
Save coreymcmahon/9754521 to your computer and use it in GitHub Desktop.
Using the custom response facade - www.slashnode.com
<?php namespace Acme\Controllers;
use Acme\Repositories\UserRepositoryInterface as UserRepository;
class UsersController extends \BaseController
{
protected $userRepository;
public function __construct(UserRepository $userRepository)
{
$this->userRepository = $userRepository;
}
public function getUsers()
{
$users = $this->userRepository->all();
return \Response::csv($users);
}
// etc...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment