What do you want to save?
Add Code snippet
New code examples
-
Javascript 2022-01-22 13:26:56
nextjs Access-Control-Allow-Origin
//npm i cors //# or //yarn add cors import Cors from 'cors' // Initializing the cors middleware const cors = Cors({ methods: ['GET', 'HEAD'], }) // Helper method to wait for a middleware to execute before continuing // And to throw an error when an ... Add solution -
PHP 2021-11-09 08:46:18
create custom pagination in laravel 7 for api
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; use Illuminate\Pagination\LengthAwarePaginator; class PaginationController extends Controller { /** ... Add solution -
Other 2021-10-31 12:10:05
custom laravel pagination
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Illuminate\Pagination\Paginator; use Illuminate\Support\Collection; use Illuminate\Pagination\LengthAwarePaginator; class PaginationController extends Controller { /** ... Add solution -
PHP 2021-10-04 11:33:06
laravel Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on
Step 1 : Create Cors middleware. php artisan make:middleware Cors Step 2 : Add below lines in handle function before return. //header('Access-Control-Allow-Origin: *'); header('Access-Control-Allow-Origin: http://localhost:4200'); header('Access-Cont... Add solution