winda

we.php

May 28th, 2017
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.51 KB | None | 0 0
  1. <?php
  2.  
  3. Route::get('about', function(){
  4.     $halaman='about';
  5.     return view('chapter5.about', compact('halaman'));
  6. });
  7. Route::get('/dashboard','AdminController@index');
  8.  
  9. //chapter5
  10.  
  11. Route::get('/','HomeController@index');
  12. Route::get('/about','AboutController@index');
  13.  
  14. //---------------------------
  15. Route::group(['middleware'=>['web']], function(){
  16.     Route::get('karyawan','KaryawanController@index');
  17.     Route::get('karyawan/create','KaryawanController@create');
  18.     Route::get('karyawan/{karyawan}','KaryawanController@show');
  19.     Route::post('karyawan','KaryawanController@store');
  20.     Route::get('karyawan/{karyawan}/edit','KaryawanController@edit');
  21.     Route::patch('karyawan/{karyawan}','KaryawanController@update');
  22.     Route::delete('karyawan/{karyawan}','KaryawanController@destroy');
  23.     Route::get('caridata','KaryawanController@search');
  24. });
  25. //---------------------------
  26.  
  27. //Route::get('/karyawan','KaryawanC5Controller@index');
  28.  
  29. Route::get('sampledata',function(){
  30.     DB::table('employes')->insert([
  31.         [
  32.         'nama' => 'zaid',
  33.         'nip'=>'1001',
  34.         'tgl_lahir'=>'1990-01-22',
  35.         'gender'=>'L',
  36.         'created_at' => '2017-04-24 21:18',
  37.         'updated_at' => '2017-04-24 21:18'
  38.         ],
  39.         [
  40.         'nama' => 'Hindun',
  41.         'nip'=>'1002',
  42.         'tgl_lahir'=>'1998-01-22',
  43.         'gender'=>'P',
  44.         'created_at'=>'2017-04-24 21:19',
  45.         'updated_at'=>'2017-04-24 21:20'
  46.         ],
  47.         [
  48.         'nama' => 'Michan',
  49.         'nip'=>'1003',
  50.         'tgl_lahir'=>'1996-05-21',
  51.         'gender'=>'L',
  52.         'created_at'=>'2017-04-24 21:19',
  53.         'updated_at'=>'2017-04-24 21:20'
  54.         ]
  55.         ]);
  56.     });
Advertisement
Add Comment
Please, Sign In to add comment