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 characters
<?php | |
/* | |
* Merges two arrays and takes multi-dimensional arrays into account. | |
* | |
* @param array $original | |
* @param array $merging | |
* @return array | |
*/ | |
function array_deep_merge(array $original, array $merging): array |
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 characters
<?php | |
namespace App\Providers; | |
use Illuminate\Support\Arr; | |
use Illuminate\Support\ServiceProvider; | |
class BaseServiceProvider extends ServiceProvider | |
{ | |
/** |
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 characters
<?php | |
namespace App\Http\Middleware; | |
use Closure; | |
use Illuminate\Support\Str; | |
/** | |
* Checks for the `access_token` parameter, and if exists, puts it in the Authorization header. | |
*/ |
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 characters
/** | |
* Request interceptor that fixes PUT requests for php. >> https://bugs.php.net/bug.php?id=55815 | |
*/ | |
instance.interceptors.request.use((request) => { | |
if (request.method === 'put' && request.data instanceof FormData) { | |
request.method = 'post'; | |
request.data.append('_method', 'put'); | |
} | |
return request; |