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

RomainLanz's avatar

Post reply notification

Hi @JeffreyWay, can we have a notification when someone answer to a post who we already answered? Maybe you can put a checkbox like for email to subscribe only for notification and subscribe automatically when we answer to the post. Another think, is it possible to have the pagination on the top of the post too? Thanks for everything.

RomainLanz's avatar
RomainLanz's avatar AtoZ11yrs agoFeedback
3
1
Last reply by AtoZ 11yrs ago
oriceon's avatar

Laravel lang from another path

Hello there. I want to create a multi site with multi languages support. All`s good for now: i created folder structure: /Agents/ /Domains/ /domain1.dev/ /lang/ /en/ translations here... config.php /domain2.dev/ /lang/ /en/ translations here..

oriceon's avatar
oriceon's avatar sicaboy1yr agoGeneral
2
1
Last reply by sicaboy 1yr ago
tobe81cwb's avatar

Laravel 5 set current page programatically

Trying to upgrade my app from Laravel 4.2 to Laravel 5.0 My web application uses a lot of ajax, then the pagination has to be a little more dynamic, without relying on urls, but by request and other items which are not fitting in this conversation. In laravel 4.2 I could to set the current page, programmatically, by simply calling the function: Paginator::setCurrentPage($curren

tobe81cwb's avatar
tobe81cwb's avatar thiduzz11yrs agoGeneral
5
1
Last reply by thiduzz 11yrs ago
Juukie's avatar

L5 Custom created simple paginator always returns items for first page.

I would like to create a simple next/prev pagination. So I do this: $items = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; $paginator = new \Illuminate\Pagination\Paginator($items, $perPage = 2); .. but I always get the items for the first page. JSON output for url with ?page=2: {"per_page":2,"current_page":2,"next_page_url":"\/?page=3","prev_pa

Juukie's avatar
Juukie's avatar Naim10yrs agoGeneral
5
1
Last reply by Naim 10yrs ago
Hao Zhou's avatar

Problems of links generated by Laravel 5 Paginator

I came across a weird problem when I tried to use Paginator in Laravel 5. The data and pagination information were prepared, but when I called $model->render() in blade the links to pages were simply wrong. Here is some sample code in controller: public function index() { $articles = Article::latest('published_at')->paginate(3); return view('articl

Hao Zhou's avatar
Hao Zhou's avatar pmall11yrs agoGeneral
6
1
Last reply by pmall 11yrs ago
morawcik's avatar

Redirect to created object on paginated page

Hello I have forum with post pagination. After create new one how I can redirect to it? Redirect back or sending page number by hidden input (or something like this) can do that but what about situation if new post will be on new page (before create pagination return 2 pages but after return 3) ?

morawcik's avatar
morawcik's avatar RachidLaas...11yrs agoGeneral
3
1
Last reply by RachidLaasri 11yrs ago
jmfs's avatar

Stored Procedure-Based Models

Hey, our company uses MSSQL for a bunch of our main DB infrastructure and uses Stored Procedures to streamline many requests across systems. What is the best way to build a model that uses SPs instead of tables? I just fooled around and came up with this that basically would overwrite the methods for functions like ::all() and ::find(), probably not the best solution. (using My

jmfs's avatar
jmfs's avatar tovisbrats...5yrs agoGeneral
4
1
Last reply by tovisbratsburg 5yrs ago
BenG's avatar

Add class to paginator links

How can I add a class to Pagination links? I am currently echoing the links like this: {{ $paginator->links() }}. How can I add a class so I can access it in Javascript? Thanks

BenG's avatar
BenG's avatar SergheiLeo...4yrs agoGeneral
13
8
Last reply by SergheiLeonenco 4yrs ago
cskiwi's avatar

Making a laravel feed faster via better SQL fetch ?

Hi, for a school project I've been making this feed. but I find it very slow. and I was thinking on forcing some more processing on the SQL part instead of processing it on the php side I'm using the search thingy from nicolaslopezj . and that is fast as hell. So I'm olmost certain that it's the php code :) And the algorithm isn't even great, so I could use another opinion/t

cskiwi's avatar
cskiwi's avatar cskiwi11yrs agoGeneral
5
1
Last reply by cskiwi 11yrs ago
Houbsi's avatar

How to handle a table with 19k+ Elements

Hi guys, i know you would think, okay use the pagination. But if i need to use it in a ui.select2 or so that my users can search a really big database for adresses. I need a good workable solution. What i have currently explodes everytime the memory or the php loading time. I know i'm doing it to complicated, so there must be a laravel solution or a great package, which i can'

Houbsi's avatar
Houbsi's avatar bashy11yrs agoGeneral
9
1
Last reply by bashy 11yrs ago
cconey's avatar

Extracting Where Clause from Eloquent

I can't seem to find a good way to pull a full where clause from an instance of the QueryBuilder. We have a very advanced reporting API, and everything is good except every now and again we need to apply the same filtering parameters on the full set of data, instead of the limited set (we are paginating). The only way that I can think to do that would be to somehow extract the

cconey's avatar
cconey's avatar thepsion511yrs agoEloquent
1
1
Last reply by thepsion5 11yrs ago
Akeno's avatar

Paginate within a pivot table

Hi, how can I paginate data from a pivot table? I know it could work like this: (user and blueprint have a many-to-many-relationship) $blueprints = User::find($user->id)->blueprints()->simplePaginate(10); But this way, it does not eagerly load the data, thus many queries are generated :/ Also, I can't specify any constraints etc. Is there a way to achieve a pagina

Akeno's avatar
Akeno's avatar Akeno11yrs agoGeneral
4
1
Last reply by Akeno 11yrs ago
JasperK's avatar

Custom order of Eloquent, get next/prev article?

Hi, How do I get a previous / next article when there is a custom order? # I'm ordering my Articles by publish_date in the overview $articles = Article::orderBy("publish_date")->get(); # I find articles by their Slug $article = Article::whereSlug("foobar")->first(); # I'm ordering my Projects by Title in the overview $projects = Project::orderBy("title")->get(); # I

JasperK's avatar
JasperK's avatar bestmomo11yrs agoEloquent
1
1
Last reply by bestmomo 11yrs ago
Mushr00m's avatar

Dependency Injection and inheritance

Hi all, I have an Abstract repository where I want to set some parameters for all my Repos. Like for example the number of item for the pagination. So I was thinking of doing : abstract class AbstractRepository { protected $model; protected $config; public function __construct(Model $model, Config $config) { $this->model = $model; $this->config = $config; } .

Mushr00m's avatar
Mushr00m's avatar JohnRivs11yrs agoGeneral
1
1
Last reply by JohnRivs 11yrs ago
imJohnBon's avatar

Best way to implement a load more button?

Simple and common example: I have a job posting board where I use Laravel's default pagination to render 10 at a time. At the bottom of the page I want to make an ajax call to get the next 10 and append them to the bottom of the current list. What's my best way of going about doing this? Surprisingly, I haven't found any solid examples online. In some things I have seen, peop

imJohnBon's avatar
imJohnBon's avatar foxted11yrs agoGeneral
1
1
Last reply by foxted 11yrs ago
Mushr00m's avatar

About the Repository Pattern

Hi, I'm trying to use the Repository Pattern but have a little issue. I have models for Artist, Song, Album and Lyrics. For the relations part, it's classic, a Lyrics belongs to an Artists, an Album and a Song. Also an Artist or a Song or an Album has many Lyrics. Super simple. My problem is that I want to get all the Lyrics for an Artist and also for a Song or an Album. I do

Mushr00m's avatar
Mushr00m's avatar Mushr00m11yrs agoGeneral
3
1
Last reply by Mushr00m 11yrs ago
layer7's avatar

Paginator returns all items instead of subset

Hi all, I'm testing out Laravel 5 and have run into an issue where pagination doesn't work when I'm manually instantiating the paginator. Here's some code: /** * Display a listing of the resource. * @Get("/users") * * @return \Illuminate\Http\Response */ public function index() { $allUsers = $this->userRepository->all(); $paginator = new LengthAware

layer7's avatar
layer7's avatar layer711yrs agoGeneral
0
1
isimmons's avatar

L5 paginator chunk

For Larabook we were using @foreach($users->chunk(4) as $userSet) <div class="row users"> @foreach($userSet as $user) <div class="col-md-3 user-block"> @include('users.partials.avatar', ['size' => 70]) <h4 class="user-block-username"> {{{ link_to_route('u

isimmons's avatar
isimmons's avatar isimmons11yrs agoGeneral
2
1
Last reply by isimmons 11yrs ago
rspahni's avatar

L5: Recommendable commit for those who want to exercise...

... rather 4.3-ish features such as folder structure, namespacing, providers, route caching, etc., yet without POPO controllers, annotations and middleware that Taylor is currently working on. I.e. Illuminate\Routing\Controller, $this->beforeFilter() and FilterServiceProvider still worked/existed at that point (Oct 5th), as well as L4 pagination, db caching etc. I'm not aware o

rspahni's avatar
rspahni's avatar keevitaja11yrs agoGeneral
1
1
Last reply by keevitaja 11yrs ago
fraserk's avatar

L5 Paginator

I'm trying to create a pagination link in a L5 application When I try to output the pagination. $data->links() I getting the following error.. Call to undefined method Illuminate\Database\Query\Builder::links() Anyone know if pagination has change in L5.. Thanks..

fraserk's avatar
fraserk's avatar fraserk11yrs agoGeneral
4
1
Last reply by fraserk 11yrs ago
christopher's avatar

Search Results Paginate

This is my little search function. $query = Request::get('q'); if ($query) { $posts = Post::where('title', 'LIKE', "%$query%")->paginate(15); } else { $posts = Post::orderBy('id', 'DESC')->paginate(15); } return View::make('posts.index', compact('posts')); Now if there are more than 15 res

christopher's avatar
christopher's avatar devraju7yrs agoGeneral
5
1
Last reply by devraju 7yrs ago
chrisgeary92's avatar

Checklist is Slow

I'm actually using the "checklist" page as the "whats new" page because it's easier to see if I've watched your latest video due the little checklist icon. I've since found that the checklist page is probably the slowest on the site to load (is it just me, or do other people find it slow). Presumably because of the number of lessons it's showing, so might be worth adding some

chrisgeary92's avatar
chrisgeary92's avatar chrisgeary...11yrs agoFeedback
2
1
Last reply by 11yrs ago
Foks's avatar

Multiple Paginations on one page

Hi! I'm currently looking for a way to have multiple paginations on a single page, with they are interfering with each other. How can I do that? Best Regards, Foks

Foks's avatar
Foks's avatar Shashi Meh...4yrs agoEloquent
12
2
Last reply by Shashi Mehta 4yrs ago
AnghelutaV's avatar

How to add many paginations on tabs in laravel ???

<li class="{{ request()->input("reports") ? "tab-current" : "not-current-tab" }}"> <a href="#section-linemove-2" class="far fa-newspaper"> <span>{{ __("string.reports") }}</span> </a&

AnghelutaV's avatar
AnghelutaV's avatar tykus1yr agoLaravel
1
1
Last reply by tykus 1yr ago
Vinciepincie's avatar

Paginator changes content in all boxes when multiple paginations on one page

Hi, sorry if the title is confusing . Basically I've 3 paginators on one page. There's 3 boxes with a list of items. It doesn't matter which one i click, the content off all the 3 boxes changes when i click on the paginator. What i want is that every paginator only controls one part. How can I do this? (The reason I use livewire is because I'm going to put a searchbar in it.) c

Vinciepincie's avatar
Vinciepincie's avatar Vinciepinc...4yrs agoLivewire
2
1
Last reply by Vinciepincie 4yrs ago
binggle's avatar

Multiple paginations not working .

Comment.php class UpsoComments extends Component { use CommentsTrait; function render(){ return view('comments', [ 'comments'=> $this->getComments( $post) ]); } } CommentsTrait.php trait CommentsTrait { use WithPagination; function getComments($commentable){ return Comment::query() ->pagina

binggle's avatar
binggle's avatar binggle4yrs agoLivewire
2
1
Last reply by binggle 4yrs ago
jewishmoses's avatar

How to assert paginations in Laravel?

I have a category model with the following method: public static function index() { return self::has('posts')->paginate(1); } My category controller: public function index() { $categories = Category::index(); return view('categories.index', compact('categories')); } This is what I've tried: $response = $this->get(route('categories.index')); $response->ass

jewishmoses's avatar
jewishmoses's avatar manelgaval...5yrs agoTesting
1
1
Last reply by manelgavalda 5yrs ago
slovenianGooner's avatar

Different paginations in L5

So, Laravel uses the "SimpleBootstrapThreePresenter" as the default. The render method accepts others to, I was just wondering if this could be set as default or how would you pass other presenters to the render method?

slovenianGooner's avatar
slovenianGooner's avatar RachidLaas...11yrs agoGeneral
7
1
Last reply by RachidLaasri 11yrs ago
Chron's avatar

Default Error messages

I already know about the validation.php that holds all the default error messages for form inputs. But I also noticed there are other files with validation.php; auth.php, pagination.php, and passwords.php. How can I make Laravel use these messages as defaults?

Chron's avatar
Chron's avatar Mega_Aleks...2mos agoLaravel
4
1
Last reply by Mega_Aleksandar 2mos ago
MahmoudAdelAli's avatar

Search with Live-Wire

Hi , there's a junior at my team asking me for code-review for his Article - Search so i decided to share the code with you to see if there's any comment we can share it with him . class Blogs extends Component { use WithPagination; protected $paginationTheme = 'bootstrap'; public string $searchQuery = ''; public function render() { return view('liv

MahmoudAdelAli's avatar
MahmoudAdelAli's avatar LaryAI1yr agoCode Review
1
1
Last reply by LaryAI 1yr ago
MahmoudAdelAli's avatar

Cannot mutate reactive prop

I have a beginner issue here , i have a component that contain freelancers class Freelancers extends Component { use WithPagination; protected $paginationTheme = 'bootstrap'; #[Validate('required|string|min:1')] public $term = ''; #[Reactive] public $results = []; public function render(): View { return view('livewire.client.init.freelancer

MahmoudAdelAli's avatar
MahmoudAdelAli's avatar critic8mos agoLivewire
4
3
Last reply by critic 8mos ago
Zoul's avatar

Unable to find component: [blog-list]

Hi all, I guess the path to Blog model and to the view livewire.blog-list however its not finding it. BlogList livewire namespace App\Http\Livewire; use Livewire\Component; use Livewire\WithPagination; use App\Models\Blog; use Hashids\Hashids; class BlogList extends Component { use WithPagination; protected $paginationTheme = 'bootstrap'; public function render()

Zoul's avatar
Zoul's avatar Zoul1yr agoLivewire
4
2
Last reply by Zoul 1yr ago
DanielRønfeldt's avatar

Custom validation error messages: Jetstream + Inertia + Vue?

On a Laravel 11 Jetstream project that's using the Inertia + Vue stack, I need to customize the default validation messages. For such purpose, I published the language files with php artisan lang:publish, which resulted in the auth.php, pagination.php, passwords.php, and validation.php files within the /lang/en/ folder. I found the specific message I was looking for in validati

DanielRønfeldt's avatar
DanielRønfeldt's avatar gych2yrs agoInertia
7
1
Last reply by gych 2yrs ago
butifarra's avatar

Livewire variable not being showed in the input in the view

Hi to all! I have a project in Laravel 11 and Livewire 3. I have Purchase (Compras) Component, which renders two views (Purchases and their lines). I can save the model to the database, the connection from the view to the componeont works. But, the input texts don't show back the updated value of the variables. I know the value comes back from the component because when I debug

butifarra's avatar
butifarra's avatar butifarra2yrs agoLivewire
1
1
Last reply by butifarra 2yrs ago
artisticre's avatar

Livewire Modal not working

I have a project that I am using a modal for. Modals are working if not in livewire but when I add wire to it, it does not popup. Just refreshes the page. I am sure its something simple that I am overlooking. index page <div> <!-- Modal --> <div wire:ignore.self class="modal fade" id="deleteModal" tabindex="-1" aria-labelledby=&qu

artisticre's avatar
artisticre's avatar yusufjonov...1yr agoLaravel
2
1
Last reply by yusufjonov707 1yr ago
thedocrow0124's avatar

->layout('fluid') not working, still using default layout (Livewire 3)

I have a default layout set which works fine. I am trying to set up a 2nd layout to use for certain pages, but it does not seem to render in them, and still uses the default one. Thanks in advance! I have tried using the render option: return view('livewire.development.samples-list', ['samples' => $samples])->layout('fluid'); and the other option: #[Layout('layouts.fluid

thedocrow0124's avatar
thedocrow0124's avatar vincent150...2yrs agoLivewire
3
1
Last reply by vincent15000 2yrs ago
t0berius's avatar

livewire 2 double queries executed

After taking a look into the debug bar I was able to find a query which is executed twice a time when loading the page: users-table.blade.php <div> <div class="row mb-4"> <div class="offset-md-9 col"> <input wire:model="search" class="form-control" type="text" autofocus="" p

t0berius's avatar
t0berius's avatar t0berius2yrs agoLivewire
10
1
Last reply by t0berius 2yrs ago
vincent15000's avatar

Livewire 3 : Can't set model as property if it hasn't been persisted yet

Hello, I'm testing the Laravel 3 features. I'm trying to set a custom property type. https://livewire.laravel.com/docs/properties Here is the model and the controller. <?php namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; use Livewire\Wireable; class Category extends Model implements Wireable { use H

vincent15000's avatar
vincent15000's avatar PhillipMwa...2yrs agoLivewire
17
44
Last reply by PhillipMwaniki 2yrs ago
dev-idkwhoami's avatar

AlpineJS initialization problem

I'm having trouble using Livewire in combination with AlpineJS. I have a Livewire Component in form of a table. and a dropdown with actions using AlpineJS. So each row of data has one Alpine component. Randomly the dropdown doesn't work or only works partially and I can't figure out why. I tried x-init on the component and it did work. file-table.blade.php: <div class="

dev-idkwhoami's avatar
dev-idkwhoami's avatar idk_who_am...2yrs agoLivewire
2
1
Last reply by idk_who_am_i 2yrs ago
Xanger's avatar

Paginate does not work with wire:init

I am just starting to implement livewire a few days ago and still need to understand some dynamics. I put a wire:init in my project and it works correctly, but if I try to use paginate I get error: class ProfileTimeline extends Component { use WithPagination; public $member_id; public $readyToLoad = false; public function loadItems() { $this->re

Xanger's avatar
Xanger's avatar Xanger3yrs agoLivewire
5
1
Last reply by Xanger 3yrs ago
Xanger's avatar

Retrieve page slug with livewire

I have a page where I'm implementing livewire, but I don't understand how to pass a variable from the controller to livewire, and that would be the page slug variable, where it goes to retrieve the data on the query: Controller: public function getProfiloVote($slug) { $profile = XIPB_Core_Members::where('members_seo_name', $slug)->firstorfail(); $staff = User::wher

Xanger's avatar
Xanger's avatar JabatoFore...3yrs agoLivewire
2
1
Last reply by JabatoForever 3yrs ago
akinakin's avatar

can't groupBy when using BelongsToMany (Postgres)

Hi, the shouldSelect() function from BelongsToMany use aliasedPivotColumns() which merge the pivot columns in the SELECT statement: protected function shouldSelect(array $columns = ['*']) { if ($columns == ['*']) { $columns = [$this->related->getTable().'.*']; } return array_merge($columns, $this->aliasedPivotColumns()); } C

akinakin's avatar
akinakin's avatar akinakin3yrs agoLaravel
0
1
Josadec's avatar

Help Livewire live search date with format m/d/Y

MySQL uses Unix date format to save data in the tables but when I need to search with a specific format example "m/d/Y" the live search not found results I use an input-type search to be able to filter dates and show the results in a table I tried using Accessor with Mutators but for a reason, it doesn't work Someone could help me? Model Classs class Order extends M

Josadec's avatar
Josadec's avatar Josadec3yrs agoLivewire
6
2
Last reply by Josadec 3yrs ago
ChristophAust's avatar

Search on various attributes in big mysql table

Hi guys, so I ran into an issue, which I knew, was coming one day. I have a community application where I have a table for registered frontend users. I have stored all sorts of attributes in this table and we have fairly some users in that. The software contains a search to search for other frontend users by various params like gender, age, country, language and more. The probl

ChristophAust's avatar
ChristophAust's avatar hondnl3yrs agoLaravel
8
1
Last reply by hondnl 3yrs ago
abcuse's avatar

My Category Delete Does Not Work

I am trying to find a way to delete my category that I have created. I get the error attempt to read image is null, I think the error has to do with category_id being null. How can I retrieve it for my category object? //code begins class Index extends Component { use WithPagination; protected $paginationTheme = 'bootstrap'; public $category_id; //setting cate

abcuse's avatar
abcuse's avatar abcuse3yrs agoCode Review
5
1
Last reply by abcuse 3yrs ago
bifog's avatar

Translation strings for validation in lang folder

Is there any location I can download those 4 files (auth.php, pagination.php, passwords.php, validation.php) in my language? I can translate it myself but it's a lot of strings. Like at least 30 - 45 minutes of retyping stuff. So, I am asking before I embark on the Via Translatia ;)

bifog's avatar
bifog's avatar atorscho9mos agoLaravel
7
27
Last reply by atorscho 9mos ago
PetroGromovo's avatar

I search bootstrap 5 libraries for Laravel 9

Hello, I wonder are there some bootstrap 5 libraries with data grids, editor forms, dialog modals, paginations etc... for work with Laravel 9 / vite.config.js app ? Maybe some Laravel 9 installations with already installed such libraries/templates? Maybe something like vuetify was some time ago... Without vuejs/jquery. Thanks in advance!

PetroGromovo's avatar
PetroGromovo's avatar RayC3yrs agoLaravel
1
1
Last reply by RayC 3yrs ago
kikter's avatar

livewire edit not saving

i am trying to edit a topic and its not editing after i clicked saved class ShowTopics extends Component { public $topic; public $showModal = false; public $topicId; protected $paginationTheme = 'bootstrap'; protected $rules = [ 'topic.title' => 'required', 'topic.body' => 'required', ]; public function edit($topicId) {

kikter's avatar
kikter's avatar kikter4yrs agoLivewire
2
1
Last reply by kikter 4yrs ago
dink's avatar

Livewire sorting by foreign key

Hi all! I'm trying to sort a post table by a foreign key, and can't figure out how to do it. Hopefully someone can lend me a hand. I can sort by the fields already present. The post_stats table has the following columns: id, post_id, views, with views being an int. This is what I currently have. My livewire controller: <?php namespace App\Http\Livewire\Admin; use App\Model

dink's avatar
dink's avatar dink4yrs agoLivewire
0
1
Desssha's avatar

How can call two Different blade inside livewire Component class

hello i try to return view in another function in the same component i don't want use redirect , want use it like contoller one component for all method (create,edit) , i can do it or only should redirect create to creatComponent ? <?php namespace App\Http\Livewire; use App\Models\Post; use Illuminate\Support\Facades\File; use Livewire\Component; use Livewire\WithPaginatio

Desssha's avatar
Desssha's avatar cg00124yrs agoLivewire
3
3
Last reply by cg0012 4yrs 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.