app/Http/Controllers/FarmsController.php
/**
     * Display a listing of the  all the farms.
     *
     * @return \Illuminate\Http\Response
     */
Display a listing of the  all the farms.
@return \Illuminate\Http\Response
Display a listing of the all the farms . @return \ Illuminate \ Http \ Response
public function index()
    {
      $userId = auth::user()->id;
      $farmsForUser = farms::where('user_id', $userId)->get();
      return response()->json($farmsForUser, 201);
    }
public function index ( ) { $ userId = auth :: user ( ) -> id ; $ farmsForUser = farms :: where ( 'user_id' , $ userId ) -> get ( ) ; return response ( ) -> json ( $ farmsForUser , 201 ) ; }
Display a listing of the  all the farms.
Display a listing of the all the farms .
// get farmer Id // get all farms tha belong to the farmer with userId  