Skip to content

Commit

Permalink
Sesuaikan middleware API kirim data dari OpenSID
Browse files Browse the repository at this point in the history
  • Loading branch information
andifahruddinakas committed May 30, 2022
1 parent b7f186e commit 029be28
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 105 deletions.
10 changes: 0 additions & 10 deletions app/Http/Controllers/Api/LaporanApbdesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@

class LaporanApbdesController extends Controller
{
/**
* Create a new AuthController instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(['auth:api', 'role:admin-desa']);
}

/**
* Tambah / Ubah Data Apbdes Sesuai OpenSID
*
Expand Down
10 changes: 0 additions & 10 deletions app/Http/Controllers/Api/LaporanPendudukController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,16 +37,6 @@

class LaporanPendudukController extends Controller
{
/**
* Create a new AuthController instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(['auth:api', 'role:admin-desa']);
}

/**
* Tambah / Ubah Data Laporan Penduduk Dari OpenSID
*
Expand Down
10 changes: 0 additions & 10 deletions app/Http/Controllers/Api/PembangunanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@

class PembangunanController extends Controller
{
/**
* Create a new AuthController instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth:api');
}

/**
* Tambah Data Pembangunan Sesuai OpenSID
*
Expand Down
10 changes: 0 additions & 10 deletions app/Http/Controllers/Api/PendudukController.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,6 @@

class PendudukController extends Controller
{
/**
* Create a new AuthController instance.
*
* @return void
*/
public function __construct()
{
$this->middleware(['auth:api', 'role:admin-desa']);
}

/**
* Hapus Data Penduduk Sesuai OpenSID
*
Expand Down
5 changes: 0 additions & 5 deletions app/Http/Controllers/Api/PesanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,6 @@

class PesanController extends Controller
{
public function __construct()
{
$this->middleware('auth:api');
}

public function store(PesanRequest $request)
{
$desa = DataDesa::where('desa_id', '=', $request->kode_desa)->first();
Expand Down
7 changes: 1 addition & 6 deletions app/Http/Controllers/Api/ProfilDesaController.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,13 @@

class ProfilDesaController extends Controller
{
public function __construct()
{
$this->middleware('auth:api');
}

public function store(ProfilDesaRequest $request)
{
DataDesa::where('desa_id', $request->kode_desa)->update([
'website' => $request->website,
'sebutan_desa' => $request->sebutan_desa,
'path' => $request->path
]);
]);

return response()->json([
'status' => 'success',
Expand Down
10 changes: 0 additions & 10 deletions app/Http/Controllers/Api/ProgamBantuanController.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,16 +41,6 @@

class ProgamBantuanController extends Controller
{
/**
* Create a new AuthController instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth:api');
}

public function store(ProgramBantuanRequest $request)
{
try {
Expand Down
91 changes: 47 additions & 44 deletions routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,55 +57,58 @@
Route::get('me', 'Api\Auth\AuthController@me');
});

/**
* Penduduk
*/
Route::group(['prefix' => 'penduduk'], function () {
Route::post('/', 'Api\PendudukController@store');
Route::post('storedata', 'Api\PendudukController@storedata');
Route::post('test', 'Api\PendudukController@test');
});
Route::group(['middleware' => ['auth:api', 'role:admin-desa']], function () {

/**
* Laporan Apbdes
*/
Route::group(['prefix' => 'laporan-apbdes'], function () {
Route::post('/', 'Api\LaporanApbdesController@store');
});
/**
* Penduduk
*/
Route::group(['prefix' => 'penduduk'], function () {
Route::post('/', 'Api\PendudukController@store');
Route::post('storedata', 'Api\PendudukController@storedata');
Route::post('test', 'Api\PendudukController@test');
});

/**
* Laporan Penduduk
*/
Route::group(['prefix' => 'laporan-penduduk'], function () {
Route::post('/', 'Api\LaporanPendudukController@store');
});
/**
* Laporan Apbdes
*/
Route::group(['prefix' => 'laporan-apbdes'], function () {
Route::post('/', 'Api\LaporanApbdesController@store');
});

Route::group(['prefix' => 'pesan'], function () {
Route::post('/', 'Api\PesanController@store');
Route::post('getpesan', 'Api\PesanController@getPesan');
Route::get('detail', 'Api\PesanController@detail');
});
/**
* Laporan Penduduk
*/
Route::group(['prefix' => 'laporan-penduduk'], function () {
Route::post('/', 'Api\LaporanPendudukController@store');
});

/**
* Pembangunan
*/
Route::group(['prefix' => 'pembangunan'], function () {
Route::post('/', 'Api\PembangunanController@store');
Route::post('dokumentasi', 'Api\PembangunanController@storeDokumentasi');
});
Route::group(['prefix' => 'pesan'], function () {
Route::post('/', 'Api\PesanController@store');
Route::post('getpesan', 'Api\PesanController@getPesan');
Route::get('detail', 'Api\PesanController@detail');
});

/**
* Identitas Desa
*/
Route::group(['prefix' => 'identitas-desa'], function () {
Route::post('/', 'Api\ProfilDesaController@store');
});
/**
* Pembangunan
*/
Route::group(['prefix' => 'pembangunan'], function () {
Route::post('/', 'Api\PembangunanController@store');
Route::post('dokumentasi', 'Api\PembangunanController@storeDokumentasi');
});

/**
* Program Bantuan
*/
Route::group(['prefix' => 'program-bantuan'], function () {
Route::post('/', 'Api\ProgamBantuanController@store');
Route::post('peserta', 'Api\ProgamBantuanController@storePeserta');
/**
* Identitas Desa
*/
Route::group(['prefix' => 'identitas-desa'], function () {
Route::post('/', 'Api\ProfilDesaController@store');
});

/**
* Program Bantuan
*/
Route::group(['prefix' => 'program-bantuan'], function () {
Route::post('/', 'Api\ProgamBantuanController@store');
Route::post('peserta', 'Api\ProgamBantuanController@storePeserta');
});
});
});

0 comments on commit 029be28

Please sign in to comment.