Created
June 30, 2019 05:59
-
-
Save sadam1807/a63ce9524b17542c95d49b45a45215e3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers\API; | |
use Illuminate\Http\Request; | |
use App\Http\Controllers\Controller as Controller; | |
use Illuminate\Support\Facades\Auth; | |
use App\User; | |
class ResponseController extends Controller | |
{ | |
public function sendResponse($response) | |
{ | |
return response()->json($response, 200); | |
} | |
public function sendError($error, $code = 404) | |
{ | |
$response = [ | |
'error' => $error, | |
]; | |
return response()->json($response, $code); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment