Skip to content

Instantly share code, notes, and snippets.

View ollieread's full-sized avatar
👾
Build it all!

Ollie Read ollieread

👾
Build it all!
View GitHub Profile
@ollieread
ollieread / _undocumented-php.md
Last active January 22, 2023 16:28
Undocumented content on PHP

List of underdocumented functions/methods in PHP

pecl

svn

Classes

None

Methods

  • /reference/svn/functions/svn-fs-txn-root.xml
  • /reference/svn/functions/svn-repos-fs-commit-txn.xml
  • /reference/svn/functions/svn-fs-file-contents.xml
  • /reference/svn/functions/svn-fs-make-file.xml
@janzikmund
janzikmund / Postman-pre-request-script-csrf-token-laravel-sanctum.js
Last active March 20, 2024 00:37
Postman Pre-Request script to append CSRF token in header for POST requests in Laravel Sanctum authenticated SPA. Requires active environment with {{url}} variable defined for main app domain.
/**
* Postman Pre-Request script to append CSRF token in header for POST requests in Laravel
* Sanctum authenticated SPA. Requires active environment with {{url}} variable defined
* for main app domain.
*
* Postman Interceptor allows appending cookies from browser, but Laravel CSRF middleware
* only validates CSRF in headers or in _token form field, not in cookies. Axios automatically
* appends the CSRF from cookie to headers, but Postman cannot access intercepted cookies
* and use them, so we have to do one pre-request to get the CSRF token, store it
* in environment so it can be reused, and then append it to headers.