Вот часть моего контроллера Webhook, где говорится об ошибке. Мне все кажется правильным. Что я могу упустить?
Кроме того, работает только веб-хук для обработки счета-фактуры, все остальное дает мне ошибку 500 ниже.
/**
* Get the billable entity instance by Stripe ID.
*
* @param string|null $stripeId
* @return \Laravel\Cashier\Billable|null
*/
protected function getUserByStripeId($stripeId)
{
if ($stripeId === null) {
return;
}
$model = config('cashier.model');
return (new $model)->where('stripe_id', $stripeId)->first();
}
Вот ошибка 500, которую я получаю, когда пытаюсь протестировать страйп-вебхук.
Test webhook error: 500
Symfony\Component\Debug\Exception\FatalThrowableError: Class 'App/User' not found in file /.../vendor/laravel/cashier/src/Http/Controllers/StripeWebhookController.php on line 208
Мой пользовательский файл находится в App\User. Это мой пользовательский файл
class User extends Authenticatable
{
use Notifiable, Billable;
protected $connection = 'mongodb';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'username', 'password', 'phone',
];
/**
* The collection name
*
* @var array
*/
protected $collection = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $dates = ['deleted_at'];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
}
Вот мой конфиг\auth.php
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
php artisan dump-autoload
, это должно вам помочь. - person Prafulla Kumar Sahu   schedule 03.01.2020