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

Neeraj1005's avatar

Method Illuminate\Database\Eloquent\Collection::links does not exist. (View: C:\xampp\htdocs\mylearnwork\codehacking\resources\views\themes\blog\blog_front.blade.php)

Basically in my project I'm trying to fiter the post by using category I am getting the post but pagination is not working. can anyone give the suggestion where did I make mistake? controller code public function bloglist() { $blogs = Post::with('photo','user')->latest(); if (request('category')) { $categoryname = request('category');

Neeraj1005's avatar
Neeraj1005's avatar Neeraj10055yrs agoLaravel
8
1
Last reply by Neeraj1005 5yrs ago
JimCZE007's avatar

Paging in lenses in Laravel Nova

Hi guys, I have this query in Laravel Nova lense: $query ->selectRaw('companies.id, companies.title, companies.city, companies.country, companies.currency_id, total = IsNull(s1.price, 0) + IsNull(s2.price, 0)') ->join('pcolicenses as s1', 'companies.pcolicense_id', '=', 's1.id', 'left outer') ->join('premiumservices as s2', 'companies.premiumservice_id', '=', 's2.id

JimCZE007's avatar
JimCZE007's avatar JimCZE0075yrs agoNova
0
1
scottsuhy's avatar

How to keep user on same paginated page after deleting an item?

Using pagination. When a user deletes an item on page >=2 they are taken back to page 1 versus left on the page they were on. I need to keep the user on the page that they were on. How do I do this? Here is the code for the JS and controller function: Javascript $(document).on('click','.removeFromAuction', function(event) { var itemid = $(this).attr('itemid');

scottsuhy's avatar
scottsuhy's avatar scottsuhy5yrs agoGeneral
2
1
Last reply by scottsuhy 5yrs ago
realtebo's avatar

Is there any Laravel theme with datatable FULLY integrated?

I am looking for a Laravel them with Datatable integrated. But fully integrated, with an example of pagination, search, filters, exporting etc. I still haven't found a theme with this features. Actually, for knowledge, my preferred theme is the material admin by creative time. But it has not datatable and i'd like an already integrated theme....

realtebo's avatar
realtebo's avatar realtebo5yrs agoGeneral
3
1
Last reply by realtebo 5yrs ago
Gabotronix's avatar

How to enable strict mode in mobx store, react-native.

Hi everybody, how can I enable strict mode for my mobx stores in my react-native map, I use mobx stores along with react context API and hooks. After reading docs strict mode makes it so I can only change observable state in actions. /contexts/index.js import React from 'react' import { ThemeStore } from '../stores/ThemeStore.js' import { PostStore } from '../stores/PostStore

Gabotronix's avatar
Gabotronix's avatar Gabotronix5yrs agoJavaScript
0
1
CookieMonster's avatar

Put REQUEST 404 not found

I am creating a CRUD application where I can add ,edit or delete an article. I created an api to handle a put request to edit an article. Article.vue: <template> <div> <h2>Article</h2> <form @submit.prevent="addArticle()" class="mb-3"> <input type="text" v-model="article.title"

CookieMonster's avatar
CookieMonster's avatar Snapey5yrs agoVue
19
1
Last reply by Snapey 5yrs ago
palla451's avatar

Access to property object in Vue

Hi all i have in my controller alla user with role (one to one) AuthController.php public function users() { $users = User::with('role')->get(); // return $users[0]->role->role; return response()->json(['users' => $users], 200); } I have such an answer: { "users": [ { "id": 1, "name": "Giovanni",

palla451's avatar
palla451's avatar palla4515yrs agoVue
0
1
dan3460's avatar

DataTables button not recognized on second page

I have an application that implements yajra datatables. In one of the columns i have a button that when clicked send an email. The button has a class that i use to trigger the action: $(".salesperson").on('click', function(){ console.log('salesperson'); customerNumber = customers.row($(this).closest('tr')).data()[11]; console.log(cu

dan3460's avatar
dan3460's avatar pickpaint0...5yrs agoGeneral
3
1
Last reply by pickpaint01 5yrs ago
Boakye51's avatar

Target class [App\Http\Controllers\] does not exist

Please having this issue Target class [App\Http\Controllers] does not exist can someone help me to fix that. My Routes Route::post("/add", "@ContactController@addContacts"); Route::get("/get-all/{token}/{pagination?}", "@ContactController@getPaginatedData"); Route::post("/update/{id}", "@ContactController@editSingleData&quo

Boakye51's avatar
Boakye51's avatar Boakye515yrs agoLaravel
2
1
Last reply by Boakye51 5yrs ago
mariohbrino's avatar

Vuejs and Taliwindcss components for laravel

Hi there, I launched this week a open source project with vuejs and tailwindcss components for laravel. alert datagrid/datatable with pagination dropdown navbar menu notification sidebar sidebar menu https://github.com/mazejs

mariohbrino's avatar
mariohbrino's avatar mariohbrin...5yrs agoVue
2
1
Last reply by mariohbrino 5yrs ago
zakirp4's avatar

Laravel + Vue.js add one field for router-link in Bootstrap Table filed

My table file <template> <div> <div id="toolbar" v-if="$gate.isAdmin()"> </div> <bootstrap-table :columns="myColumns" :data="myPosts.data" :options="myOptions"/> </div> </template> This is my script part import BootstrapTable fr

zakirp4's avatar
zakirp4's avatar zakirp45yrs agoVue
0
1
GTHell's avatar

Recommend a good chat package?

My current implementation was just like a post with pagination except it's user+message+real-time. I would prefer package all day than implementing it myself! (Mine doesn't have group chat)

GTHell's avatar
GTHell's avatar GTHell5yrs agoGeneral
2
1
Last reply by GTHell 5yrs ago
mastermindlegion's avatar

Add meta to paginated collection

Hello guys, could you please help me with adding meta to paginated collection? Here is my provider ExtendCollectionServiceProvider: public function boot() { Collection::macro('paginate', function ($perPage, $total = null, $page = null, $pageName = 'page', $queryParams= []) { $page = $page ?: LengthAwarePaginator::resolveCurrentPage($pageName)

mastermindlegion's avatar
mastermindlegion's avatar mastermind...6yrs agoLaravel
1
1
Last reply by mastermindlegion 6yrs ago
jginorio's avatar

Should I use Pipelines for Searching, Filtering, Sorting and Paginate

Goal: I'm creating an inventory system in Laravel 7. I want to create a way to search, filter, limit, and paginate the products in my index.blade.php view. Very similar to what e-commerce pages have... Where you can filter by categories, active or inactive products, and search by the product's name or product id. I already have the pagination by using Laravel's paginate functio

jginorio's avatar
jginorio's avatar bugsysha6yrs agoLaravel
1
1
Last reply by bugsysha 6yrs ago
trifek's avatar

Cache in Laravel

Hi, I am beginner in Laravel. In my project I use repository pattern and Laravel 7. I have this controller: class PageController extends Controller { protected $model; /** * PageController constructor. * @param PageRepositoryInterface $repository */ public function __construct(PageRepositoryInterface $repository) { $this->model = $re

trifek's avatar
trifek's avatar MichalOrav...6yrs agoLaravel
15
1
Last reply by MichalOravec 6yrs ago
CaptainBurah's avatar

{{$posts->links()}} : Call to Undefined Method

I have tried to use a pagination but its says "Call to undefined Method"

CaptainBurah's avatar
CaptainBurah's avatar CaptainBur...6yrs agoLaravel
16
3
Last reply by CaptainBurah 6yrs ago
seibzehn's avatar

Request returns null

Hello. I'm having a bit of a problem I'm hoping you fine folks can help with. I have a controller with something like this in it: public function table(Request $request) { $items = $request->items; return view('table', compact('items')); } I am using parameter in uri string for pagination like this: domain.com/table?items=40 This works fine and returns the number input

seibzehn's avatar
seibzehn's avatar seibzehn6yrs agoCode Review
14
121
Last reply by seibzehn 6yrs ago
soso-_-'s avatar

Hands On: Community Contributions | Episode 2 - Display Community Links

Hi guys, in my CommunityLinksController when I want to fetch the data from the database to my $links variable it returns a pagination with an empty collection of items. (I did dd($links) to observe it) In the video it starts from 2min07s to the expected result at 5min02s Ofc I defined the CommunityLink factory and edited the views/community/index.blade.php. Could you please hel

soso-_-'s avatar
soso-_-'s avatar soso-_-6yrs agoLaravel
3
1
Last reply by soso-_- 6yrs ago
dbehterev's avatar

Need tech. advise about technologies to choose and framework

Hello everybody. I'm stuck at what technology to choose to construct my next web app. Sorry for my language in advance, I'm not native English speaker. Some days ago I built an web app based on Laravel backend framework and Vue as a basis for building frontend components. But I run into the main problem of Vue - SEO. Your VUE components are awesome, frontend JS is beatiful for

dbehterev's avatar
dbehterev's avatar cookie_goo...6yrs agoLaravel
3
1
Last reply by cookie_good 6yrs ago
mstdmstd's avatar

Invalid sorting in rows of laravel-datatables-oracle

Hello, In my laravel 5.8 app using yajra/laravel-datatables-oracle 8 I make report sorted by 2 fields and I see that results are shown in different order. My control action is : public function get_check_out_history_dt_listing() { $request = request(); $requestData = $request->all(); $filter_customer = !empty($requestData['filter_customer'

mstdmstd's avatar
mstdmstd's avatar mstdmstd6yrs agoLaravel
2
1
Last reply by mstdmstd 6yrs ago
Gabotronix's avatar

Get vuex action response in component

Hi everybody, I'm trying to get the response object resulting of calling a vuex action with axios, I need the response in my object but it says undefined for some reason. In my component method: mounted() { console.log(this.$options.name+' component successfully mounted'); this.$store.dispatch(this.module+'/'+this.action, this.payload) .then((response) => {

Gabotronix's avatar
Gabotronix's avatar Gabotronix6yrs agoGeneral
0
1
TomasAm's avatar

Submit button does not work after ajax request

I use ajax pagination for datasearch in my form. When I open my page with the form, this form contains 5 rows which have checkboxes. I can mark one of them and click post. Data is saved into database. But I have also a search field, where you can look for further options. Once I use this search, the submit button does not respond anymore. What could be the issue? My child view

TomasAm's avatar
TomasAm's avatar TomasAm6yrs agoLaravel
4
2
Last reply by TomasAm 6yrs ago
cmdobueno's avatar

Query Results Based On "published_at"

Table Concept (Slimmed down for simplistics sake Articles Table: id title content published_at created_at updated_at Goal: A user inputs a date (lets say 15 December 2019), we process a search to the server and send back the user 100 results, all articles published on the date, and whatever space is left we split between before and after the requested date. I hope that makes s

cmdobueno's avatar
cmdobueno's avatar cmdobueno6yrs agoEloquent
2
1
Last reply by cmdobueno 6yrs ago
iboosensei's avatar

404 error on front end

Hello everyone, I'm following this tuto about Laravel nova. https://voltagead.com/creating-a-cms-with-laravel-nova/ But when I finish the "Front end" section and I try to open a front end page at "http://sitename/slug", I get a 404 error. except when the slug = "first-post" (My other slugs are "second-post", "third-post", etc.)

iboosensei's avatar
iboosensei's avatar bobbybouwm...6yrs agoNova
1
1
Last reply by bobbybouwmann 6yrs ago
markss's avatar

Eloquent relationship - append data with union

I have defined a Relation between several Shop-Types and PaymentMethods representing which shop offers which payment method. This is defined through a morphToMany in $shop->paymentMethods(). Now I also have a Localization-Feature implemented, which works the following way: The current locale you're working in is stored in the session. Then, there is a localizations table, wh

markss's avatar
markss's avatar markss6yrs agoEloquent
0
1
UsmanBasharmal's avatar

Vuejs and Datatables

I am developing a Bookstore application in laravel vuejs I need a Datatable with the functionality of sorting, serverside pagination, delete, update and view if there is any specific data table that can help me please advice.

UsmanBasharmal's avatar
UsmanBasharmal's avatar EdgarPsda6yrs agoVue
2
1
Last reply by EdgarPsda 6yrs ago
UsmanBasharmal's avatar

vuetable-2 - how to get and show data in the table using api in laravel/vuejs

I am trying to implementing vuetable-2 in laravel/ vuejs but I don't know how to pass data to the table from api , in sample table we do it like below methods: {loadBooks() { axios.get("api/Book").then(({ data }) => (this.Books = data)); } mounted() { this.loadBooks(); }, <tr v-for="Book in Books.data" v-bind:key="Book.id"> <td>

UsmanBasharmal's avatar
UsmanBasharmal's avatar UsmanBasha...6yrs agoVue
2
1
Last reply by UsmanBasharal 6yrs ago
UsmanBasharmal's avatar

DataTables warning: table id=datatable-fixed-header1 - Invalid JSON response

I am using jQuery DataTables in laravel vuejs and I applied serverside pagination to load the first page only with 5 records when I try to search a record in all table it does not work but the search only works in the 5 loaded data I search in the web and I found that I should set serverSide: true, but when I set that it throws the below error. DataTables warning: table id=dat

UsmanBasharmal's avatar
UsmanBasharmal's avatar UsmanBasha...6yrs agoVue
0
1
monstajamss's avatar

Trying To Paginate (Call to undefined method App\Post::links())

I am trying to do custom pagination but it does not work instead it gives error Controller public function postindex(User $user) { $post=Post::where('user_id',$user->id)->latest()->get(); $post = $user->post()->latest()->paginate(15); return view ('author.show', compact('post','user')); } Blade <?php echo $post->links('cp

monstajamss's avatar
monstajamss's avatar monstajams...6yrs agoLaravel
2
1
Last reply by monstajamss 6yrs ago
tekitaamtk's avatar

DataTables features not working

Hi Guys, Can anyone point me in the right direction the issue I'm facing now. I tried to use DataTable on my project but it does not display the record as it should be. If the column is more than two in the table. All features on datatable are disappeared like search-bar, sorting, and pagination. This is the one that working. Nam

tekitaamtk's avatar
tekitaamtk's avatar tekitaamtk6yrs agoLaravel
1
1
Last reply by tekitaamtk 6yrs ago
pauljp's avatar

Use Relationship Value as Property

I have a one to many relation. The One is a Users Table . and the Many have columns: Id, user_id, value_key, value I'm able to retrieve the relation with no issues but i would like to make it smarter. I would like to make the "value_key" column into properties of the relation. $users->relation->value_key , so it returns the "value" column. So pretty mu

pauljp's avatar
pauljp's avatar pauljp6yrs agoLaravel
0
1
nacha's avatar

how to display products with checkbox(products related to color ,size and brand :filters)

what's wrong in my code what can I change to make it work because for exemple if I have 3 products have same brand so in brand filter display the brand 3 times (gucci ,gucci,gucci with checkbox) and it's same for other filters and the checkbox not functional how to make it work I want when check one or multiple (size,color,brand) with checkbox display the products related to th

nacha's avatar
nacha's avatar jlrdw6yrs agoLaravel
4
1
Last reply by jlrdw 6yrs ago
TzuSun67's avatar

Trying to get property 'id' of non-object

Hi All, I am working on a project for an AmpCompare website and I am having issues with my code. I have recently moved to using a different method to call me results as the "Lazy" way I called it before had some issues with mapping id's correctly. I am now using the Load() function to try and load in results which are related to the product. This is what it should do.

TzuSun67's avatar
TzuSun67's avatar Sinnbeck6yrs agoLaravel
7
1
Last reply by Sinnbeck 6yrs ago
fares_ibrahim's avatar

Should I use jQuery or Vue js in order to make interactive website using laravel?

Hi ... I have you can say "a general overview" how the Laravel framework works , and it's components and I already done some small "Training apps " using it . Back then I already used jQuery, and Ajax to make some changes in the background . I'm refreshing my Background in laravel right now , and I'm wondering if the programmers these days in general still

fares_ibrahim's avatar
fares_ibrahim's avatar ykchan6yrs agoLaravel
2
1
Last reply by ykchan 6yrs ago
Seeker1337's avatar

Laravel 6 AJAX live search on CRUD management table

Hello there. After a day of trying I hit a wall..basically I have the following problem: I have a CRUD table that's holding records of vehicles that get retrieved from the MySQL database. I've been following a few tutorials and managed to set up AJAX live results search. Now the problem comes from the fact that the logic is stored in a Controller. I can succesfully retrieve the

Seeker1337's avatar
Seeker1337's avatar Seeker13376yrs agoLaravel
3
1
Last reply by Seeker1337 6yrs ago
finchy70's avatar

Can't centre Text with mx-auto (Tailwindcss)

I've started using Tailwind in my laravel projects and I really like it. I have got stuck. I have two divs <div class="mx-auto text-xs font-bold italic">{{App\Paginatable::pagination_count($posts)}}</div> <div class="my-4">{{$posts->links()}}</div> the mx-auto does not centre the return from the pagination count method. I have tr

finchy70's avatar
finchy70's avatar finchy706yrs agoGeneral
8
1
Last reply by finchy70 6yrs ago
GodziLaravel's avatar

what value should limit param takes to show all ?

Hello This is how I limit the number of results : $companies = $companies->paginate($value); my question is : is there any value to give it to $value to show all (no pagination)

GodziLaravel's avatar
GodziLaravel's avatar Snapey6yrs agoLaravel
5
1
Last reply by Snapey 6yrs ago
galih56's avatar

Is faceted navigation with javascript is good for SEO?

I'm currently working on a project that requires me to build some kind of filter for the list of products. I build the feature on laravel. Website Example: www.analytics-shop.com/gb/lab-supply/lab-instruments/pumps-accessories.html?dir=asc&limit=200&order=sku My first plan, I build it with plain blade+php. But I realized it will give bad user experience because we have

galih56's avatar
galih56's avatar galih566yrs agoGeneral
2
1
Last reply by galih56 6yrs ago
SupunSam's avatar

Pass data from ajax call to Controller

I am trying to pass 2 dates to the controller to filter data table by custom date range. My problem is I am unable to pass any data from JS to the controller. It always returns null View <div class="row input-daterange"> <div class="col-md-4"> <input type="text" name="from_date" id="

SupunSam's avatar
SupunSam's avatar SupunSam6yrs agoLaravel
1
2
Last reply by SupunSam 6yrs ago
mstdmstd's avatar

Laravel resources lost meta when I added mapping

Hello, In Laravel 6 I make pagination listing like $ads = Ad ::getByTitle($this->filter_title) ->getByStatus('A') ->leftJoin('users', 'users.id', '=', 'ads.creator_id') ->orderBy($this->order_by, $this->order_direction) ->select( 'ads.*', 'users.name as crea

mstdmstd's avatar
mstdmstd's avatar mstdmstd6yrs agoLaravel
3
1
Last reply by mstdmstd 6yrs ago
AbehoM's avatar

Order and random results Laravel

I need to list all users on my database. Imagine that I have 10 users, a few with different ages and others with similar ages. I need to order the users by their age BUT I don't want the order of users to be the same. It sounds weird but let me show a simulation for you: Christina Alvarado, 18 Charles Carlson, 18 Albert Hawkins, 22 Wayne Crawford, 25 Theresa Wong, 30 Jeffrey Be

AbehoM's avatar
AbehoM's avatar zefex6yrs agoGeneral
2
1
Last reply by zefex 6yrs ago
mstdmstd's avatar

I do not have meta data in laravel's resources

Hello, In my laravel 5 apps I returned json in request controls, like: $retArray['tasks'] = $taskList; $retArray['tasks_total_count'] = $tasks_total_count; return response()->json($retArray, 200); including additive parameters like tasks_total_count, which was used for pagination. In laravel 6 app I use resources, like: <?php namespace A

mstdmstd's avatar
mstdmstd's avatar mstdmstd6yrs agoLaravel
8
1
Last reply by mstdmstd 6yrs ago
tehseen's avatar

Get all products by category slug with paginate..

Hi, I am having issue in getting all products by category slug in category single page the products data is fine but i need it with pagination to only show 12 on one page here is the below code i write. Note: product and category have many to many relationship $category = Category::where('slug', '=', $slug)->firstOrFail(); $categoryProducts = $category->products->pagin

tehseen's avatar
tehseen's avatar tehseen6yrs agoGeneral
5
1
Last reply by tehseen 6yrs ago
Kenshirou's avatar

Why 'popular' is not preserved on query string when I change pages

This question is from the 'Hands On: Community Contributions' series, episode 12: 'Sort By Popularity'. When I am at the route: links-sharing.test/community and I typed '?popular' at the end it shows me a list ordered by most popular at links-sharing.test/community?popular. But When I click on a page on the custom pagination it doesn't preserve the '?popular' in the query str

Kenshirou's avatar
Kenshirou's avatar jlrdw6yrs agoLaravel
4
1
Last reply by jlrdw 6yrs ago
beracah.kings's avatar

React - Laravel

Im having a pagination table with Laravel - Ajax - response is html page from ajax. Im planning to change it Laravel - React. Will the json response be faster than the htmlresponse from ajax.

beracah.kings's avatar
beracah.kings's avatar bobbybouwm...6yrs agoReact
1
1
Last reply by bobbybouwmann 6yrs ago
Corbin's avatar

How do I paginate my activity feed relationship in a JSON Resource API?

I'm building a JSON API profile activity feed that includes both posts and comments. What I'm trying to do is paginate the latest activity. User Model public function activity() { return $this->hasMany('App\Activity'); } public function latestActivity() { return $this->activity()->latest()->paginate(1); } ProfileControll

Corbin's avatar
Corbin's avatar kevinbui6yrs agoCode Review
2
1
Last reply by kevinbui 6yrs ago
connecteev's avatar

How to modify Laravel's returned paginated data ?

My code is calling a Laravel API which returns data in this format: { "current_page": 2, "data": [ { "id": 36, "title": "Error perferendis aut velit quaerat.", }, { "id": 124, "title": "Beatae nobis voluptatum incidunt animi

connecteev's avatar
connecteev's avatar krisi_gjik...11mos agoEloquent
7
2
Last reply by krisi_gjika 11mos ago
priyasanka00's avatar

Method links does not exist.

Pagination is working properly for home view but its not working for category views same controller im using for categories and its separate by using routes, pl help me: this is my controller: $form1=new form1; $form1->name=$request->yourname; $form1->email=$request->email; $form1->tp=$request->tp; $form1->heading=$request->subject; $

priyasanka00's avatar
priyasanka00's avatar jlrdw6yrs agoLaravel
3
1
Last reply by jlrdw 6yrs ago
Randy_Johnson's avatar

Running a loop whilst seeding db

Hey I just tried running a loop whilst seeding my db. But the seed wasn't successful, even though everything ran fine the entries were never put inside the database. Is it possible for me to do what I was? Edit!? Also I am unable to move the pagination to the bottom of the page. It just sits at the top no matter what I do.

Randy_Johnson's avatar
Randy_Johnson's avatar Tray26yrs agoGeneral
3
1
Last reply by Tray2 6yrs ago
bhhussain's avatar

count(): Parameter must be an array or an object that implements Countable

Hi, The below code working but when I add some condition it is showing error Working without any condition $arr['accounts'] = Account::all(); If I add any condition then it is showing below error $arr['accounts'] = Account::where('th_emp_id', auth()->user()->id)->where('th_pay_status', 0)->orderBy('th_tran_no','desc'); Error Facade\Ignition\Exceptions\ViewExceptio

bhhussain's avatar
bhhussain's avatar bhhussain6yrs agoGeneral
2
1
Last reply by bhhussain 6yrs 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.