So, the order is right but the number in the html table is wrong?

|
web design 2022-03-16 21:16:03
bsamaasi 2022-03-16 21:14:42
I mean you migration file

Which file name?

web design 2022-03-16 21:20:15
bsamaasi 2022-03-16 21:14:42
I mean you migration file

categories or attributes or migrations table?

web design 2022-03-16 21:20:29
bsamaasi 2022-03-16 21:14:42
I mean you migration file

Which?

bsamaasi 2022-03-16 21:21:27
Categories migration must come before attributes migration, so during migration it will be created first
web design 2022-03-16 21:23:56
bsamaasi 2022-03-16 21:21:27
Categories migration must come before attributes migration, so during migration it will be created first

Yes, that’s it

web design 2022-03-16 21:24:59
bsamaasi 2022-03-16 21:21:27
Categories migration must come before attributes migration, so during migration it will be created first

laravel_discuss-111915.jpg

BetsiFlash 2022-03-16 21:26:01
Guys i need help
When i try to install composer it fail and shows something like Script error
bsamaasi 2022-03-16 21:26:17
web design 2022-03-16 21:24:59

And you did migrate perfectly

bsamaasi 2022-03-16 21:26:34
Then when do you have the error???
web design 2022-03-16 21:27:40
bsamaasi 2022-03-16 21:26:17
And you did migrate perfectly

Yes. All

web design 2022-03-16 21:28:20
bsamaasi 2022-03-16 21:26:34
Then when do you have the error???

laravel_discuss-111921.jpg

bsamaasi 2022-03-16 21:32:28
web design 2022-03-16 21:28:20

Please can you drop the content you wanted to update

bsamaasi 2022-03-16 21:32:47
bsamaasi 2022-03-16 21:32:28
Please can you drop the content you wanted to update

Your code will be fine

web design 2022-03-16 21:34:38
bsamaasi 2022-03-16 21:32:28
Please can you drop the content you wanted to update

I did not understand what you meant.

web design 2022-03-16 21:35:11
bsamaasi 2022-03-16 21:32:47
Your code will be fine

Which my code?

bsamaasi 2022-03-16 21:35:26
web design 2022-03-16 21:28:20

The code that cause the error, paste it here

web design 2022-03-16 21:37:13
bsamaasi 2022-03-16 21:35:26
The code that cause the error, paste it here

public function update(Request $request, Attribute $attribute)
{
$attributes = collect($request->input(‘attributes’));
$attributes->each(function ($item) use ($request, $attribute) {
if (isset($item[‘name’])) {
$data = [
‘category_id’ => $request->category_id,
‘name’ => $item[‘name’],
];
$attribute_item = Attribute::query()->updateOrCreate([‘id’ => $item[‘id’] ?? null]);
$attribute_item->fill($data)->save();
} else {
return null;
}
if (isset($item[‘value’])) {
$attribute_item->items()->delete();
foreach ($item[‘value’] as $key => $value) {
$attribute_item->items()->create([
‘value’ => $value,
‘field’ => $item[‘field’][$key],
]);
}
}
});
return redirect()->route(‘attributes.index’);
}

web design 2022-03-16 21:40:05
This error occurred in the following line.

$attribute_item = Attribute::query()->updateOrCreate([‘id’ => $item[‘id’] ?? null])

bsamaasi 2022-03-16 21:45:48
web design 2022-03-16 21:40:05
This error occurred in the following line.

$attribute_item = Attribute::query()->updateOrCreate([‘id’ => $item[‘id’] ?? null])

Yeah it was my point of suspicion, have bother to dig deep into that function

bsamaasi 2022-03-16 21:46:18
bsamaasi 2022-03-16 21:45:48
Yeah it was my point of suspicion, have bother to dig deep into that function

It performs the very save you are doing…

bsamaasi 2022-03-16 21:47:29
Try to break complex conditions into methods… suggestions
web design 2022-03-16 21:50:10
bsamaasi 2022-03-16 21:47:29
Try to break complex conditions into methods… suggestions

Can you replace up this codes?

bsamaasi 2022-03-16 21:51:03
web design 2022-03-16 21:50:10
Can you replace up this codes?

You want me to refactor the code you mean?

web design 2022-03-16 21:52:30
bsamaasi 2022-03-16 21:51:03
You want me to refactor the code you mean?

ye

web design 2022-03-16 21:52:41
ss
devpsoft 2022-03-17 02:03:04
https://GitHub.com/rabie85/laravel-crud-ajax
Crud with Ajax with ordering list by drag and drop

GitHub – rabie85/laravel-crud-ajaxGitHub
Contribute to rabie85/laravel-crud-ajax development by creating an account on GitHub.
AzerMammadli 2022-03-17 03:52:34
Hello guys.
I have a problem. I think you can help me.

I use this ” $post = Posts::latest()->paginate(10); ”
I result all data from latest but I cannot use sort list on blade.
I can use just this ” {{$post->firstItem() + $loop->index}} ”
But it’s sorting from 1. 2. 3, 5, 6, 7 but I want to sort from last intager. for ex: 100, 99, 98, 97 like that.
How can I do it?
Thanks ))

DesolatorMagno 2022-03-17 04:29:40
AzerMammadli 2022-03-17 03:52:34
Hello guys.
I have a problem. I think you can help me.

I use this ” $post = Posts::latest()->paginate(10); ”
I result all data from latest but I cannot use sort list on blade.
I can use just this ” {{$post->firstItem() + $loop->index}} ”
But it’s sorting from 1. 2. 3, 5, 6, 7 but I want to sort from last intager. for ex: 100, 99, 98, 97 like that.
How can I do it?
Thanks ))

Try to explain better because I don’t understand the question.

AzerMammadli 2022-03-17 04:44:00
but since I placed all the articles last in the admin panel, I want them to go backwards. Every time I add a new article, the row number of the article becomes 1. but the order of the last article I added should be 100, for example, the article before the last article should be 99.
DesolatorMagno 2022-03-17 04:49:24
So, the order is right but the number in the html table is wrong?
Aman 2022-03-17 05:50:52
laravel_discuss-111953.jpg
Anyone can help me in removing this big Google icon and search bar
from the middle of screen
Issue Resolver 2022-03-17 06:19:05
Hi , full stack developer here, if u guys need any kind of project or help in resolving bugs of ur project, contact me. Thanks
Bhavyakumar Panchotiya 2022-03-17 10:20:14
Anybody have any Ready-made projects of laravel ?
Atta Ksery 2022-03-17 11:12:42
when I am trying to access on localhost:9200 to work with elastic search … I don’t know what did that mean (Username and password)
Atta Ksery 2022-03-17 11:13:12
laravel_discuss-111961.jpg
like this
|