Hello everyone, I want hooks to make from the Stripe, read the Doc
Routh scored like this Route::post('stripe/webhook', '\\App\\Http\\Controllers\\WebhookController@handleWebhook');
The controller extends base
use Laravel\\Cashier\\Http\\Controllers\\WebhookController as CashierController; WebhookController CashierController extends class {}
Try to test and create a stupid file
public function handleInvoicePaymentSucceeded($payload) { //http_response_code(201); //$subscription = Subscription::where('stripe_id', $payload); $path = 'screenshots/' . time() . '.txt'; $result = Storage::disk('public')->put($path, 'asdasd'); }
But nothing is created, but in response to 200 flies, already 40 minutes unable to find the cause, and if you make a stupid controller separate, does not extend CashierController, for example in the index method, the file is created perfectly
public function index() { $input = @file_get_contents('php://input'); //$event_json = json_decode($input); // Do something with $event_json $path = 'screenshots/' . time() . '.txt'; $result = Storage::disk('public')->put($path, 'asdasd'); http_response_code(200); // PHP 5.4 or greater }
I of course can use with their own controller and method, but the solution to the cashier like, and write something like no time has anyone come across?