405 Method Not Allowed POST Laravel
<p>I have a laravel api that I'm trying to run a custom artisan command to process a transaction. The api is suppose to check for pending transactions in our merchant database and post them in our transaction database.
I get the following error:</p>

<pre><code>[GuzzleHttp\Exception\ClientException]
  Client error: `POST http://paycentral.mymarket.com/transactions/bulk` resulted in a `405 Method Not Allowed` response:
  {"error":{"message":"405 Method Not Allowed","status_code":405,"debug":{"line":446,"file":"\/var\/www\/vhosts\/maindomai (truncated...)
</code></pre>

<p>The API I'm using is located at api.mymarket.com. Searching for errors like this has me believing it's a CORS-related issue. I'm using laravel-cors and added Header set Access-Control-Allow-Origin "*" to the .htaccess in both the public folder for api.mymarket.com and paycentral.mymarket.com. The error is still persisting though. Is there any other possible workaround? We are currently using plesk for our hosting services.</p>

<p>UPDATE: I tried doing a preflight request in the pay subdomain
Origin: api.mymarket.com
Access-Control-Request-Method: POST
Access-Control-Request-Headers: MM</p>

<p>It returned a 500 Internal Error which is progress I guess.</p>

<p>UPDATE Here is the routes.php for paycentral. The cors-library is registered in the app.php.</p>

<p>paycentral routes.php</p>

<pre><code>&lt;?php

$api = app('Dingo\Api\Routing\Router');

// all routes are protected by the Authenticate middleware which makes sure     the client
// is authenticated as *somebody* - each resource is further protected by  the authorization
// policies in the App\Api\V1\Policies files to limit the method calls by which client
// type is attempting to access the resource - these must be mapped in the     AuthServiceProvider
$api-&gt;group([
    'version' =&gt; 'v1',
    'namespace' =&gt; 'App\Api\V1\Controllers',
    'middleware' =&gt; 'auth' // use the Authenticate middleware
], function($api) {

/*
     * partial CRUD resource routes
     */

    $api-&gt;get('transactions/{id}', 'TransactionController@show');
    $api-&gt;post('transactions', 'TransactionController@store');
    $api-&gt;put('transactions/{id}', 'TransactionController@update');
    $api-&gt;post('transactions/bulk', 'TransactionController@store_bulk');
    $api-&gt;post('transactions/get_updates',  'TransactionController@get_updates');
</code></pre>