You should add a name space first - like this:
file: application/libraries/extended/response.php
<?php namespace Extended;
class Response extends \Laravel\Response {
public static function json($data, $status = 200, $headers = array(), $json_options = 0)
{
$headers['Content-Type'] = 'application/json; charset=utf-8';
if(isset($data['error']))
{
$status = 400;
}
dd($data);
return new static(json_encode($data, $json_options), $status, $headers);
}
public static function my_test()
{
return var_dump('expression');
}
}
Then inside config/application.php you need to change the alias
'Response' => 'Extended\\Response',
Then in start.php
Autoloader::map(array(
'Extended\\Response' => APP_PATH.'libraries/extended/response.php',
));