问题
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