Skip to content

Commit

Permalink
change API fieldmeterreading
Browse files Browse the repository at this point in the history
  • Loading branch information
emanme committed Feb 27, 2024
1 parent cd8d1ac commit 0da6976
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 92 deletions.
49 changes: 49 additions & 0 deletions .env22
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
APP_NAME=Laravel
APP_ENV=local
APP_KEY=base64:AFRnlERBYjTrENksIcDoYNdjFEd2oVgzyyMkQP5z6Iw=
APP_DEBUG=true
APP_URL=http://localhost

LOG_CHANNEL=stack
LOG_LEVEL=debug

DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
DB_DATABASE=southern_watersystem
DB_USERNAME=southern_watersystem
DB_PASSWORD=southern_watersystem

BROADCAST_DRIVER=log
CACHE_DRIVER=file
QUEUE_CONNECTION=sync
SESSION_DRIVER=file
SESSION_LIFETIME=120

MEMCACHED_HOST=127.0.0.1

REDIS_HOST=127.0.0.1
REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS=null
MAIL_FROM_NAME="${APP_NAME}"

AWS_ACCESS_KEY_ID=
AWS_SECRET_ACCESS_KEY=
AWS_DEFAULT_REGION=us-east-1
AWS_BUCKET=

PUSHER_APP_ID=
PUSHER_APP_KEY=
PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1

MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"
9 changes: 9 additions & 0 deletions app/Http/Controllers/FieldMeterReadingController.php
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,13 @@ public function store(Request $request)
$transactions = Transaction::create($fillable);
return response()->json(['created' => true, 'data'=>$fillable]);
}
public function api_store(Request $request)
{
$requestData = json_decode($request->getContent(), true);

$response = $this->store($requestData);

// Return the response from store function
return $response;
}
}
92 changes: 1 addition & 91 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Route;

use App\Http\Controllers\StudentController;
use App\Http\Controllers\WaterBillController;
/*
|--------------------------------------------------------------------------
| API Routes
Expand All @@ -14,6 +15,9 @@
|
*/

Route::post('/waterbill/process', [WaterBillController::class, 'processWaterBill']);
Route::post('/students', [StudentController::class, 'index']);
Route::get('/students', [StudentController::class, 'index']);
Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});

0 comments on commit 0da6976

Please sign in to comment.