where condition in laravel

Hi in this article use laravel eloquently. Yes Sure hope this article use and help fully finally every time on this way to easy step to this few step reqire and i like this tutorial help this finally..


it works, but it’s not elegant. Edit UserController Function where:


namespace App\Http\Controllers\Admin;

use App\Http\Controllers\UserController;
use Illuminate\Http\Request;
use App\User;
use DB;
use Auth;
use Session;
use Validator;
use Illuminate\Support\Facades\Redirect;

class UserController extends Controller {

     function where(Request $request) {
             $login = User::where(['email' => 'laratuto@gmail.com', 'password' => $password])->first();




Result: yes postman result

  "status": 1,
  "message": "Sign In successfully",
  "data": {
    "id": 8,
    "first_name": "test user",
    "last_name": "userrr",
    "email": "laratuto@gmail.com",

Leave a Comment