Browse Source

history survey

master
Gunawan19621 1 year ago
parent
commit
125d587d3e
  1. 64
      app/Http/Controllers/RoleController.php
  2. 1
      app/Models/m_role.php
  3. 0
      resources/views/MasterData/role/index.blade.php
  4. 4
      resources/views/dashboard/peminjaman.blade.php
  5. 29
      resources/views/layouts/sidebar.blade.php
  6. 29
      routes/web.php

64
app/Http/Controllers/RoleController.php

@ -0,0 +1,64 @@
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class RoleController extends Controller
{
/**
* Display a listing of the resource.
*/
public function index()
{
// dd('oke');
}
/**
* Show the form for creating a new resource.
*/
public function create()
{
//
}
/**
* Store a newly created resource in storage.
*/
public function store(Request $request)
{
// dd('oke');
}
/**
* Display the specified resource.
*/
public function show($id)
{
// dd('oke');
}
/**
* Show the form for editing the specified resource.
*/
public function edit()
{
// dd('oke');
}
/**
* Update the specified resource in storage.
*/
public function update(Request $request, $id)
{
// dd('oke');
}
/**
* Remove the specified resource from storage.
*/
public function destroy($id)
{
// dd("oke");
}
}

1
app/Models/m_role.php

@ -8,4 +8,5 @@ use Illuminate\Database\Eloquent\Model;
class m_role extends Model
{
use HasFactory;
protected $table = 'm_role', $guarded = ['id'];
}

0
resources/views/MasterData/role/index.blade.php

4
resources/views/dashboard/peminjaman.blade.php

@ -91,7 +91,7 @@
</button>
</div>
<div class="modal-body">
<form action="{{ route('peminjaman.store') }}" method="POST" enctype="multipart/form-data">
<form action="{{ route('dashboard.peminjaman.store') }}" method="POST" enctype="multipart/form-data">
@csrf
<div class="form-group">
<label for="asset_id" class="col-form-label">Nama Asset:</label>
@ -144,7 +144,7 @@
</button>
</div>
<div class="modal-body">
<form action="{{ route('peminjaman.update', $data->id) }}" method="POST"
<form action="{{ route('dashboard.peminjaman.update', $data->id) }}" method="POST"
enctype="multipart/form-data">
@csrf
@method('PUT')

29
resources/views/layouts/sidebar.blade.php

@ -20,26 +20,8 @@
<!-- Divider -->
<hr class="sidebar-divider">
<!-- Nav Item - Pages Collapse Menu -->
<!-- {{-- <li class="nav-item">
<a class="nav-link" href="{{ url('/dashboard/transaksi') }}">
<span class="ml-4">Transaksi</span>
</a>
</li> --}}
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="collapse" data-target="#collapseTwo" aria-expanded="true"
aria-controls="collapseTwo">
<span class="ml-4">Transaksi</span>
</a>
<div id="collapseTwo" class="collapse" aria-labelledby="headingTwo" data-parent="#accordionSidebar">
<div class="bg-white py-2 collapse-inner rounded">
<a class="collapse-item" href="{{ url('/dashboard/barangMasuk') }}">Barang Masuk</a>
<a class="collapse-item" href="{{ url('/dashboard/barangKeluar') }}">Barang Keluar</a>
</div>
</div>
</li> -->
<li class="nav-item">
<a class="nav-link" href="{{ url('/dashboard/peminjaman') }}">
<a class="nav-link" href="{{ route('dashboard.peminjaman.index') }}">
<span class="ml-4">Peminjaman</span>
</a>
</li>
@ -59,8 +41,8 @@
<!-- Nav Item - Pages Collapse Menu -->
<li class="nav-item">
<a class="nav-link" href="{{ route('asset.index') }}">
<span class="ml-4">Asset</span>
<a class="nav-link" href="#">
<span class="ml-4">Role</span>
</a>
</li>
<li class="nav-item">
@ -68,6 +50,11 @@
<span class="ml-4">User</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('asset.index') }}">
<span class="ml-4">Asset</span>
</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ route('warehouse.index') }}">
<span class="ml-4">Warehouse</span>

29
routes/web.php

@ -3,6 +3,7 @@
use App\Models\m_asset;
use App\Models\asset_status;
use Illuminate\Support\Facades\Route;
use App\Http\Controllers\RoleController;
use App\Http\Controllers\M_userController;
use App\Http\Controllers\M_assetController;
use App\Http\Controllers\ProductController;
@ -41,7 +42,7 @@ Route::middleware('auth')->group(function () {
Route::get('/setting', [ProfileController::class, 'setting'])->name('profile.setting');
});
Route::group(['prefix' => 'dashboard'], function () {
Route::prefix('dashboard')->name('dashboard.')->middleware(['auth'])->group(function () {
//Halaman dashboard
Route::middleware('auth')->get('', function () {
$reminder = asset_status::whereNull('enter_at')->count();
@ -52,13 +53,31 @@ Route::group(['prefix' => 'dashboard'], function () {
return view('dashboard.index', compact('jumlahAsset', 'jumlahPeminjaman', 'jumlahPengembalian', 'reminder'));
});
//Halaman Transaksi
// Route::middleware('auth')->resource('/transaksi', TransaksiController::class);
//Halaman Role
Route::controller(RoleController::class)->group(function () {
Route::get('role', 'index')->name('role.index');
Route::get('role/create', 'create')->name('role.create');
Route::post('role/store', 'store')->name('role.store');
Route::get('role/{id}', 'show')->name('role.show');
Route::get('role/{id}/edit', 'edit')->name('role.edit');
Route::put('role/{id}', 'update')->name('role.update');
Route::delete('role/delete/{id}', 'destroy')->name('role.destroy');
});
//Halaman Peminjaman
Route::middleware('auth')->resource('/peminjaman', PeminjamanController::class);
Route::get('/hapusPeminjaman/{id}', [PeminjamanController::class, 'destroy'])->name('hapusPeminjaman.destroy');
Route::controller(PeminjamanController::class)->group(function () {
Route::get('peminjaman', 'index')->name('peminjaman.index');
// Route::get('peminjaman/create', 'create')->name('peminjaman.create');
Route::post('peminjaman/store', 'store')->name('peminjaman.store');
// Route::get('peminjaman/{id}', 'show')->name('peminjaman.show');
// Route::get('peminjaman/{id}/edit', 'edit')->name('peminjaman.edit');
Route::put('peminjaman/{id}', 'update')->name('peminjaman.update');
Route::delete('peminjaman/delete/{id}', 'destroy')->name('peminjaman.destroy');
});
});
Route::group(['prefix' => 'dashboard'], function () {
//Halaman Pengembalian
Route::middleware('auth')->resource('/pengembalian', PengembalianController::class);

Loading…
Cancel
Save