本文整理匯總了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);
}