Those course that you created, have secuencial ID?

|
sobirjonovs 2020-12-27 19:57:27
Bhuvi100 2020-12-27 19:56:31
Fillables?

No. If I write plain text inside create([]) method, everything works fine. But for $data, is not

sobirjonovs 2020-12-27 20:01:57
🙄 I think this problem is New Year gift for me
Bhuvi100 2020-12-27 20:04:04
Whether the validation pass?
Bhuvi100 2020-12-27 20:04:19
Did you check it?
Bhuvi100 2020-12-27 20:04:39
sobirjonovs 2020-12-27 20:01:57
🙄 I think this problem is New Year gift for me

Lol,no it would be a simple mistake

sobirjonovs 2020-12-27 20:05:18
Bhuvi100 2020-12-27 20:04:19
Did you check it?

yes

Bhuvi100 2020-12-27 20:06:23
Did you check it via code?
Bhuvi100 2020-12-27 20:06:36
Sometimes you may think the validation will pass but it wont
DesolatorMagno 2020-12-27 20:06:38
I don’t make often validation inside the controller, but did you try? $values = $request->validate([])
DesolatorMagno 2020-12-27 20:07:07
It should check automatically if it work, and return the validated data.
Bhuvi100 2020-12-27 20:07:29
DesolatorMagno 2020-12-27 20:06:38
I don’t make often validation inside the controller, but did you try? $values = $request->validate([])

This is the one which we use the most

Bhuvi100 2020-12-27 20:07:40
Try this way
sobirjonovs 2020-12-27 20:09:53
Bhuvi100 2020-12-27 20:06:23
Did you check it via code?

laravel_discuss-64428.jpg
yes ofc!

sobirjonovs 2020-12-27 20:10:50
I think something wrong with $data or something else similar it…, ugh.
sobirjonovs 2020-12-27 20:11:30
if I debug $data, all data is provided. No error is detected.
Bhuvi100 2020-12-27 20:11:53
Weird
sobirjonovs 2020-12-27 20:11:56
very confusing, shit.
Bhuvi100 2020-12-27 20:12:18
Happens a lot
❤️ ᴍɪɢʜᴛⓨ 🌹 2020-12-27 20:12:21
In my contact form route in web.php
Route::get(‘/front/contact’,’app/http/controller/contactcontroller@index);
Route::post(‘/front/contact/submit’,’app/http/controller/contactcontroller@store’);
But my error is route not defined /front/contact/submit.
How to solve this ,please help me
Bhuvi100 2020-12-27 20:12:55
The problem would be there but you won’t find it
sobirjonovs 2020-12-27 20:13:23
yeah… If it found, you know that’s very simple buggy ))
Bhuvi100 2020-12-27 20:13:45
Yep
Bhuvi100 2020-12-27 20:14:33
I mostly endup solving these confusing stuffs just by adding the properties in fillables
sobirjonovs 2020-12-27 20:17:04
Bhuvi100 2020-12-27 20:14:33
I mostly endup solving these confusing stuffs just by adding the properties in fillables

yes, but I had already defined them in the fillable property

sobirjonovs 2020-12-27 20:18:39
laravel_discuss-64440.jpg
problem is here…
sobirjonovs 2020-12-27 20:19:46
If I rewrite it with plain text, it submits it:

$course = Course::create([
‘title’ => ‘title’,
‘description’ => ‘content’,
‘author_id’ => auth()->user()->id,
‘slug’ => Str::slug(‘title’, ‘-‘),
‘price’ => 1000,
‘promo_url’ => ‘promo’,
]);

DesolatorMagno 2020-12-27 20:25:40
Try returning $data, and check every value, you can also make a Course instead of create and return it to see the data.
sobirjonovs 2020-12-27 20:29:02
DesolatorMagno 2020-12-27 20:25:40
Try returning $data, and check every value, you can also make a Course instead of create and return it to see the data.

laravel_discuss-64445.jpg
I did as you said, everything seems ok, but it is not being created with create() method

DesolatorMagno 2020-12-27 20:40:41
Try 1 for 1, could be a tipo.
DesolatorMagno 2020-12-27 20:56:24
sobirjonovs 2020-12-27 20:19:46
If I rewrite it with plain text, it submits it:

$course = Course::create([
‘title’ => ‘title’,
‘description’ => ‘content’,
‘author_id’ => auth()->user()->id,
‘slug’ => Str::slug(‘title’, ‘-‘),
‘price’ => 1000,
‘promo_url’ => ‘promo’,
]);

Those course that you created, have secuencial ID? Or there is a jump in the number?

sobirjonovs 2020-12-27 20:58:06
DesolatorMagno 2020-12-27 20:56:24
Those course that you created, have secuencial ID? Or there is a jump in the number?

yes, there is

DesolatorMagno 2020-12-27 21:01:15
sobirjonovs 2020-12-27 20:29:02
I did as you said, everything seems ok, but it is not being created with create() method

If you se here what you use as real data and what you use as plain text is not the same.

DesolatorMagno 2020-12-27 21:03:48
sobirjonovs 2020-12-27 20:19:46
If I rewrite it with plain text, it submits it:

$course = Course::create([
‘title’ => ‘title’,
‘description’ => ‘content’,
‘author_id’ => auth()->user()->id,
‘slug’ => Str::slug(‘title’, ‘-‘),
‘price’ => 1000,
‘promo_url’ => ‘promo’,
]);

Use plain text but change 1 field at a time with the real data.

sobirjonovs 2020-12-27 21:04:25
DesolatorMagno 2020-12-27 21:01:15
If you se here what you use as real data and what you use as plain text is not the same.

laravel_discuss-64454.jpg
It is a result of 👆 ( instead of ::create(), used ::make() as you said)

DesolatorMagno 2020-12-27 21:06:02
Yes, you can try save() and If doesn’t save that means that the problem is saving.
|