Help us understand the problem. What is going on with this article?

barryvdh/laravel-cors の allowedOriginsPatterns オプション

barryvdh/laravel-cors については、以下記事に詳しい。

https://qiita.com/okashoi/items/026b2d810201555da84d

で、実際に使ったとき、allowedOriginsPatterns オプションに
どんな文字列を具体的に渡せばいいかわからなかったので
該当ライブラリのソースコード調べた時のメモ。

  • 書式は、preg_match() の第1引数に書く形式で。デリミタも必要。
  • allowedOriginsPatterns は配列なので、複数正規表現パターンの指定が可能。

ちなみに、これを処理しているのは、barryvdh/laravel-cors が依存しているライブラリ
asm89/stack-cors の
src/Asm89/Stack/CorsService.php checkOrigin() メソッド。

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away