本文整理汇总了PHP中app\Employee::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Employee::all方法的具体用法?PHP Employee::all怎么用?PHP Employee::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Employee
的用法示例。
在下文中一共展示了Employee::all方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
public function create()
{
$input = Input::all();
$customers = Customer::all();
$salesmen = Employee::all();
return view('return.create', compact('input', 'customers', 'salesmen'));
}
示例2: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
// Get all of the models from the database in a collection sorted by name field
$employees = Employee::all()->sortBy('name');
// Passes the collection of model instances in JSON format to the view for listing
return view('phonebook.index', ['employees' => $employees]);
}
示例3: getAssigntarget
public function getAssigntarget()
{
$employee = Employee::all();
$categories = Event::all();
$userdetails = User::all();
$targets = Targetassign::all();
$deals = Deal::all();
$userData = array();
$key = 0;
foreach ($targets as $target) {
$achieved = 0;
$userData[$key]['eventcode'] = $target->Eventcode;
$userData[$key]['event'] = $target->Eventname;
$userData[$key]['employee'] = $target->Employeeid;
$userData[$key]['targetVal'] = $target->Targetvalue;
foreach ($deals as $deal) {
if ($target->Eventcode == $deal->Eventcode && $target->Employeeid == $deal->Empid) {
$achieved = $achieved + $deal->Dealvalue;
}
}
$userData[$key]['achieved'] = $achieved;
$userData[$key]['variance'] = $achieved - $target->Targetvalue;
$userData[$key]['cur'] = $target->Currency;
$key++;
}
return View('approval/assigntarget')->with(array('categories' => $categories, 'employee' => $employee, 'userdata' => $userData, 'targets' => $targets, 'eventtable' => $categories));
}
示例4: __construct
public function __construct()
{
$count = Employee::count();
$countProj = Project::count();
$data = Employee::all();
$YourRole = "";
if (count(Auth::user()) > 0) {
$YourRole = Auth::user()->UserRoles->role;
}
$Role2 = $this->Role1;
// Count Unconfirmed
$cc = 0;
foreach ($data as $da) {
if ($da->confirm == 0) {
$cc++;
}
}
$countConf = $cc;
// Count Confirmed
$cc1 = 0;
foreach ($data as $dat) {
if ($dat->confirm == 1) {
$cc1++;
}
}
$countConfirmed = $cc1;
View::share('countConf', $countConf);
View::share('YourRole', $YourRole);
View::share('countConfirmed', $countConfirmed);
View::share('count', $count);
View::share('countProj', $countProj);
}
示例5: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$employee_ids = Employee::all()->lists('id')->toArray();
$order_states = OrderState::lists('id')->toArray();
$products = Product::all();
$municipalities = Municipality::all();
factory(App\Customer::class, 50)->create()->each(function ($customer) use($employee_ids, $products, $municipalities, $order_states) {
shuffle($employee_ids);
shuffle($order_states);
$customer->user()->save(factory(User::class, 'customer')->create());
$customer->city_id = $municipalities->shuffle()->first()->id;
$customer->save();
$customer->products()->attach($products->shuffle()->first(), ['vote' => rand(1, 5), 'created_at' => Carbon::now(), 'updated_at' => Carbon::now()]);
$customer->orders()->save(factory(App\Order::class)->create(['acquired_by' => $employee_ids[0], 'state_id' => $order_states[0]]));
});
$user = new User();
$user->name = 'Vid';
$user->surname = 'Mahovic';
$user->email = 'vid.mahovic@gmail.com';
$user->password = 'vid123';
$user->verified = true;
$user->save();
$customer = new Customer();
$customer->street = 'Celovška 21';
$customer->city_id = $municipalities->shuffle()->first()->id;
$customer->phone = '+38640850993';
$customer->save();
$customer->user()->save($user);
}
示例6: getData
/**
* Show the form for creating a new resource.
*
* @return Response
*/
public function getData()
{
if (!\Request::ajax()) {
\App::abort(404, 'not found naja');
}
$data = App\Employee::all();
return \Response::json($data);
}
示例7: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$faker = \Faker\Factory::create();
$rows = Employee::all();
foreach ($rows as $row) {
Employee::find($row->id)->account()->where('employee_id', $row->user_id)->update(['access_level' => $faker->randomElement(['User', 'Admin']), 'status' => $faker->randomElement(['Active', 'Deactivated']), 'password' => bcrypt('8d')]);
}
}
示例8: getIndex
public function getIndex()
{
$categories = Event::all();
$employee = Employee::all();
$invoice = Invoice::all();
$invnull = Invoice::where('Status', '=', 'Null')->get();
return View('home2')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull));
}
示例9: run
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$all_emp = Employee::all();
$dev_number = Device::all()->count();
$dev_list = range(1, $dev_number);
foreach ($all_emp as $employee) {
$employee->devices()->attach($dev_list[array_rand($dev_list)]);
}
}
示例10: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$data = Employee::all();
$name = Auth::user()->name;
$pos = ProjectOfficer::all();
$adms = Admin::all();
$tls = Teamleader::all();
$mems = Member::all();
return view('dropmin.dashboard.index')->with('data', $name)->with('pos', $pos)->with('adms', $adms)->with('tls', $tls)->with('mems', $mems)->with('data', $data);
}
示例11: testChildModelKeepsScope
public function testChildModelKeepsScope()
{
factory(User::class, 2)->create(['type' => Employee::class]);
factory(User::class)->create(['type' => null]);
$employees = Employee::all();
$this->assertCount(2, $employees);
$employees->each(function ($employee) {
$this->assertInstanceOf(Employee::class, $employee);
});
}
示例12: getHome
public function getHome()
{
$varr = Auth::user()->empid;
$evarr = User::where('empid', $varr)->get();
$edetails = Employee::where('emp_ide_id', $varr)->get();
$categories = Event::all();
$employee = Employee::all();
$invoice = Invoice::all();
$invnull = Invoice::where('Status', '=', 'Null')->get();
return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails));
}
示例13: index
/**
* Display list device be assigned to
*
* @return Response view
*/
public function index()
{
$devices = Device::all();
$employees = Employee::all();
$employall = array();
$employall += array('0' => 'None');
foreach ($employees as $key => $value) {
$employall += array($value->id => $value->lastname . " " . $value->firstname);
}
$statusall = StatusDevice::lists('status', 'id');
return view('devices.borrow', compact('devices', 'employall', 'statusall'));
}
示例14: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$interviews = Candidate::where('status_record_id', 3)->get();
$employees = Employee::all();
$employall = array();
$employall += array('0' => 'None');
foreach ($employees as $key => $value) {
$employall += array($value->id => $value->lastname . " " . $value->firstname);
}
$statusrecord = StatusRecord::lists('name', 'id');
return view('employee.interview', compact('statusrecord', 'interviews', 'employall'));
}
示例15: getHome
public function getHome()
{
$year = date("Y");
$varr = Auth::user()->empid;
$evarr = User::where('empid', $varr)->get();
$edetails = Employee::where('emp_ide_id', $varr)->get();
$categories = Event::where(DB::raw('year(date)'), $year)->get();
$employee = Employee::all();
$invoice = Invoice::orderBy('Id', 'DESC')->where(DB::raw('year(InvoiceDate)'), $year)->where(DB::raw('year(DueDate)'), $year)->get();
$invnull = Invoice::where('Status', '=', 'Null')->get();
return View('reviewer/home')->with(array('categories' => $categories, 'employee' => $employee, 'invoice' => $invoice, 'invnull' => $invnull, 'edetails' => $edetails));
}