本文整理汇总了PHP中app\Page::paginate方法的典型用法代码示例。如果您正苦于以下问题:PHP Page::paginate方法的具体用法?PHP Page::paginate怎么用?PHP Page::paginate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类app\Page
的用法示例。
在下文中一共展示了Page::paginate方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
public function index()
{
$pages = Page::paginate(15);
return view('dashboard.page.index', compact('pages'));
}
示例2: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
$list = Page::paginate(10);
return view('page.list', compact('list', $list));
}
示例3: index
/**
* Show the form for editing the specified resource.
*
* @param int $id
*
* @return Response
*/
public function index()
{
$page = Page::paginate(15);
return view('blog.index', compact('page'));
}
示例4: page
/**
* 单页内容列表
*/
public function page()
{
$data = Page::paginate(15);
return view('backend.article.page', ['data' => $data]);
}
示例5: index
/**
* Display a listing of the resource.
* @return Response
*/
public function index()
{
$pages = Page::paginate(15);
$this->checkPagination($pages);
return View::make('pages.index')->with('pages', $pages);
}
示例6: pages
public function pages()
{
$pages = Page::paginate(15);
return view('admin.pages', compact('pages'));
}
示例7: index
function index(Request $request)
{
$userdetails = $this->forUser($request->user());
if ($userdetails) {
foreach ($userdetails as $val) {
$description = isset($val->description) ? $val->description : '';
$image_name = isset($val->image_name) ? $val->image_name : '';
$user_id = isset($val->user_id) ? $val->user_id : '';
}
}
$user_reg_detail = User::where('id', $request->user()->id)->get();
foreach ($user_reg_detail as $val) {
$username = isset($val->name) ? $val->name : '';
$useremail = isset($val->email) ? $val->email : '';
$userpassword = $val->password;
}
$userdetail = ['description' => isset($description) ? $description : '', 'name' => $username, 'email' => $useremail, 'image_name' => $image_name != '' ? $image_name : ''];
if ($request->isMethod('post')) {
$inputData = ['description' => $request->description];
if ($request->hasFile('profileimage')) {
$image = $request->file('profileimage');
if ($image->getClientOriginalExtension()) {
$original_filename = 'original' . time() . '.' . $image->getClientOriginalExtension();
$small_filename = '40_' . time() . '.png';
$medium_filename = '100_' . time() . '.png';
$big_filename = '800_' . time() . '.png';
// $path_original = public_path('images/'.$original_filename);
// $path_small = public_path('images/'.$small_filename);
// $path_medium = public_path('images/'.$medium_filename);
// $path_big = public_path('images/'.$big_filename);
//Upload image to dir with the help of serviceProvider.
$uploadPath = 'images/';
$desire_upload_path = $this->filePathaObj->create_directory_image_upload($uploadPath);
$path_original_dir = $desire_upload_path . $original_filename;
$path_small_dir = $desire_upload_path . $small_filename;
$path_medium_dir = $desire_upload_path . $medium_filename;
$path_big_dir = $desire_upload_path . $big_filename;
Image::make($image)->save($path_original_dir);
Image::make($image)->fit(40)->sharpen(15)->save($path_small_dir);
Image::make($image)->fit(100)->save($path_medium_dir);
Image::make($image)->fit(800, 600, function ($constraint) {
$constraint->upsize();
})->save($path_big_dir);
} else {
exit('Format not supported');
}
$inputData['image_name'] = $path_medium_dir;
}
$userData = ['name' => $request->name, 'email' => $request->email];
if (isset($request->password) && $request->password != '' && $userpassword != bcrypt($request->password)) {
$userData['password'] = bcrypt($request->password);
}
if (!$user_id) {
$request->user()->editprofiles()->create($inputData);
//order_detail()
////orderDetail()
// $edit = new Editprofile();
// $edit->description = $request->description;
// $edit->user_id = $request->user()->id;
// $edit->save();
} else {
Editprofile::where('user_id', $request->user()->id)->update($inputData);
//For Authorization Testing
// $editprofileobj = new Editprofile();
// $this->authorize('update_editprofile', $editprofileobj );
// $t = Auth::user()->can('update_editprofile',$editprofileobj);
// dd($t);
// $this->update_editprofile(Request $request);
//Don't delete it Event fired when update detail of user.
//Event::fire(new SomeEvent());
User::where('id', $request->user()->id)->update($userData);
return redirect()->back()->withInput();
}
} else {
$pagedetail = Page::paginate(5);
$priceLib = new PriceLibrary();
$prices = $priceLib->getPrices();
// $value = $request->session()->get('client_session_array');
// $user_type = $value['user_type'];
// dd($user_type);
return view('user/editprofile', ['userdetail' => $userdetail, 'pagedetail' => $pagedetail, 'prices' => $prices]);
}
}
示例8: index
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('page.index', ['pages' => Page::paginate(10)]);
}