Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- namespace App\Http\Controllers;
- use Illuminate\Http\Request;
- use Illuminate\Support\Facades\DB;
- class crud extends Controller
- {
- public function index()
- {
- // mengambil data dari table mahasiswa
- $mahasiswa = DB::table('mahasiswa')->get();
- // mengirim data pegawai ke view index
- return view('index',['mahasiswa' => $mahasiswa]);
- }
- public function tambah()
- { // method untuk menampilkan view form tambah pegawai
- return view('tambah'); // memanggil view tambah
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement