rizal245754733

web.php

May 28th, 2017
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.16 KB | None | 0 0
  1. <?php
  2.  
  3. /*
  4. |--------------------------------------------------------------------------
  5. | Web Routes
  6. |--------------------------------------------------------------------------
  7. |
  8. | Here is where you can register web routes for your application. These
  9. | routes are loaded by the RouteServiceProvider within a group which
  10. | contains the "web" middleware group. Now create something great!
  11. |
  12. */
  13.  
  14. Route::get('/', function () {
  15.     return view('chap5.home');
  16. });
  17.  
  18. Route::get('about', function () {
  19.     $halaman='about';
  20.     return view('chap5.about', compact('halaman'));
  21. });
  22. /*
  23. Route::get('karyawan',function(){
  24.     $halaman='karyawan';
  25.     $karyawan=['Munawar', 'Budi Santoso', 'Widya Ningrum', 'Unggul Jaya'];
  26.     return view('chap5.karyawan', compact('halaman','karyawan'));
  27. });
  28. */
  29.  
  30. //Route::get('about', 'BelajarController@index');
  31.  
  32. Route::get('/Projek1', 'Projek1Controller@index');
  33. Route::post('/Projek1/auth', 'Projek1Controller@auth');
  34. Route::get('/Latihan', 'LatihanController@index');
  35.  
  36. Route::get('sampeldata',function(){
  37.     DB::table('employes')->insert([
  38.         [
  39.             'nama' => 'Zaid',
  40.             'nip' => '10001',
  41.             'tgl_lahir' => '1990-01-22',
  42.             'gender' => 'L',
  43.             'created_at' => '2017-04-24 21:18',
  44.             'updated_at' => '2017-04-24 21:18'
  45.         ],
  46.         [
  47.             'nama' => 'Hindun',
  48.             'nip' => '10002',
  49.             'tgl_lahir' => '1988-01-22',
  50.             'gender' => 'P',
  51.             'created_at' => '2017-04-24 21:19',
  52.             'updated_at' => '2017-04-24 21:19'
  53.         ],
  54.         [
  55.             'nama' => 'Rizal',
  56.             'nip' => '14090013',
  57.             'tgl_lahir' => '1996-04-17',
  58.             'gender' => 'L',
  59.             'created_at' => '2017-04-24 21:18',
  60.             'updated_at' => '2017-04-24 21:18'
  61.         ],
  62.     ]);
  63. });
  64.  
  65. Route::group(['middleware'=>['web']],function(){
  66.     Route::get('karyawan','KaryawanController@index');
  67.     Route::get('karyawan/create', 'KaryawanController@create');
  68.     Route::get('karyawan/{karyawan}', 'KaryawanController@show');
  69.     Route::post('karyawan', 'KaryawanController@store');
  70.     Route::get('caridata','KaryawanController@cari');
  71.     Route::get('karyawan/{karyawan}/edit', 'KaryawanController@edit');
  72.     Route::patch('karyawan/{karyawan}', 'KaryawanController@update');
  73.     Route::delete('karyawan/{karyawan}', 'KaryawanController@destroy');
  74. });
Add Comment
Please, Sign In to add comment