Last active
December 31, 2020 13:21
-
-
Save royteusink/62cbf3ef01216840851a9f85c0e2ec4e to your computer and use it in GitHub Desktop.
Revisions
-
royteusink revised this gist
Dec 31, 2020 . 1 changed file with 21 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -41,12 +41,32 @@ valet secure ```ini SANCTUM_STATEFUL_DOMAINS="app.yourdomain.test:8080" SESSION_DOMAIN=".yourdomain.test" SESSION_DRIVER=database SESSION_LIFETIME=120 ``` config/cors.php ```php 'paths' => ['api/*', 'sanctum/csrf-cookie'], 'supports_credentials' => true, ``` logout route ```php public function logout(Request $request) { Auth::guard('web')->logout(); $request->session()->flush(); $request->session()->invalidate(); $request->session()->regenerateToken(); return response()->json(['message' => 'Successfully logged out'], 200); } ``` session table ```bash php artisan session:table php artisan migrate ``` -
royteusink revised this gist
Dec 17, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ CORS issues with local development setup Laravel Sanctum with Vue3 cli ## app.yourdomain.test -
royteusink revised this gist
Dec 17, 2020 . 1 changed file with 8 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ ## app.yourdomain.test vue app created with vue cli. @@ -41,4 +43,10 @@ SANCTUM_STATEFUL_DOMAINS="app.yourdomain.test:8080" SESSION_DOMAIN=".yourdomain.test" SESSION_DRIVER=cookie SESSION_LIFETIME=120 ``` config/cors.php ```php 'paths' => ['api/*', 'sanctum/csrf-cookie'], 'supports_credentials' => true, ``` -
royteusink revised this gist
Dec 17, 2020 . 1 changed file with 12 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,6 +2,18 @@ vue app created with vue cli. ```js axios.create({ baseURL: process.env.VUE_APP_API_URL, withCredentials: true }); ``` .env ```ini VUE_APP_API_URL="https://api.yourdomain.test/" ``` package.json ``` { -
royteusink revised this gist
Dec 17, 2020 . 1 changed file with 13 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,22 @@ ## app.yourdomain.test vue app created with vue cli. package.json ``` { "serve": "vue-cli-service serve --host app.yourdomain.test --https", } ``` ```shell yarn serve ``` ## api.yourdomain.test Laravel 8 + Laravel sanctum ```shell cd api.yourdomain valet link -
royteusink created this gist
Dec 17, 2020 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ package.json ``` { - "serve_": "vue-cli-service serve", + "serve": "vue-cli-service serve --host app.yourdomain.test --https", } ``` ```shell cd api.yourdomain valet link valet secure ``` .env ```ini SANCTUM_STATEFUL_DOMAINS="app.yourdomain.test:8080" SESSION_DOMAIN=".yourdomain.test" SESSION_DRIVER=cookie SESSION_LIFETIME=120 ```