Advertisement
fputriayu

web.php

May 28th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 2.31 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('pages.home');
  16. });
  17.  
  18. Route::get('/', function () {
  19.     return view('chap5.home');
  20. });
  21.  
  22. Route::get('about', function () {
  23.     $halaman='about';
  24.     return view('chap5.about',compact('halaman'));
  25. });
  26.  
  27. /* Route::get('karyawan', function () {
  28.     $halaman='karyawan';
  29.     $karyawan=['Munawar', 'Budi Santoso', 'Widya Ningrum', 'Unggul Jaya'];
  30.     return view('chap5.karyawan',compact('halaman','karyawan'));
  31. }); */
  32.  
  33. //Route::get('about', 'BelajarController@index');
  34. //Route::get('karyawan/create','KaryawanController@index');
  35.  
  36. Route::group(['middleware'=>['web']],function(){
  37. Route::get('karyawan','KaryawanController@index');
  38. Route::get('karyawan/create','KaryawanController@create');
  39. Route::get('karyawan/{karyawan}','KaryawanController@show');
  40. Route::post('karyawan','KaryawanController@store');
  41. Route::get('karyawan/{karyawan}/edit','KaryawanController@edit');
  42. Route::patch('karyawan/{karyawan}','KaryawanController@update');
  43. Route::delete('karyawan/{karyawan}','KaryawanController@destroy');
  44. Route::get('caridata','KaryawanController@search');
  45. });
  46.  
  47. Route::get('sampeldata',function(){
  48.     DB::table('employees')->insert([
  49.         [
  50.             'nama' => 'Zaid',
  51.             'nip' => '100001',
  52.             'tgl_lahir' => '1990-01-22',
  53.             'gender' => 'L',
  54.             'created_at' => '2017-04-24 21:18',
  55.             'updated_at' => '2017-04-24 21:18'],
  56.         [
  57.             'nama' => 'Ayu',
  58.             'nip' => '100002',
  59.             'tgl_lahir' => '1996-04-07',
  60.             'gender' => 'P',
  61.             'created_at' => '2017-04-24 21:19',
  62.             'updated_at' => '2017-04-24 21:19'],
  63.         [
  64.             'nama' => 'Abi',
  65.             'nip' => '100003',
  66.             'tgl_lahir' => '2014-01-22',
  67.             'gender' => 'L',
  68.             'created_at' => '2017-04-24 21:18',
  69.             'updated_at' => '2017-04-24 21:18'],
  70.         ]);
  71. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement