1. Go to this page and download the library: Download devianl2/tenant-support library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
devianl2 / tenant-support example snippets
sh
php artisan vendor:publish --provider="Tenant\Auth\TenantSupportProvider"
sh
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(600)->by(optional($request->user())->id ?: $request->ip());
});
}
sh
public function successResponse($data, $statusCode = Response::HTTP_OK)
{
return response($data, $statusCode)->header('Content-Type', 'application/json');
}
public function errorResponse($errorMessage, $statusCode)
{
return response()->json(['error' => $errorMessage, 'error_code' => $statusCode], $statusCode);
}
public function errorMessage($errorMessage, $statusCode)
{
return response($errorMessage, $statusCode)->header('Content-Type', 'application/json');
}