php - Laravel 4.2 REST Controller returns 'Class Not Loaded' along with response

214

I'm making a REST call to an API I have set up in Laravel 4.2. This is a GET call, and the URL of the call is /api/v1/setup

My Route setup in Laravel is:

Route::group(array('prefix' => 'api/v1', 'after' => 'allowOrigin'), function() {
    Route::resource('setup', 'SetupController', array('only' => array('index')));
});

I have SetupController.php in the app folder, and the code looks like this:

class SetupController extends \BaseController {

    public function index()
    {
        $code       = 200;
        $response   = array(
            'landing_page_id'       => 309,
            'landing_page_version'  => 1,
            'unit_cost'             => 18,
            'content'               => 'Headline Goes Here'
        );

        return Response::json($response, $code);
    }
}

But when I call this resource via Postman, or even via the page itself, I get the following response every time:

Class not loaded: SetupController{"landing_page_id":309,"landing_page_version":1,"unit_cost":18,"content":"Headline Goes Here"}

So it is apparently executing the code and returning the values, but prefacing it with 'Class Not Loaded: SetupController.'

Any thoughts? I've looked all over and have not found any reference to this 'Class Not Loaded' message being returned anywhere.

People are also looking for solutions to the problem: php - chunk_split() corrupts multibyte characters

Source

Didn't find the answer?

Our community is visited by hundreds of web development professionals every day. Ask your question and get a quick answer for free.

Ask a Question

Write quick answer

Do you know the answer to this question? Write a quick response to it. With your help, we will make our community stronger.

Similar questions

Find the answer in similar questions on our website.