What I do is have a sort field in my images table which gets increments every time I save an image in my database
Then using drag and drop I can order my images, which is another subject on its own.
I actually created a service provider which makes sure to increment the sort field each time a new model is saved if I specified if it has an attribute autoIncrementSort set to true! Which makes this work across all my models I want to be able to sort!
<?php namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use \Event;
use \DB;
class SortIncrementServiceProvider extends ServiceProvider {
public function register()
{
$this->registerEvents();
}
public function registerEvents()
{
Event::listen('eloquent.creating*', function ($model) {
if ($model->autoIncrementSort) {
$model->sort = DB::table($model->getTable())->max('sort') + 1 ;
}
});
}
}