Browse AI Field GuideForum Podcast
All ThreadsLeaderboard
  1. Discussions

    1. Popular This Week
    2. Popular All Time
    3. Solved
    4. Unsolved
    5. No Replies Yet

charlieBrown's avatar

Rule::in not working when you have a null value

I have been browsing and I found out that I could filter vlues beeing present in array x. I'm using the Rule::into implode the array as the documentation suggests. I'm trying to use it to filter a pagination (I don't know if this is the correct method of doing it). Search controller $validator = Validator::make($request->all(), [ 'profissao' => 'required|p

charlieBrown's avatar
charlieBrown's avatar Snapey8yrs agoLaravel
3
1
Last reply by Snapey 8yrs ago
ahmednawazkhan's avatar

Laravel 5/ 5.4 paginator is not working in production environment

In my local environment i did ""$items = Model::paginate(10);"" and it worked. Then i pushed it to production and when i click on the pagination links it displays page 1 again and again. then i did ""dd($items)."" i found that the current Page property of ""length aware pagination"" is not changing when i change the

ahmednawazkhan's avatar
ahmednawazkhan's avatar quickbooks...8yrs agoLaravel
2
1
Last reply by quickbooksupport 8yrs ago
mouse's avatar

Vue Warn: method is not defined

Can anyone help me, what is wrong with my code? I am trying to do a CRUD with Laravel 5.4 + Vue 2 based by this website But I got this error on console log: [Vue warn]: Property or method "categories" is not defined on the instance but referenced during render. Make sure to declare reactive data properties in the data option. I saw similar problems on different websi

mouse's avatar
mouse's avatar topvillas8yrs agoVue
1
1
Last reply by topvillas 8yrs ago
altoin's avatar

Paginate Eloquent Result with Vue

Hello Everyone, i'm writing a quiz app in laravel,wanted to show one question per page, and realized i can't do it with laravel paginate because the radio button resets once the user moves to the next page. The code is working perfectly without pagination, but i will like to use Vue to paginate the questions. The problem i have now is how to get the questions and options to sho

altoin's avatar
altoin's avatar altoin9yrs agoCode Review
0
1
morkslagen's avatar

MethodNotAllowedHttpException after i use render function

i use render for pagination after i used i get this error Whoops, looks like something went wrong. 1/1 MethodNotAllowedHttpException in RouteCollection.php line 218: this my routes Route::post('Search/{menu1}/{menu2}/{menu3}/page','SearchController@search_test'); Route::get('Search/{menu1}/{menu2}/{menu3}','SearchController@search1'); this is my controller public function sear

morkslagen's avatar
morkslagen's avatar morkslagen9yrs agoLaravel
0
1
ratiw's avatar

Vuetable-2 Tutorial just got updated!

More new chapters including Moving Field Definitions to another file Passing Props to MyVuetable Converting template to render function Using Twitter's Bootstrap CSS with Vuetable Pagination for Twitter's Bootstrap https://github.com/ratiw/vuetable-2-tutorial/wiki

ratiw's avatar
ratiw's avatar ratiw9yrs agoVue
0
1
agCepeda's avatar

New way to paginate.

Hi! Everyone i recent become a laravel 5.4 user and i have some doubts about the pagination. In laravel 4.0 i used paginate using $queryBuilder->paginate($perPage, $page); but in this version it doesn't work. What is the way in this new version to paginate avoid using the query parameters in the url?. I want to have the flexibility to set the parameters directly in the que

agCepeda's avatar
agCepeda's avatar jlrdw9yrs agoLaravel
1
1
Last reply by jlrdw 9yrs ago
JorgeAnzola's avatar

Laravel 5.4 + jScroll.js not working

I'm trying to implement an infinite scrolling based on this tutorial. Couldn't be simpler, right? well... It's not working. This is my code here: In the route file (I didn't put it in a controller because was a simple test) Route::get('/', function(){ $articles = \App\Article::paginate(1); return view('home')->with('articles', $articles); }); In home.blade.php <div cl

JorgeAnzola's avatar
JorgeAnzola's avatar JorgeAnzol...9yrs agoJavaScript
2
1
Last reply by JorgeAnzola 9yrs ago
devEs's avatar

Paginator $elements variable access

I am using VueJs in my front-end, stumbled upon pagination and noticed something after I published the paginator. {{-- Pagination Elements --}} @foreach ($elements as $element) {{-- "Three Dots" Separator --}} @if (is_string($element)) <li class="uk-disabled"><span>{{ $element }}</span></li

devEs's avatar
devEs's avatar devEs9yrs agoLaravel
0
2
vipvipin's avatar

Show dynamic data in Data Table

I want to show limit data from database in data table in first time and click pagination link then show next limit data rows in data table. means i want to show data row in data table from data source Ajax sourced data with server-side processing

vipvipin's avatar
vipvipin's avatar topvillas9yrs agoJavaScript
2
1
Last reply by topvillas 9yrs ago
anangj's avatar

search data

I want to ask, I use search in laravel 5.4, tp when I type / not in type in search, (I directly click the search button without typing letters), it discharge even all the data on the table, Please help me search.blade.php @foreach ($grups_list as $key=> $grups) {{$grups->nama}} @endforeach controller public function search(Request $request) { $keyword = $request->in

anangj's avatar
anangj's avatar anangj9yrs agoLaravel
0
1
fenser's avatar

How to Get array variable values in JS and pass to Controller in GET method?

I have a JS script inside my blade page. The script is used to remove selected rows (using checkbox along with each row) in my pagination page. My Delete Selected rows button is found inside the form which method is GET. When the Delete Selected button is clicked the JS script works fine. It deletes the rows selected, however, I am not so familiar with JS scripting and I don't

fenser's avatar
fenser's avatar fenser9yrs agoJavaScript
1
1
Last reply by fenser 9yrs ago
xeeshan's avatar

multiple ajax calls in one controller function : HELP

Hello Guys im loading 2 arrays of data in one view code is below: public function index(){ $music=Feature::where('video_type', 'Music')->paginate(8); $fashion=Feature::where('video_type', 'Fashion')->paginate(8); return view('feature.index', compact('music', 'fashion')); } now im using pagination and rendring data in two different sections.. im showing pagination now

xeeshan's avatar
xeeshan's avatar Wiezo7yrs agoLaravel
2
1
Last reply by Wiezo 7yrs ago
SAM777's avatar

Help to convert SQL query into Eloquent?

I don't find easy tutorials in order to create complex queries into a DataBase, and as I am facing problems with pagination, using a raw query into DataBase, I prefer to convert it into a Eloquent model, and make pagination a straightforward process. There's the query I did so far: $comments = DB::select( DB::raw(" SELECT users.name, users.surname, users.image, reviews.com

SAM777's avatar
SAM777's avatar Snapey9yrs agoEloquent
4
1
Last reply by Snapey 9yrs ago
calampolow's avatar

multiple vuetable-2 doesn't work in multiple separate routes!

I'm using vuetable-2 by @ratiw in a project. I have tow vuetable instances in two separate route as: #/users #/news They fetch their data from two separated other links and works grate. But the problem is when I go over links for multiple times (tow or more) the Refresh button on top of tables doesn't work and cause an error: TypeError: Cannot read property 'refresh' of undefin

calampolow's avatar
calampolow's avatar calampolow8yrs agoVue
4
1
Last reply by calampolow 8yrs ago
thc1967's avatar

Vue 2 Component in Component, Prop Wrong Type

I'm writing a component inside a component. The inner component is a very basic paginator. My goal is to do something like this in the pagination control: <pagination :current-page="10" :page-count="100" :visible-pages="5" @page-clicked="onPageClicked"

thc1967's avatar
thc1967's avatar thc19679yrs agoVue
5
1
Last reply by thc1967 9yrs ago
jbowman99's avatar

Custom CSS for laravel paginator

Is there a good tutorial on doing custom CSS for the laravel pagination links? currently using {!! $model->links() !!} works fine, would like to change the look of it, but maintain the same functionality that's already baked in.

jbowman99's avatar
jbowman99's avatar mdecooman9yrs agoLaravel
1
1
Last reply by mdecooman 9yrs ago
badr's avatar

the correct way to use makeHidden in laravel

Hi , I have problem with the pagination . everything work fine without error but the problem is when i use makeHidden with my code it change the structure of my json pagination result this is my code . $result = Job::where('user_id','=',Auth::id())->paginate(5); $result= $result->makeHidden(['hasMessage']); without the second line the result is { total: 1 ,

badr's avatar
badr's avatar Snapey4yrs agoLaravel
5
2
Last reply by Snapey 4yrs ago
nikocraft's avatar

how to call links() with after ajax update?

Is it possible to regenerate pagnation after I have made ajax call that changes number of pages that would be returned? this is how I call it in the blade $comments->links() but after I made ajax call I would like to regenerate pagination without having to reload the page, has anyone done it and how?

nikocraft's avatar
nikocraft's avatar Alphabets7yrs agoLaravel
6
1
Last reply by Alphabets 7yrs ago
aurawindsurfing's avatar

SyntaxError: illegal character

Hi, I'm new to vue but managed to buid a vue + blade + algolia search with pagination. Everything works fine but I'm puzzled with illegal character error when I try to add new method to the method section in my vue app. Please see below 2 examples: no errors: new Vue({ el: '#app', data: { query: '', classifieds: [], currentPage: 0

aurawindsurfing's avatar
aurawindsurfing's avatar aurawindsu...9yrs agoVue
3
1
Last reply by aurawindsurfing 9yrs ago
aareyes00's avatar

Parent and Component not working

Hi I have a table which I want to implement a pagination also. This is my parent vue page <template> <div class="wrapper-content"> <div class="container is-fluid m-t20"> <div class="columns"> <div class="column is-fullwidth"> <h3>Registration Req

aareyes00's avatar
aareyes00's avatar aareyes009yrs agoVue
0
1
Ifrit's avatar

Getting the same page in my comment section when going next

I've created a comment section that has laravel's pagination. What I'm trying to do is use jquery so that I don't have to reload the page and the url stays the same. I've almost got it to work the problem I'm having is that I get a copy of my page in the comments section. I kind of have an idea of why it is happening but I'm not sure on how I should fix it. What I think is happ

Ifrit's avatar
Ifrit's avatar Ifrit9yrs agoLaravel
2
1
Last reply by Ifrit 9yrs ago
Ifrit's avatar

Blank page when going next page with jquery

I'm trying to use jquery to go to the next page of my comments using laravel's pagination. The problem I'm having is that I'm getting a blank page but in my firebug under "network" I do see my page 2 comments. my comments.blade.php @extends('templates::layouts.public') @section('content') <div class="row"> <div class="col lg-12"&g

Ifrit's avatar
Ifrit's avatar Ifrit9yrs agoLaravel
0
1
CarlosGHRS's avatar

Paginate problem

Hello guys, i've been having a problem with the pagination, i have a schedule table(ferry trips) and i add it a "search - filter" button, i have it with pagination of 20, and i have a route(different schedules in different routes) with over 60 register, so with i filter to get that info i only get it to display correct the first page, but when i clic on the second pa

CarlosGHRS's avatar
CarlosGHRS's avatar CarlosGHRS9yrs agoEloquent
3
1
Last reply by CarlosGHRS 9yrs ago
hillcow's avatar

Paginate blog example from "Laravel 5.4 from Scratch series"

Hi there, I followed the Laravel 5.4 from Scratch series and am currently trying to implement pagination into the blog example. It's easy to get pagination for the homepage: Post::latest()->filter(request(['month', 'year']))->simplePaginate(5); Problem: paginate() or simplePaginate() cannot be called like this: public function index(Tag $tag){ $posts = $tag->posts->

hillcow's avatar
hillcow's avatar fraserk9yrs agoEloquent
2
1
Last reply by fraserk 9yrs ago
hillcow's avatar

Paginate blog example from "Laravel 5.4 from Scratch series"

Hi there, I followed the Laravel 5.4 from Scratch series and am currently trying to implement pagination into the blog example. It's easy to get pagination for the homepage: Post::latest()->filter(request(['month', 'year']))->simplePaginate(5); Problem: paginate() or simplePaginate() cannot be called like this: public function index(Tag $tag){ $posts = $tag->posts->

hillcow's avatar
hillcow's avatar jlrdw9yrs agoEloquent
5
1
Last reply by jlrdw 9yrs ago
mbmohib's avatar

Retrieving all the videos from a spicific channel using Youtube Data API

I'm developing an app where I've to retrieve all the videos from a specific channel, I've used Alaouy Package but it only return 50 videos, there is a instruction for pagination for search but not for list! Now is there any other package or other way to retrieve all videos using this package? Or I've to write it from scratch ?

mbmohib's avatar
mbmohib's avatar mbmohib9yrs agoLaravel
0
1
JuD3's avatar

Page error after performing search Laravel 5.4.8

Hi Community I just started learning laravel about a month ago and have run into a problem. I am trying to perform a search using formdata. First problem is the data passed is empty and I don't know why. Secondly when I perform the search it gives an error that it can't find the "vehicles" variable. also in chrome it gives an internal error. public function searchVehi

JuD3's avatar
JuD3's avatar JuD39yrs agoLaravel
0
1
sago555's avatar

laravel 5.2 vendor publish not work

I try to load file vendor in my ressource folder for change pagination code. When i try the php artisan like this php artisan vendor:publish I have this message that tells me that it worked well Publishing complete for tag []! but i have noting vendor folder en my ressource forlder. I try this but not work php artisan config:clear and composer dump-autoload -o php artisan vendo

sago555's avatar
sago555's avatar sago5559yrs agoLaravel
0
1
esspyca's avatar

Class 'Illuminate\Pagination\BootstrapPresenter' not found

Hi, I'm kinda new to laravel but I'm starting to get a hold of it. But this one, I really can't figure it out. I started learning the pagination principles in Laravel and I wanted to customize the slider. Everywhere I look, they use BootstrapPresenter but I don't have that in the pagination folder under vendor.. so I get Class 'Illuminate\Pagination\BootstrapPresenter' not fou

esspyca's avatar
esspyca's avatar esspyca9yrs agoLaravel
4
1
Last reply by esspyca 9yrs ago
Leff7's avatar

Angular 2 - template parse error for an input parameter in the component

I am paginating posts in my component and I am sending the number of posts from the post component to pagination component to like this: <pagination [items]="posts.length" (page-changed)="onPageChanged($event)"></pagination> I have set up the pagination component and the parameter items like so: export class PaginationComponent implements OnChan

Leff7's avatar
Leff7's avatar Leff79yrs agoJavaScript
0
1
SpuriouslyAwake's avatar

Model::all() but return Eloquent Builder instead of Collection

Is there an equivalent of the all() scope that returns an instance of Eloquent Builder instead of Collection. I need to chain some queries together and end with pagination, like this: $users = User::where('id','!=', 0); // not very beautiful if($filterA){ $users = $users->whereHas('thing'); } if($filterB){ $users = $users->where('other_thing', 'some_value'); }

SpuriouslyAwake's avatar
SpuriouslyAwake's avatar lem939yrs agoEloquent
6
4
Last reply by lem93 9yrs ago
filaret's avatar

How to order and sort data by relations?

Currently I have this code in controller and it works. I am grabbing all urls including category (url can have only 1 category) and only latest 2 analytics row for each url. How can I get data sortable by Category name (asc and desc) and also by Analytics quality column (asc and desc)? Is it possible to do it cleanly with a query or do I have to loop through all this data afte

filaret's avatar
filaret's avatar filaret9yrs agoEloquent
0
1
yelnya's avatar

Infyom Generator: paginate command not generating according to input

I am using Laravel Infyom generator to generate from a table with this command: php artisan infyom:api_scaffold --fromTable --tableName= --primary= --paginate=15 --save but after the files are generated, in the view, the pagination per page is still 10 http://prntscr.com/eedbbt I am using "yajra/laravel-datatables-oracle" with infyom. I tried changing value to '15',

yelnya's avatar
yelnya's avatar yelnya9yrs agoLaravel
0
1
see_kay's avatar

"Real world" example of CRUD w/ Laravel & Vue (non SPA)

"Real world" example of CRUD w/ Laravel & Vue (non SPA) Hi, I've been learning Laravel these last few weeks and making progress. Then I started to look into using Vue to offer a better user experience (instant feedback, remote validation etc) but then am stuck for the last few days. I'm just trying to build a standard business/project management application with t

see_kay's avatar
see_kay's avatar see_kay9yrs agoLaravel
5
1
Last reply by see_kay 9yrs ago
kickthemooon's avatar

Call to undefined method Laravel\Scout\Builder::skip()

I am trying to implement search with load more button instead of pagination. Unfortunately it seems that scout has only the take() method but no skip() method? I am searching for ideas, any suggestions?

kickthemooon's avatar
kickthemooon's avatar kickthemoo...9yrs agoLaravel
0
1
eskiesirius's avatar

Problem with Table and toggle button

I just created a table with a dropdown menu in it but the problem is that when i click the dropdown it will open all the menu in the table. I just want to open the specific dropdown that i clicked. <template> <div> <table class="table table-bordered"> <thead> <tr> <th>#<

eskiesirius's avatar
eskiesirius's avatar hendranucl...9yrs agoVue
5
1
Last reply by hendranucleo 9yrs ago
maifat's avatar

Nested models with parent-child relationship and search by child

Laravel 5.3 PHP 5.4 MySQL 5.55 I am struggling with Laravel 5 nested models with a parent-child relationship. I have a page, let's call it the Article, where I get elements in an certain order. Text - it is just a text entity. But Album consist of Stacks (from 1 to n) in an certain order. Any Stack consist of Images (from 1 to n) in an certain order. My design for DB is Article

maifat's avatar
maifat's avatar maifat9yrs agoEloquent
0
1
Leff7's avatar

Laravel - Displaying paginated results in tabs content

I am displaying paginated results that I get from Algolia. I have two queries in my controller that I paginate. This is how I send the data from the controller to the view: public function index(Request $request) { if (!$request->q) { return redirect('/'); } $players = Player::search($request->q)->paginate(1); $videos =

Leff7's avatar
Leff7's avatar Leff79yrs agoEloquent
0
1
ucrisko's avatar

Access Vue Property on ready/computed

I have a Pagination component. For this component, I need to access the 'paginateditems' property on page load to obtain the total pages for the paginator. I try to do this on both ready and created, but each time I get an error that the property is 'undefined' props: ['paginateditems'], ready: function() { console.log(this.paginateditems.total_pages) //returns

ucrisko's avatar
ucrisko's avatar ucrisko9yrs agoVue
0
1
gabrielbuzzi's avatar

Fractal Transformer a lot of queries

I'm using the package spatie/laravel-fractal I don't know if this is a problem or just the way fractal works, but when i include a fractal transformer in another i get a new query for each result of the first transformer. In other words, if i list Users and include the Roles, for each user i will have a query to get the roles. UserController (Only the method here) public functi

gabrielbuzzi's avatar
gabrielbuzzi's avatar gabrielbuz...9yrs agoLaravel
1
1
Last reply by gabrielbuzzi 9yrs ago
peterlee's avatar

Is there any efficient way to calculate distance using eloquent ?

What I am trying to do is calculate physical distance from user's location to a restaurant that has coordinate in database so database table has two column, latitude and longitude. and user's location will be given by using $userLatitude = $request['user_latitude'] $userLongitude = $request['user_longitude']; so distance between a user and a restaurant will be distance = funct

peterlee's avatar
peterlee's avatar spekkionu9yrs agoEloquent
6
1
Last reply by spekkionu 9yrs ago
moses's avatar

How to display content by page number clicked on the vue js 2?

My view is like this : <!DOCTYPE html> <html> <head> <title>Laravel</title> <link rel="stylesheet" href="//cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.min.css"> </head> <body> <div class="container"> <div class="col-md-8 col-md-offset-2"> <div i

moses's avatar
moses's avatar moses9yrs agoVue
0
1
Orgil's avatar

Laravel paginate ajax search

How to paginate the result of ajax search. In Laravel pagination is quite easy. In my situation using ajax search with parameters making it complicated. I hope someone encountered with same issue. Search Form <form class="" action="studentSearch" method="get" id="formSearchStudent"> <label class="col-sm-1 contr

Orgil's avatar
Orgil's avatar jlrdw9yrs agoLaravel
1
1
Last reply by jlrdw 9yrs ago
artem's avatar

Load a lot of data from model into client

Hello all. I have a problem with understanding a logic of a case. I have task of displaying employee list on a page from database with full search and filter possibilities. I have choose vue-tables-2 for this because if i will make search and filter in server side, it can provide a lot of unnecessary database requests. There is simple way load api with axios and pass data into

artem's avatar
artem's avatar artem9yrs agoLaravel
5
1
Last reply by artem 9yrs ago
saleh_mir's avatar

How to do whereNotIn() in Redis results

Hey guys I’m using Laravel’s pagination to fetch some results from the database, and since users are able to block some results I’m doing whereNotIn() in my queries. And now I’m trying to implement the same using Redis. How can I accomplish the same thing here? (right now I’v come up with removing the blocked ones using PHP, but that kind of screws the whole pagination thing. F

saleh_mir's avatar
saleh_mir's avatar saleh_mir9yrs agoEloquent
0
1
sherwinmdev's avatar

Tip: Using Bootstrap 4 alpha 6 with Laravel 5.4

just wanted to share what i did to be able to use bootstrap 4 alpha 6 with laravel 5.4. i did this on an empty project. remove the bootstrap entry from package.json and replace it with "bootstrap": "4.0.0-alpha.6", in resources/assets/sass/app.scss, comment out the import of variables. change the path of bootstrap to @import "node_modules/bootstrap/sc

sherwinmdev's avatar
sherwinmdev's avatar TinoN8yrs agoTips
21
2
Last reply by TinoN 8yrs ago
tunale's avatar

LengthAwarePaginator data field is an Object not an Array

I'm using the LengthAwarePaginator façade in this way because I have to paginate a raw query, so I cannot simply concatenate the paginate() method. $currentPage = LengthAwarePaginator::resolveCurrentPage(); $perPage = 10; $results = $teachers->slice(($currentPage-1) * $perPage, $perPage)->all(); $pagination = new LengthAwarePaginator( $results,

tunale's avatar
tunale's avatar tunale9yrs agoLaravel
0
1
derrekbertrand's avatar

Unsolicited API Advice from someone who has been there

In the 2016 Laravel Survey, one of the most asked for features was "Helper classes and methods for API development". I very much agree. I've utilized no less than three open source libraries for APIs in Laravel, two of which are touted as being "for Laravel" or having a "Laravel wrapper". Bollocks. The current implementations that we have of RESTfu

derrekbertrand's avatar
derrekbertrand's avatar jimmck9yrs agoLaravel
1
1
Last reply by jimmck 9yrs ago
neovive's avatar

When to use components?

I'm new to component-based design with Vue and was hoping someone could share their experience regarding breaking up websites into components. Specifically, how do you determine when to use a component vs. plain HTML/Blade? My thinking is to stick with HTML/blade views for page layout and basic elements (section, article, header, footer, main) and use Vue components for reusabl

neovive's avatar
neovive's avatar neovive9yrs agoVue
2
1
Last reply by neovive 9yrs ago

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.

Want us to email you occasionally with Laracasts news?

Nine out of ten doctors recommend Laracasts over competing brands. Come inside, see for yourself, and massively level up your development skills in the process.

Learn
BrowseSeriesCreatorSeriesLaravel PathLarabitsPlayground
Discuss
ForumPodcastSupport
Extras
Gift CertificatesApparelFAQiOS AppTerms
Social
X(Twitter)TikTokYoutube

© Laracasts 2026. All rights reserved. Yes, all of them. That means you, Todd.

Proudly hosted with Laravel Forge and DigitalOcean.