public function salaryEdit($code)
 {
     $str = explode(",", $code);
     $type = $str[0];
     $id = $str[1];
     $user = User::findOrFail($id);
     $comp = \CTCComponent::where('is_active', '=', 'yes')->get();
     return View::make('template.salary_edit')->with('comp', $comp)->with('type', $type)->with('user', $user);
 }
Example #2
0
function ctcComponent()
{
    $ctc = CTCComponent::get();
    return $ctc;
}
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     $del = \CTCComponent::findOrFail($id);
     $column = $del->component_name;
     if ($del->delete()) {
         \Schema::table('salary_package', function ($t) use($column) {
             $t->dropColumn($column);
         });
         return \Redirect::back()->with('success', 'Successfully deleted');
     }
 }