How to update data in laravel by modal without refresh page and ajax?

|
Shijinsubramanniam 2020-06-24 11:46:04
laravel_discuss-42785.jpg
Web
Shijinsubramanniam 2020-06-24 11:46:31
laravel_discuss-42786.jpg
When I submit
Shijinsubramanniam 2020-06-24 11:46:43
Anybody plz help
nachtpanda 2020-06-24 12:11:01
apache error
nachtpanda 2020-06-24 12:11:44
my advice is not to use xampp, especially not on windows
nachtpanda 2020-06-24 12:11:56
you will go from error to error
AlkaouDembele 2020-06-24 14:03:43
Shijinsubramanniam 2020-06-24 11:46:31
When I submit

Create UploadController, create the function Upload, give a name to your Route and call the name of your route in your form’s Action

devmansurov 2020-06-24 15:12:09
How to create correct relationships in laravel for attributes

Models:

Product

Each product has one category and multiple attributes

Category

Each category has many products and attibutes with custom values for category

Attribute

My problem is only in attribute model. This model contain only unique attributes name.
Each attribute has different value by category (e.g “size” attribute in “T-shirts” category has values like “X”, “S”, “XL” and in “boots” category has “39”, “41”, “42” values). I can’t create right solution to create relationships in this case for correctly get/search products by attribute or save/sync attributes to products using relationships.

jung_doeng 2020-06-24 15:42:44
laravel_discuss-42796.jpg
halo, any body can resolve my stuck?
jung_doeng 2020-06-24 15:43:42
laravel_discuss-42797.jpg
this my template
Sean_LGR 2020-06-24 15:43:43
jung_doeng 2020-06-24 15:42:44
halo, any body can resolve my stuck?

Please paste the code

jung_doeng 2020-06-24 15:43:52
ok, wait
Sean_LGR 2020-06-24 15:44:08
Your controller
jung_doeng 2020-06-24 15:44:13
just a while..
jung_doeng 2020-06-24 15:44:31
public function store(Request $request)
{
$relasi = new Relasi();
// $gejalas = new Gejala();

$this->validate($request, [
‘permasalahan_id’ => ‘required’,
‘gejala_id’ => ‘required’,
]);

/* $relasi = [
‘permasalahan_id’ => $request[‘permasalahan_id’],
‘gejala_id’ => $request[‘gejala_id’],
];
*/
$relasi = Relasi::create($request->only([‘permasalahan_id’,’gejala_id’]));
// mengambil nilai dari inputan gejala
$gejalas = explode(“,”, $relasi);
// variable pengumpul nilai pada inputan gejala
$gejalas_ids = [];
foreach ($gejalas as $gejala) {
$gejala_db = Gejala::where(‘keteranganGejala’, trim($gejala))->firstOrCreate([‘keteranganGejala’ => trim($gejala)]);
$gejalas_ids[] = $tag_db->id;
}

$relasi->gejala()->attach($gejalas_ids);
// $relasi->save();
dd($relasi);
// return redirect()->route(‘relasi.index’)->with(‘status’,’Data Relasi Berhasil di Tambah’);
}

jung_doeng 2020-06-24 15:45:33
<div class=”form-group”>
<label>Gejala-gejala </label>
<div class=”col-md-12″>
@foreach ($gejala as $gejala)
<div class=”checkbox”>
<label><input class=”flat” type=”checkbox” name=”gejala_id[]” value=”{{ $gejala->id }}”> {{ $gejala->keteranganGejala }} </label>
</div>
@endforeach
</div>
</div>
jung_doeng 2020-06-24 16:01:15
jung_doeng 2020-06-24 15:44:31
public function store(Request $request)
{
$relasi = new Relasi();
// $gejalas = new Gejala();

$this->validate($request, [
‘permasalahan_id’ => ‘required’,
‘gejala_id’ => ‘required’,
]);

/* $relasi = [
‘permasalahan_id’ => $request[‘permasalahan_id’],
‘gejala_id’ => $request[‘gejala_id’],
];
*/
$relasi = Relasi::create($request->only([‘permasalahan_id’,’gejala_id’]));
// mengambil nilai dari inputan gejala
$gejalas = explode(“,”, $relasi);
// variable pengumpul nilai pada inputan gejala
$gejalas_ids = [];
foreach ($gejalas as $gejala) {
$gejala_db = Gejala::where(‘keteranganGejala’, trim($gejala))->firstOrCreate([‘keteranganGejala’ => trim($gejala)]);
$gejalas_ids[] = $tag_db->id;
}

$relasi->gejala()->attach($gejalas_ids);
// $relasi->save();
dd($relasi);
// return redirect()->route(‘relasi.index’)->with(‘status’,’Data Relasi Berhasil di Tambah’);
}

somebody can resolve my problem, please?

natghi2010 2020-06-24 17:07:26
jung_doeng 2020-06-24 15:45:33
<div class=”form-group”>
<label>Gejala-gejala </label>
<div class=”col-md-12″>
@foreach ($gejala as $gejala)
<div class=”checkbox”>
<label><input class=”flat” type=”checkbox” name=”gejala_id[]” value=”{{ $gejala->id }}”> {{ $gejala->keteranganGejala }} </label>
</div>
@endforeach
</div>
</div>

how is this working?

natghi2010 2020-06-24 17:07:39
@foreach ($gejala as $gejala)
jung_doeng 2020-06-24 17:10:58
natghi2010 2020-06-24 17:07:26
how is this working?

i change it to

@foreach($gejala as $g)
..

natghi2010 2020-06-24 17:11:12
okay
laksomphear 2020-06-24 17:20:51
How to update data in laravel by modal without refresh page and ajax?
psarmmiey 2020-06-24 17:37:20
Hi friends, I kinda need a Favour right now. We need a thousand photographers to fill this form. It’s for a stock photo website.

This project is built to enhance African stock photo.

Fill and share the link. https://forms.gle/wS1V8kUYdvRL9mZk8

Fricapix – African Stock PhotosGoogle Docs
African Stock Photos, royalty-free images | Search millions of royalty free stock images, and photos from Africa.
natghi2010 2020-06-24 17:42:39
laksomphear 2020-06-24 17:20:51
How to update data in laravel by modal without refresh page and ajax?

magic

laksomphear 2020-06-24 17:43:05
natghi2010 2020-06-24 17:42:39
magic

Please

natghi2010 2020-06-24 17:43:19
laksomphear 2020-06-24 17:43:05
Please

new window i guess

natghi2010 2020-06-24 17:43:38
as soon as the update is fininshed
natghi2010 2020-06-24 17:43:50
run <script>window.close</script>
natghi2010 2020-06-24 17:44:22
the problem is
natghi2010 2020-06-24 17:44:46
your current window ill not get the update
laksomphear 2020-06-24 17:44:48
Please give me the proccess
laksomphear 2020-06-24 17:46:01
Or solution
2020-06-24 18:11:45
Guys is there any advance examples/projects for complete blog based on laravel 7?

There are many available but older versions, 7 has many updates which made things more easier.

If you know any, pls share.

2020-06-24 18:12:23
6/7 of the versions.
Unknownuser009 2020-06-24 18:47:57
I will send u
iambelousov 2020-06-24 19:20:55
Send me too please
hanumantdhavale 2020-06-24 19:21:46
Please send me too
Unknownuser009 2020-06-24 19:22:31
I will send u link here
2020-06-24 20:09:30
Unknownuser009 2020-06-24 18:47:57
I will send u

Thanks bro..waiting for the time.

Shijinsubramanniam 2020-06-24 20:20:19
AlkaouDembele 2020-06-24 14:03:43
Create UploadController, create the function Upload, give a name to your Route and call the name of your route in your form’s Action

I cleared that

Shijinsubramanniam 2020-06-24 20:20:41
Cleared
amirAutomationEnginner 2020-06-24 20:26:47
Unknownuser009 2020-06-24 19:22:31
I will send u link here

Send the link here

sobirjonovs 2020-06-24 20:39:37
laravel_discuss-42841.jpg
Help….
DesolatorMagno 2020-06-24 20:55:31
Are you sure the relationship is well done?
DesolatorMagno 2020-06-24 20:55:47
try adding data first and try using the relationship
sobirjonovs 2020-06-24 20:58:49
laravel_discuss-42844.jpg

sobirjonovs 2020-06-24 21:00:35
hasMany relationship
cayetanohosma 2020-06-24 21:00:49
sobirjonovs 2020-06-24 20:39:37
Help….

Are you sure that course_id = 1 exists in course table?

DesolatorMagno 2020-06-24 21:00:59
and remember that you are creating, so you need to take care of fillable.
sobirjonovs 2020-06-24 21:01:54
DesolatorMagno 2020-06-24 21:00:59
and remember that you are creating, so you need to take care of fillable.

Yes, I had added it before

|