Esempio n. 1
0
 public function users()
 {
     $users = User::orderBy('level_id', 'asc')->get();
     $level = Level::lists('name', 'id');
     $ppk = Ppk::lists('name', 'id');
     return View('admin.preset.users', compact('users', 'level', 'ppk'));
 }
Esempio n. 2
0
     $mark = \App\Markah::findOrFail($id);
     return View('admin.preset.markah.edit', compact('mark'));
 });
 /****************************************
  *                  Users
  ****************************************/
 Route::get('users', ['as' => 'admin.preset.users', 'uses' => 'Admin\\PresetController@users']);
 Route::post('users', ['as' => 'admin.preset.usersPost', 'uses' => 'Admin\\PresetController@userPost']);
 Route::get('users/hapus/{id}', function ($id) {
     \App\User::destroy($id);
     return Redirect::back();
 });
 Route::get('users/{id}', function ($id) {
     $user = \App\User::findOrFail($id);
     $level = \App\Level::lists('name', 'id');
     $ppk = \App\Ppk::lists('name', 'id');
     return View('admin.preset.users.edit', compact('user', 'level', 'ppk'));
 });
 Route::post('users/kemaskini', ['as' => 'admin.preset.users.kemaskini', 'uses' => 'Admin\\PresetController@kemaskini']);
 /**************************************
  *                 Bank
  **************************************/
 Route::get('bank', ['as' => 'admin.preset.bank', 'uses' => 'Admin\\BankController@bank']);
 Route::post('bank', ['as' => 'admin.preset.bank', 'uses' => 'Admin\\BankController@bankPost']);
 Route::get('bank/{id}', function ($id) {
     if (\App\Bank::destroy($id)) {
         Session::flash('success', 'Berjaya. Permarkahan berjaya dihapus.');
     } else {
         Session::flash('error', 'Gagal. Permarkahan gagal dihapus.');
     }
     return redirect()->back();