I am beginner in Laravel. I have project in Laravel 5.8.
I have this code:
Schema::create('user_profile_images', function (Blueprint $table) {
$table->bigIncrements('id');
$table->bigInteger('user_id')->unsigned();
$table->foreign('user_id')->references('id')->on('users')->onDelete('cascade');
$table->string('path1', 255);
$table->smallInteger('number1')->default(0);
$table->string('path2', 255);
$table->smallInteger('number2')->default(0);
$table->string('path3', 255);
$table->smallInteger('number3')->default(0);
$table->string('path4', 255);
$table->smallInteger('number4')->default(0);
$table->string('path5', 255);
$table->smallInteger('number5')->default(0);
$table->string('path6', 255);
$table->smallInteger('number6')->default(0);
$table->string('path7', 255);
$table->smallInteger('number7')->default(0);
$table->ipAddress('ip');
$table->engine = "InnoDB";
$table->charset = 'utf8mb4';
$table->collation = 'utf8mb4_unicode_ci';
});
User.php
public function UserProfileImageGallery()
{
return $this->hasMany('App\UserProfileImage', 'user_id', 'id');
}
I need to display the user's path (path1, path2, path3, path4 ... path7) in order of number (number1, number2, number3 ... number7).
for example:
$path1 = "www1";
$number1 = 2;
$path2 = "www2";
$number2 = 1;
$path3 = "www3";
$number3 = 3;
In result I need:
www2, www1, www3
How can I make it?
from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/2BVDy4o
via IFTTT
Aucun commentaire:
Enregistrer un commentaire