<?php

namespace App\Http\Controllers;

use App\Http\Controllers\Controller;
use App\Http\Requests\StoreUserRequest;
use App\Http\Requests\UpdateUserRequest;
use App\Collector;
use Illuminate\Http\Request;

class CustomersApiController extends Controller
{
    public function index()
    {
        $customers = Customer::all();

        return $customers;
    }

    public function loginCollector(Request $request)
    {
    	$mobile = $request->input('mobile');
    	$password = $request->input('password');

    	$collector = Collector::where(['mobile'=>$mobile,'password'=>$password])->first();
        if($collector)       // If the user is found
        {
            return $collector;
        }else{
            return null;       // You can create a page for this
        }
    }
 
}
