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

colbyalbo's avatar

Alpine Modal components in a Livewire Loop

Hello, has anyone else had issues with getting Alpine modals to work within a livewire data table? They work at first, and after a few searches, sorts and back and forth with the pagination, the modal lose the events. I've tried adding the wire:key in a few places to no avail, any help is appreciated, thanks! index.blade.php <x-admin> <div class="flex justify-

colbyalbo's avatar
colbyalbo's avatar colbyalbo5yrs agoLivewire
1
1
Last reply by colbyalbo 5yrs ago
Gabotronix's avatar

React Native: trying to pass a reference function via props

Hi everybody, I created a reusable FlatList component which implements pagination, I'm trying to pass via props a function which makes an axios call and retrieves data from backend to populate the FlatList, however I'm getting the following error: TypeError: [endAction] is not a function Also this one: TypeError: [store][action] is not a function This is how I pass props to m

Gabotronix's avatar
Gabotronix's avatar Gabotronix5yrs agoReact
0
1
Rod2rick's avatar

Can't display image on Bootstrap-vue Datable

Hello, i can't display the image on my Bootstrap-vue Datable here is my code <b-table :striped="striped" :bordered="bordered" :borderless="borderless" :outlined="outlined" :sort-by.sync="sortBy"

Rod2rick's avatar
Rod2rick's avatar Rod2rick5yrs agoVue
6
1
Last reply by Rod2rick 5yrs ago
CPHM's avatar

Comments on Automatic API filter and sort Trait

I'm building an API with Laravel and came across the problem of filtering and sorting, after some research and stumbling upon this helpful article I decided on using RHS Colon for filtering and sorting and built in Laravel way of pagination. Sample URL: /users?full_name=start:ali&sort_by=last_name:asc&perPage=10&page=3 Being a bit lazy I don't want to write all the

CPHM's avatar
CPHM's avatar CPHM5yrs agoGeneral
0
1
tehseen's avatar

How to redirect to page when press enter.

i have a pagination this on my shop page https://ibb.co/PMR1xst I want to write number in center textbox and press enter and it will redirect me to that page. Is it possible ? if so how ? Regards

tehseen's avatar
tehseen's avatar ftiersch5yrs agoGeneral
1
1
Last reply by ftiersch 5yrs ago
lukegalea16's avatar

Livewire Datatables

Is anyone using Livewire Datatables and can give his/her opinion on them? So far I've used Livewire with a Load More functionality. Livewire Datatables seems convenient and neat to use as opposed to bootstrap tables and implementing pagination from Livewire. Thoughts?

lukegalea16's avatar
lukegalea16's avatar lukegalea1...4yrs agoLaravel
6
1
Last reply by lukegalea16 4yrs ago
SarahS's avatar

Render()

I've been following a tutorial on setting up a simple Posts system and on the display page after the foreach() that shows all the Posts, it has this: {!! $posts->render() !!} Looking into it it seems to be something to do with the pagination but I'd like to know exactly what this means?

SarahS's avatar
SarahS's avatar SarahS745yrs agoLaravel
5
1
Last reply by SarahS74 5yrs ago
jgravois's avatar

Livewire-DataTable -- Filtering

I have a massive dataset so pagination is essential. Following the excellent videos on datatables by Caleb, I have the following working query/pagination combo: public function getRowsQueryProperty() { $query = PartMaster::query() ->when($this->filters['cat'], fn($query) => $query->where('cat', $this->filters['cat'])) ->when

jgravois's avatar
jgravois's avatar jgravois5yrs agoLivewire
4
1
Last reply by jgravois 5yrs ago
nilsringersma's avatar

Collection orderBy url ignore protocol and www subdomain

Hello everyone, I'm working on a project where I'm retrieving a collection. The model I'm retrieving has a property url where an url is stored. This url can be something like https://laracasts.com or http://laracast.com or https://www.laracasts.com. I am ordering and paginating the collection using $models->orderBy('url', 'ASC')->paginate(); which is working as expected h

nilsringersma's avatar
nilsringersma's avatar nilsringer...5yrs agoEloquent
4
1
Last reply by nilsringersma 5yrs ago
brad_youhq's avatar

Force fresh HTTP Client each call

Hey Gang I am using the Laravel HTTP client to fetch products from Shopify. When I do a pagination call on the products, Shopify responds with an Invalid Key. The initial page request contains basic authentication then the following pages hit the Shopify endpoint with a parameter Shopify provides to fetch the next pages. The same call works when I swap my code to use Curl inste

brad_youhq's avatar
brad_youhq's avatar brad_youhq5yrs agoLaravel
0
1
webfuelcode's avatar

Paginate for posts under category

Trying to show the latest posts with pagination. $subposts = Category::with(['posts', 'children.posts'])->where('id', $category->id)->first(); Tried get(), latest() but sometimes it says property does not found and sometimes collection error. I have a page designed for subcategory and post list on two columns.

webfuelcode's avatar
webfuelcode's avatar Mirlan Bek...5yrs agoLaravel
1
1
Last reply by Mirlan Bekturov 5yrs ago
umefarooq's avatar

How to paginate multiple morphed relations.

I am sharing folders and images with many to many morph. i am saving folder and images details in folder and images table. while sharing them saving basic info in share folder and folder and images id in morphed shareable table. i want to paginate both relations in 1 query here are my models Images Model class Image extends Model { public function folder() {

umefarooq's avatar
umefarooq's avatar umefarooq5yrs agoEloquent
0
1
RoyGoode's avatar

changing resource controller to livewire component

I'm using Laravel blade system only for admin panel,so how to change all resource controller,routes and blades to livewire component? and is this necessary? There is an issue in this case : livewire overwrite the default pagination of laravel and because we use bootstrap css and blade system for admin panel, default pagination gets the tailwind css with bad style.

RoyGoode's avatar
RoyGoode's avatar srasch5yrs agoLivewire
1
1
Last reply by srasch 5yrs ago
fdusautoir's avatar

Not hint path defined for [livewire]

Hi everyone, My app works really well in local environment put when I put it on production on pages which uses Livewire pagination, I have this error : https://flareapp.io/share/KPgDZ1q7#F64 For me, this is not a question to put the package provider on the config/app or to add something on the AppServiceProvider. This is an issue which have to be resolve, not bypass 😉 If if do

fdusautoir's avatar
fdusautoir's avatar fdusautoir5yrs agoLaravel
1
1
Last reply by fdusautoir 5yrs ago
Antonella's avatar

filtar table dropdown livewire

I have this livewire component which filters a table based on the two dropdown buttons. one is called Instance and the other Job. I would like to find a way to filter both buttons. in this way or I pass it to render updatejob or updateinstance. So only one of the two buttons works. is there any way to make them both work? in the sense that if I use a public variable to which I

Antonella's avatar
Antonella's avatar Snapey5yrs agoLivewire
1
1
Last reply by Snapey 5yrs ago
kovbo's avatar

Order by relations field

I want to order results by relations and apply pagination. Let's say we need to order users by their role in the profiles table To do so, you have to join the profiles table: User::join('profiles', 'users.id', '=', 'profiles.user_id') ->orderBy('role') ->paginate(10); It works, but it always gives random results. For example, If I have 100 users with identical role,

kovbo's avatar
kovbo's avatar kovbo5yrs agoEloquent
2
1
Last reply by kovbo 5yrs ago
hadihassan09's avatar

Livewire throwing error when using paginated data

So I am being given this error when trying to paginate my data and send it in to a view through a livewire component. I am trying to get all posts and display at max 5 posts per page using pagination in laravel. Livewire version: 2.3.1 Laravel version: 8.13.0 Error: Livewire\Exceptions\PublicPropertyTypeNotAllowedException Livewire component's [user-posts] public property [post

hadihassan09's avatar
hadihassan09's avatar GabrielGon...3yrs agoLivewire
3
1
Last reply by GabrielGongora 3yrs ago
chrisgrim's avatar

Need help using setRelations correctly

Hi, I am trying to gather all the past and current events for multiple organizers owned by the user and pass it to the view with pagination. I am so close, but hitting a problem. In my controller I have $organizers = auth()->user()->organizers()->get(); foreach ($organizers as $organizer) { $organizer->setRelation('pastEvents', $organizer->pas

chrisgrim's avatar
chrisgrim's avatar rodrigo.pe...5yrs agoLaravel
13
1
Last reply by rodrigo.pedra 5yrs ago
chrisgrim's avatar

Best Practices for getting data with Vue

Hi, Each of my users can have multiple organizations that can each have multiple events. I am creating an edit page where they can scroll down their list of organizers and see all the current / past events. I originally setup the page so that I get all the data in one big swoop. public function pastEvents() { return $this->hasMany(Event::class)

chrisgrim's avatar
chrisgrim's avatar MIA305BRKL5yrs agoVue
1
1
Last reply by MIA305BRKL 5yrs ago
Talinon's avatar

Styles for "My Participation" discussion filter

@jeffreyway There is pagination at the bottom of the "my participation" view that all the other filters don't seem to have. Just letting you know It's causing massive screen-sized chevrons :)

Talinon's avatar
Talinon's avatar Sinnbeck5yrs agoFeedback
3
1
Last reply by Sinnbeck 5yrs ago
kshitizmittal's avatar

Sample Quiz Website

candidates have to create a demo MCQ website, using PHP language and can use php framework( preferred laravel/ codeigniter). use of any other UI template of stuff will be fine. There should be two kinds of the Users into the system. Admin & Guest. Guests will only visit the created portal and apper for MCQ Test. Admin can view all the candidates applied for the test. The pa

kshitizmittal's avatar
kshitizmittal's avatar kshitizmit...5yrs agoLaravel
2
1
Last reply by kshitizmittal 5yrs ago
kkatwork's avatar

How to filter paginated results?

I have an application where I need to filter further the paginated results. When I apply filter method after the pagination method the view gives an error. I can't insert the logic in sql query because it is complex enough. How can I paginate and filter the results and pass to view so that pagination also works from there? Any help appreciated.

kkatwork's avatar
kkatwork's avatar kkatwork5yrs agoLaravel
6
1
Last reply by kkatwork 5yrs ago
webfuelcode's avatar

List with paginate

I have a view with the category on the left and the list on left. But no pagination. How to display links with paginating? public function show(Link $link) { $link->load('category'); return view('links.single', compact('link')); }

webfuelcode's avatar
webfuelcode's avatar MichalOrav...5yrs agoLaravel
11
1
Last reply by MichalOravec 5yrs ago
Paul_nld's avatar

Paginate gives error

I have a list that I want to display with pagination, when I use the script below I get the error that links do not exist. Without the where conditions it works what am I doing wrong $adresses = Adresses::paginate(10) ->where('active', 1) ->where('user_id',Auth::user()->id); return view('adresses.home', compact('adresses'));

Paul_nld's avatar
Paul_nld's avatar Paul_nld5yrs agoLaravel
3
1
Last reply by Paul_nld 5yrs ago
esaeng's avatar

Method Illuminate\Database\Eloquent\Collection::links does not exist. (View: C:\Users\Q c\laravel\Pagination_Laravel\resources\views\home.blade.php)

Hi there..I am doing pagination in Laravel. and getting this error..suggestions plzz.... here error is coming. `` {!! $employeeData->links() !!} ``

esaeng's avatar
esaeng's avatar esaeng5yrs agoLaravel
7
1
Last reply by esaeng 5yrs ago
datarecall's avatar

Livewire Filters

I am converting some of my pages to livewire components I have this filter based on the filters the episodes for the Forum TDD series this is my livewire component: <?php namespace App\Http\Livewire; use App\Channel; use App\Filters\ThreadFilters; use App\Queries\ThreadQuery; use Illuminate\Foundation\Auth\Access\AuthorizesRequests; use Livewire\Component; use Livewire\Wit

datarecall's avatar
datarecall's avatar datarecall5yrs agoLivewire
0
1
hueilau's avatar

Bootstrap :Put box component next to each other in Laravel

Hi, I'm creating box and I want to put them next to each other but I can't. After looping, the box will become one box per row. Anyone know how to change it? Thanks <div class="container"> <h2 class="mb-4">Property</h2> @foreach($properties as $property) <div class="card-columns"> <div class="card

hueilau's avatar
hueilau's avatar hueilau5yrs agoLaravel
2
1
Last reply by hueilau 5yrs ago
marfino3028's avatar

[Vue warn]: Unknown custom element: <data-view-sidebar> - did you register the component correctly? For recursive components, make sure to provide the "name" option.

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option. found in ---> at src/views/pages/owner/Pelanggan.vue at src/layouts/main/Main.vue at src/App.vue DataViewSidebarPelanggan.vue <component :is="scrollbarTag" class="scroll-

marfino3028's avatar
marfino3028's avatar marfino302...5yrs agoVue
0
1
andyandy's avatar

Remove ?page=1 from paginate()

I had this problem: blah.com/articles //my main article page blah.com/articles?page=1 //is duplicate with previous page blah.com/articles?page=2 blah.com/articles?page=3 So i published pagination template and used this preg_replace to remove ?page=1 //previous button link <a class="page-link" href="{{preg_replace('/\?'.$paginator->getPageName().'=[1]$/',''

andyandy's avatar
andyandy's avatar andyandy5yrs agoCode Review
2
1
Last reply by andyandy 5yrs ago
Sinnbeck's avatar

Layout bug on laracasts

@jeffreyway Just noticed that the pagination on this link seems wrong. You are prefixing all tailwind classes with tw- but not in the pagination https://laracasts.com/discuss?filter_by=contributed_to http://i.imgur.com/GuyqYfU.png http://i.imgur.com/By32rKD.png

Sinnbeck's avatar
Sinnbeck's avatar Sinnbeck5yrs agoFeedback
0
1
AlexGodbehere79's avatar

Laravel Performance question

Hello. I have a laravel performance question. Imagine that I have 5M records in one table and I am fetching them by pagination. Below is my performance result- Fetch 5M records by paginate 100, Memory Uses 4MB, Time 4.19s. Filter by 6 types (mostly max and min records fiterization) from 5M records and found around 2M by 100 paginate Memory Uses 4MB, Time 6.15s. Now if I ask

AlexGodbehere79's avatar
AlexGodbehere79's avatar tisuchi5yrs agoLaravel
9
1
Last reply by tisuchi 5yrs ago
pveltrop's avatar

Vue v-for loop doesnt always work

My v-for loop wont start after a successful GET request. Whats even weirder, sometimes when I refresh this page, this does work just fine. I don't see any errors anywhere. The Articles heading and bootstrap pagination element always render. Does this have to do with fetching being async? I can't figure this out. Here's the code: <template> <div> <h2&

pveltrop's avatar
pveltrop's avatar MaverickCh...5yrs agoVue
2
1
Last reply by MaverickChan 5yrs ago
chrisgrim's avatar

Cant V-bind Paginated Data

Hi All, Has anyone else had an issue with V-binding paginated data? In my blade file I have <search-listing user="{{ auth()->id() }}" :tags="{{ $tags }}" :searchedevents="{{ $searchedevents }}" :onlineevents="{{ $onlineevents }}" :categories="{{ $categories }}" :searchedevents="{{ $searchedevents }}"> and wh

chrisgrim's avatar
chrisgrim's avatar chrisgrim5yrs agoVue
3
1
Last reply by chrisgrim 5yrs ago
mahmoudtrageh's avatar

I want to use orderBy throw this array ?

this code responsible for retrieving data and make a pagination from firestore $limit = 10; $url = 'm-url'&pageSize='.$limit.'&pageToken='.$nextPageToken; $json = json_decode(file_get_contents($url), true); $users = $json['documents']; I want to use orderBy and get the data on basis of created_at field ?

mahmoudtrageh's avatar
mahmoudtrageh's avatar squiaios5yrs agoLaravel
3
1
Last reply by squiaios 5yrs ago
Coola's avatar

Polymorphic Many-to-Many relationship 'where' clause on table after pivot

I have a polymorphic many-to-many relationship with posts and videos such that posts or videos are either visible if 'public' or if the user is associated to the post via the peekables pivot table. posts id - integer name - string visibility - string // e.g. 'private', 'public' videos id - integer name - string visibility - string // e.g. 'private', 'pu

Coola's avatar
Coola's avatar Coola5yrs agoLaravel
2
1
Last reply by Coola 5yrs ago
nacha's avatar

how to make checkbox work for product filters?

I want when check one or multiple category,brand,size,color,... with checkbox display the products related to the categories(product filters) (for exemple check dress and basket display products of dress and basket) and also for brand,size,... I mean: On the category page, you can load the product attributes such as color or size and make a filtering section how to change this

nacha's avatar
nacha's avatar nacha5yrs agoLaravel
18
1
Last reply by nacha 5yrs ago
AlexG834's avatar

Poor query performance with `whereHas()`

I've been battling with this problem now for a couple of weeks. I have a Laravel 7 application that seems to be absolutely hammering the database when performing a certain query. First I'll outline the problem and then dive a bit more into what I've tried to isolate it. I have an Opportunity model that has a scopeLucrative() scope on the model that filters the opportunities to

AlexG834's avatar
AlexG834's avatar AlexGodbeh...5yrs agoLaravel
1
1
Last reply by AlexGodbehere 5yrs ago
Synchro's avatar

How to combine tag and algolia search in Laravel

I have a Laravel 7 app that uses Spatie's tagging package, and also Algolia search using their standard library via its stock Laravel Scout integration. The two search mechanisms come down to this for the tags: $items = Item::withAllTags( $searchtags, Item::TAGTYPE_PRIMARY ); This apparently returns an Eloquent "scope", not a builder or collection, which I do

Synchro's avatar
Synchro's avatar Synchro5yrs agoCode Review
0
1
JoeJobeh's avatar

is laravel using tailwind?

is laravel using Tailwind CSS instead of bootstrap in version 8? cause I saw pagination uses tailwind in version 8 in laravel docs.

JoeJobeh's avatar
JoeJobeh's avatar jlrdw5yrs agoLaravel
2
1
Last reply by jlrdw 5yrs ago
mvnobrega's avatar

Relationship with paginate in foreach

I need to create a dynamic link to take the user to the last page of the laravel page. For example, if there is a pagination, I need to include lastPage () at the end of the url www.site.com/forum/slug?page=2 otherwise it goes to the normal page. But I need to do this logic on another controller, which in turn is not working. See my relationships and how I'm doing: public funct

mvnobrega's avatar
mvnobrega's avatar mvnobrega5yrs agoLaravel
0
1
scottmc0525's avatar

How can I get Laravel's LengthAwarePaginator to render in the current view?

The project I'm on is a Laravel (5.8) PHP project, and the paginator is kind of giving me fits. My problem is that when I use Laravel for pagination, if I try to actually use the paginator, when the new page is returned it's just a (correct) standalone html snippet. As far as I can tell the info is correct, but it's not being rendered 'in place'. It just comes out as minimally

scottmc0525's avatar
scottmc0525's avatar jlrdw5yrs agoCode Review
1
1
Last reply by jlrdw 5yrs ago
mvnobrega's avatar

Relationship paginate does not work

I need to create a dynamic link to take the user to the last page of the laravel page. For example, if there is a pagination, I need to include lastPage () at the end of the url www.site.com/forum/slug?page=2 otherwise it goes to the normal page. But I need to do this logic on another controller, which in turn is not working. See my relationships and how I'm doing: Model Grupo:

mvnobrega's avatar
mvnobrega's avatar mvnobrega5yrs agoLaravel
3
1
Last reply by mvnobrega 5yrs ago
Gabotronix's avatar

Handling multiple async calls inside for loop

I have a javascript for loop where I call a function for each lat-lng bound, inside this function I execute THREE async calls to google maps Places API, after all three calls execute I color the bounds green. Issue is my for loop executes in a sync way and all bounds are colored green in a single tick instead of aiting for all three async calls to resume. How can I do it so the

Gabotronix's avatar
Gabotronix's avatar Gabotronix5yrs agoGeneral
0
1
pllaguno's avatar

query where cluase is pulled from a relation

I have a user table, a credits table and a region table. each credit is defined to a region by region_id in credits table, a User can have more than 1 region assigned to it. What i am trying to achieve is to get all credits that are assigned to a user, so i have to cycle somehow through all of the user;s regions to include them in the query, $pagination = $query->where(funct

pllaguno's avatar
pllaguno's avatar squiaios5yrs agoEloquent
2
1
Last reply by squiaios 5yrs ago
Gabotronix's avatar

Google Places API not returning all restaurants inside bounds (not even close)

Hi everybody, I'm using Google Places Javascript API in order to return all restaurants and food related places inside a small rectangular bound, issue is I'm getting 10-14 places inside area but there should be much more, according to docs I can get up to 60 results split in three batches of 20 results, so why am I getting so few results? I this because the clients SDK are lim

Gabotronix's avatar
Gabotronix's avatar orchharpis...1yr agoGeneral
2
1
Last reply by orchharpist 1yr ago
twg_'s avatar

Livewire Update listing based on selected option

I have a page loading via livewire with pagination. I have a dropdown that has categories I need to use to filter the data being shown. How could I do this?

twg_'s avatar
twg_'s avatar tashari5yrs agoLivewire
11
1
Last reply by tashari 5yrs ago
vdvcoder's avatar

Datatables problem

Hello all! I have a problem with loading datatables. My table has alot of if statements but when i want to add datatables to that table. I doesn't work like it should be. This is my table: <table class="table table-striped table-bordered mb-0" id="datatables"> <thead> <tr>

vdvcoder's avatar
vdvcoder's avatar vdvcoder5yrs agoLaravel
1
1
Last reply by vdvcoder 5yrs ago
Gavmrz's avatar

Best relationship setup for quotes with types

So I have a 'quote' which is prepared by a 'user'. That quote could have one or many 'car rental' quotes + 'insurance quotes' + a couple of other product type quotes. Essentially these are separate quotes that are held together under an overall quote where the customer details are attached to the quote_id and the different information required for insurance/rental is stored i

Gavmrz's avatar
Gavmrz's avatar Gavmrz5yrs agoLaravel
0
1
Tithira's avatar

Search and Filter Query with Jscroll

I am setting up a listing platform and so far i have made the structure. The listings are shown in a view and integrated with Jscroll. The listings view has a filter as shown below. I filter the request by using when in the Model query and orderBy in the end with pagination. However the orderBy lasts for first pagination results page and not return intended results after the s

Tithira's avatar
Tithira's avatar Tithira5yrs agoGeneral
2
1
Last reply by Tithira 5yrs ago
ethar's avatar

Paginate RelationShip

I get the admin and his activity, I want to paginate activity $search = Admins::select('id', 'name', 'photo') ->where('id', $id) ->with(['adminTracking' => function ($q) use ($request) { $q->select('id', 'events', 'event_id', 'event_type', 'admins_id', 'created_at') ->orderby(

ethar's avatar
ethar's avatar davidifran...5yrs agoEloquent
3
1
Last reply by davidifranco 5yrs 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.