Laravel Cartalyst/Stripe Method Not Found

随声附和 提交于 2021-02-11 07:10:53

问题


I am trying to use Cartalyst/Stripe (https://cartalyst.com/manual/stripe/2.0) in my Laravel application but I the method's aren't being found (for a lack of a better word).

Here is my controller:

namespace App\Http\Controllers;

use Illuminate\Support\Facades\DB;
use Illuminate\Http\Request;
use Cartalyst\Stripe\Stripe;

class AdminController extends Controller
{

    public function __construct()
    {
        $this->middleware('auth');
    }

    public function create_user(Request $request) {

        $stripe = Stripe::make( config('services.stripe.key') );

        $customer = $stripe->customers()->create([
            'email' => 'email@example.com',
        ]);


        return response()->json(['response' => 'This is get method']);
    }
}

The Stripe:make() appears to be working correctly, but the customers->() isn't found in my IDE, and produces an internal 500 error. I followed the instructions on https://cartalyst.com/manual/stripe-laravel/8.x so my provider and alias are the same that are listed.


回答1:


Alright so the way I have it setup does, in fact, work properly, just my IDE (phpstorm) isn't tracking the methods properly.



来源:https://stackoverflow.com/questions/51911396/laravel-cartalyst-stripe-method-not-found

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!