Pagination of more than one model in one pagination in the view.
$model1 = Model1::paginate(10)
$model2 = Model2::paginate(10)
merge both and paginate in controller
{!! $all->render() !!}
in views
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
Pagination of more than one model in one pagination in the view.
$model1 = Model1::paginate(10)
$model2 = Model2::paginate(10)
merge both and paginate in controller
{!! $all->render() !!}
in views
@Juukie Please look in framework code - you will see, that register() and boot() methods called in one foreach(). It's logic problem.
So, if you define some service in one ServiceProvider - you cant guarantee that service is available in boot() method in any other ServiceProvider.
Upgrade Laravel Validations for better performance
example:
this validation
'role_id' => 'required|exists:roles,id,name,!Super User|exists:roles,id,name,!Manager',
to something like this,
'role_id' => 'required|exists:roles,id,name,![Super User, Manager]',
For Laravel: I would love to see
For Lumen: I would love to have more api building features, maybe a bit of what fractal & dingo/api do.
Provide built in components like Gridview and ListView with VueJs integration like Spark and controllers, models and CRUD Generator from database tables like this package
@TaylorOtwell please take a look at:
http://labs.infyom.com/laravelgenerator/
Make a SASS-enabled version of SPARK instead of using LESS
I hope see Laravel store , icludes laravel themes , starting points , plugins ...
Some great ideas here.
I'm amazed that there's not an official place to suggest these type of things (without flooding issues on GitHub).
Please make sure that with method on an Eloquent\Builder has the same life-cycle with load method on a collection.
with method queries for all the rows and filters them in PHP, this is so not ideal for performance.
Better out of the box support for polymorphic tables (eager loading etc...). See also https://laracasts.com/discuss/channels/eloquent/multiple-models-to-same-table (I'm currently working on LTS, not sure if some step in this direction has already been taken since)
@karajah90 - I like the "starting points" idea.
A list of real world GitHub Laravel starter projects; API, e-commerce, etc.
View Macros. As in Twig
Be good if elixir function in PHP helper will had an option to change the build path. Also it will be good if laravel-elixir will can be passed in gulp.pipe().
Pagination of more than one model in one pagination in the view. $model1 = Model1::paginate(10) $model2 = Model2::paginate(10) merge both and paginate in controller {!! $all->render() !!} in views
Why need to merge them and how they supposed to work?
Not so much Laravel 5.3, but ways to feed back immediately on the docs.
The current pull request system is a significant barrier to just basic feedback, and issues are disabled for some reason.
It probably took me a good 9 months to get comfortable with Laravel, and during that time I certainly would not have felt comfortable wasting everyone's time with a PR that could possibly be very wrong. Now a year in, I am comfy with the framework, but it took a long time.
The documentation is good and very nicely presented, but the way it is written somehow leaves significant things out. It's the "Apple" of documentation - very pretty, but tells the story in one way, and impossible to easily feed back upon - which as a developer, can be very frustrating. Thank goodness for Laracasts!!!
Things I would like to see from a strategic perspective to improve the docs generally:
I have a much more explicit list of comments / critique which I've been compiling in private since starting to learn Laravel about a year ago:
FWIW, I've written a fair amount of documentation for my own projects; I know how hard it is to strike the right balance!
A BelongsToThrough eloquent relationship.
I know it has been discussed on GitHub and ultimately decided against, but maybe time to think about this again?
The GitHub issues:
https://github.com/laravel/framework/issues/3052 https://github.com/laravel/framework/issues/6161
@TaylorOtwell what about dashboard and authentication in 5.3
@TaylorOtwell One of the parts of Laravel that need some improvement is localization and translation.
multilanguage!
I would love to see a new blade directive that can be used to reuse blade partials.
Here is an example of how to do it now.
http://stackoverflow.com/questions/18840775/how-to-reuse-a-blade-partial-in-a-template
Maybe something like this.
@partial('partials.panel', ['footer' => true])
@section('title', 'Cool title')
@section('body')
Cool body content.
@endsection
@section('footer')
<button>Cool action</button>
@endsection
@endpartial
@partial('partials.panel')
@section('title', 'Cool title')
@section('body')
Cool body content.
@endsection
@endpartial
One line create everything possible CRUD artisan command like InfyOmLabs/laravel-generator or even a possible merge. I know we have that package there for usage but isn't Laravel based on simplicity and quickness of building apps from scratch? :D
Create Models folder in app and place User model there
Fire events creating,created,updating, etc. for sync, update and other methods
Custom Validation. For me, the documentation seems to not give a clear instruction on how to do this.
Also +1 for Models having their own directory, makes things so much cleaner.
Also, what about a way to modify artisan commands, example: sometimes i have different directories for controllers such as Admin, this means i have to manually copy and paste a controller. What about a flag on the command such as --dir=Admin etc.
php artisan make:controller AdminController --dir=Admin // App\Http\Controllers\Admin
@Garfild The pagination merge would be useful when displaying results of search query.
So when the user enters the word "Dogs" in the search box, results from different models (articles, pages, galleries, snippets ...) should show, but then how to make sure that we show 15 records all the time across all models ?
i think it would be great if we could have a better API driver out of box for both lumen & laravel (specially laravel). the current api is not so useful for large scale projects. i am currently developing an application based on laravel (web version, API, mobile apps). we were using laravel api added in latest releases. but in in advanced situation like multi devices login on API, guest user & its not so usable. so we are planning to user third-party libraries such dingo for APIs & JWT or oAuth2 for tokens.
thanks.
Make collections compatible with Eloquent Relations.
<?php
namespace App;
use Illuminate\Support\Collection;
class UserTypes extends Collection
{
/**
* The items contained in the collection.
*
* @var array
*/
// protected $items = [
// [
// 'user_id' => 1,
// 'title' => 'Some Title'
// ]
// ];
protected $items = [
'Some Title 1',
'Some Title 2',
];
}
<?php
namespace App;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'name', 'email', 'password',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token',
];
/**
* @return Illuminate\Database\Eloquent\Relations\Relation
*/
public function types()
{
return $this->hasMany(UserTypes::class);
}
}
@davestewart I believe the docs can be improved if there are direct links to relevant pages in the API in the bottom.
Please or to participate in this conversation.