本文整理汇总了PHP中app\Company::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Company::paginate方法的具体用法?PHP Company::paginate怎么用?PHP Company::paginate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Company
的用法示例。
在下文中一共展示了Company::paginate方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$companies = Company::paginate($this->pageElements);
return view('site.index', ['companies' => $companies]);
}
示例2: activate
public function activate($id)
{
$company = Company::findOrFail($id);
$company->status = 'ACTIVE';
$company->save();
$date = new \DateTime();
DB::table('users')->where('company_id', $id)->update(array('status' => 'ACTIVE', 'active_date' => $date));
\Session::flash('message', 'You have successfully activated ' . $company->name);
$keyword = '';
$companies = Company::paginate(15);
return view('company.list', compact('companies', 'keyword'));
}
示例3: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$company = Company::paginate();
return view('settings.companys.index', compact('company'));
}
示例4: delete
/**
* Remove the specified resource from storage.
*
* @param int $id
* @return Response
*/
public function delete($id)
{
$company = Company::findOrFail($id);
//goals
DB::table('goal_managements')->whereIn('user_id', function ($query) use($company) {
$query->select('id')->from('users')->whereRaw('users.company_id = ?', array($company->id));
})->delete();
//points
DB::table('points')->where('company_id', '=', $company->id)->delete();
//points_audit
DB::table('point_audits')->where('company_id', '=', $company->id)->delete();
//sales
DB::table('sales')->where('company_id', '=', $company->id)->delete();
//sales_audits
DB::table('sale_audits')->where('company_id', '=', $company->id)->delete();
//user_passwords
DB::table('user_passwords')->whereIn('user_id', function ($query) use($company) {
$query->select('id')->from('users')->whereRaw('users.company_id = ?', array($company->id));
})->delete();
//users
DB::table('users')->where('company_id', '=', $company->id)->delete();
//company
DB::table('companies')->where('id', '=', $company->id)->delete();
\Session::flash('message', 'You have successfully delete ' . $company->name);
$keyword = '';
$companies = Company::paginate(15);
return view('company.list', compact('companies', 'keyword'));
}
示例5: index
public function index()
{
return view('company.index', ['companies' => \App\Company::paginate(10)]);
}
示例6: getAll
/**
* Get all of the companies
*
* @return Collection
*/
public function getAll()
{
return Company::paginate(15);
}