app/Http/Controllers/Dashboard/UsersEmpController.php
/**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
Show the form for creating a new resource.
@return \Illuminate\Http\Response
Show the form for creating a new resource . @return \ Illuminate \ Http \ Response
public function create(pages $pages)
    {
        $pages = $pages->getall_pages();
        $data = [];
        $used = DB::table('users')
            ->select('employee_id')
            ->where('users.employee_id', '!=', 0)->get();
        foreach ($used as $user) {
            $data[] = $user->employee_id;
        }
        $employees = Employee::all()->whereNotIn('id', $data);
        return view('dashboard.usersemps.create', compact('pages', 'employees'));
    }
public function create ( pages $ pages ) { $ pages = $ pages -> getall_pages ( ) ; $ data = [ ] ; $ used = DB :: table ( 'users' ) -> select ( 'employee_id' ) -> where ( 'users.employee_id' , '!=' , 0 ) -> get ( ) ; foreach ( $ used as $ user ) { $ data [ ] = $ user -> employee_id ; } $ employees = Employee :: all ( ) -> whereNotIn ( 'id' , $ data ) ; return view ( 'dashboard.usersemps.create' , compact ( 'pages' , 'employees' ) ) ; }
Show the form for creating a new resource.
Show the form for creating a new resource .
//dd($pages); //$employees = Employee::all(); //dd($employees);