What do you mean by "It has to have ::all()"? Does it throw an exception if you don't include that or just not return any results?
Sep 29, 2016
4
Level 4
Call to undefined method Illuminate\Database\Query\Builder::save()
So I'm using Spark and I want to retrieve a user so I do the following but I get the error
Call to undefined method Illuminate\Database\Query\Builder::save()
These are classes I include:
use Illuminate\Http\Request;
use App\Http\Requests;
use Laravel\Spark\Spark;
use Twocheckout;
use Twocheckout_Sale;
use Twocheckout_Error;
use Laravel\Spark\Subscription;
use Laravel\Spark\LocalInvoice;
use App\User;
Here is how I retrieve User model.
$user = User::all()->where('email', $data['user_email'])->first();
I cannot do this.
$user = User::where('email', $data['user_email'])->first();
It has to have ::all()
And then when I try to save
$user->save();
PhpStorm says the method doesnt exist.
What am I doing wrong???
Please or to participate in this conversation.