From 90a27b278d1ce80c0c688eb181f52c785715d98a Mon Sep 17 00:00:00 2001 From: dipta ikromi m Date: Sat, 20 Aug 2022 13:40:56 +0700 Subject: [PATCH] menambahkan folder routes --- routes/api.php | 19 +++++++++++ routes/channels.php | 18 ++++++++++ routes/console.php | 19 +++++++++++ routes/web.php | 82 +++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 routes/api.php create mode 100644 routes/channels.php create mode 100644 routes/console.php create mode 100644 routes/web.php diff --git a/routes/api.php b/routes/api.php new file mode 100644 index 0000000..eb6fa48 --- /dev/null +++ b/routes/api.php @@ -0,0 +1,19 @@ +get('/user', function (Request $request) { + return $request->user(); +}); diff --git a/routes/channels.php b/routes/channels.php new file mode 100644 index 0000000..5d451e1 --- /dev/null +++ b/routes/channels.php @@ -0,0 +1,18 @@ +id === (int) $id; +}); diff --git a/routes/console.php b/routes/console.php new file mode 100644 index 0000000..e05f4c9 --- /dev/null +++ b/routes/console.php @@ -0,0 +1,19 @@ +comment(Inspiring::quote()); +})->purpose('Display an inspiring quote'); diff --git a/routes/web.php b/routes/web.php new file mode 100644 index 0000000..dcf30f1 --- /dev/null +++ b/routes/web.php @@ -0,0 +1,82 @@ +join('tbl_jenis_barang','tbl_jenis_barang.id','=','tbl_barang.jenis_barang_id') + ->get(['tbl_barang.*','tbl_satuan.nama_satuan','tbl_jenis_barang.nama_jenis']); + return view('welcome',$data); +}); + +Route::post('api/detail_barang', 'App\Http\Controllers\API\BarangController@detail_barang'); +Route::post('api/v1/register', [App\Http\Controllers\API\AuthController::class, 'register']); +Route::post('api/login', [App\Http\Controllers\API\AuthController::class, 'login']); + + + Route::resource('api/barang', App\Http\Controllers\API\BarangController::class); + + +Route::resource('api/pengguna', App\Http\Controllers\API\PenggunaController::class); +Route::get('show_jenis_barang','App\Http\Controllers\RestController@show_jenis_barang')->name('rest.tampil'); +Auth::routes(); + +Route::get('/home', [App\Http\Controllers\HomeController::class, 'index'])->name('home'); +Auth::routes(); + +Route::get('/home', 'App\Http\Controllers\HomeController@index')->name('home'); + +Route::group(['middleware' => 'auth'], function () { + Route::resource('user', 'App\Http\Controllers\UserController', ['except' => ['show']]); + Route::get('profile', ['as' => 'profile.edit', 'uses' => 'App\Http\Controllers\ProfileController@edit']); + Route::resource('pengguna','App\Http\Controllers\PenggunaController'); + Route::put('update/pengguna','App\Http\Controllers\PenggunaController@update_ajax')->name('pengguna.updates'); + Route::get('pengguna/hapus/{id}','App\Http\Controllers\PenggunaController@hapus')->name('pengguna.hapus'); + Route::resource('divisi','App\Http\Controllers\DivisiController'); + Route::put('update/divisi','App\Http\Controllers\DivisiController@update_ajax')->name('divisi.updates'); + Route::get('divisi/hapus/{id}','App\Http\Controllers\DivisiController@hapus')->name('divisi.hapus'); + Route::resource('transaksi','App\Http\Controllers\TransaksiController'); + Route::resource('barang','App\Http\Controllers\BarangController'); + Route::put('updates/barang','App\Http\Controllers\BarangController@updates_barang')->name('barang.updated'); + Route::put('update/barang','App\Http\Controllers\BarangController@update_ajax')->name('barang.updates'); + Route::post('barang/out','App\Http\Controllers\BarangController@barang_keluar')->name('barang.out'); + Route::get('barang/hapus/{id}','App\Http\Controllers\BarangController@hapus')->name('barang.hapus'); + Route::resource('satuan','App\Http\Controllers\SatuanController'); + Route::put('update/satuan','App\Http\Controllers\SatuanController@update_ajax')->name('satuan.updates'); + Route::get('satuan/hapus/{id}','App\Http\Controllers\SatuanController@hapus')->name('satuan.hapus'); + Route::resource('jenis_barang','App\Http\Controllers\JenisBarangController'); + Route::put('update/jenis_barang','App\Http\Controllers\JenisBarangController@update_ajax')->name('jenis_barang.updates'); + Route::get('jenis_barang/hapus/{id}','App\Http\Controllers\JenisBarangController@hapus')->name('jenis_barang.hapus'); + Route::put('profile', ['as' => 'profile.update', 'uses' => 'App\Http\Controllers\ProfileController@update']); + Route::get('upgrade', function () {return view('pages.upgrade');})->name('upgrade'); + Route::get('map', function () {return view('pages.maps');})->name('map'); + Route::get('icons', function () {return view('pages.icons');})->name('icons'); + Route::get('table-list', function () {return view('pages.tables');})->name('table'); + Route::put('profile/password', ['as' => 'profile.password', 'uses' => 'App\Http\Controllers\ProfileController@password']); + + // ajax route request + + // GET + Route::get('get_html_barang_rusak','App\Http\Controllers\RestController@get_html_barang_rusak'); + + //POST + Route::post('get_jenis_barang','App\Http\Controllers\RestController@get_jenis_barang'); + Route::post('get_divisi','App\Http\Controllers\RestController@get_divisi'); + Route::post('get_pengguna','App\Http\Controllers\RestController@get_pengguna'); + Route::post('get_satuan_barang','App\Http\Controllers\RestController@get_satuan'); + Route::post('get_barang','App\Http\Controllers\RestController@get_barang'); + Route::post('get_detail_stok','App\Http\Controllers\RestController@get_detail_stok'); +}); +