have you tried (remove get())?:
$subscribeUser = User::where('email', $data['email']);
deansatch said:
have you tried (remove get())?:
$subscribeUser = User::where('email', $data['email']);
yes, still error
deansatch said:
have you tried (remove get())?:
$subscribeUser = User::where('email', $data['email']);
this is my model:
use Laravel\Cashier\Billable;
use Prettus\Repository\Contracts\Transformable;
use Prettus\Repository\Traits\TransformableTrait;
use Illuminate\Notifications\Notifiable;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Auth\Authenticatable as AuthenticatableTrait;
// use Illuminate\Database\Eloquent\Model;
class User extends Authenticatable implements AuthenticatableContract, AuthorizableContract, CanResetPasswordContract
{
use AuthenticatableTrait, Authorizable, CanResetPassword, TransformableTrait, Notifiable, Billable, SoftDeletes;
Controller:
$user = User::create([
'account_type' => $data['account_type'],
'name' => $data['name'],
'email' => $data['email'],
'password' => bcrypt($data['password']),
]);
$subscribeUser = User::where('email', $data['email']);
$subscribeUser->newSubscription('individual', 'individual')->create($stripeToken);
Will return
BadMethodCallException
Call to undefined method Illuminate\Database\Query\Builder::newSubscription()
deansatch said:
have you tried (remove get())?:
$subscribeUser = User::where('email', $data['email']);
plans are created
Sorry... I should have said use first() instead of get() rather than just removing it.
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community