Would you advise i use vue for my front end?

|
DivByZero 2019-04-24 04:47:34
enable error reporting in your php.ini and web server
DivByZero 2019-04-24 04:47:43
and enable debug mode in your laravel
2019-04-24 08:37:34
For Amazon listing in cheap rates and free visit: https://www.fiverr.com/beonessolution/design-amazon-product-listing-infographic-image-with-the-premium-look
dotun_1 2019-04-24 13:34:45
hi guys, i’m new to laravel and i’m trying to setup my environment. I’m trying to align my mac php version to allign with the XAMPP VM php version
dotun_1 2019-04-24 13:34:57
is there anyway around this?
SkipperStrange 2019-04-24 15:31:37
Having 419 auth issues while posting using $.ajax()
SkipperStrange 2019-04-24 15:33:25
Tried including _token and header property in the post but still not working
SkipperStrange 2019-04-24 15:34:37
Please help
SkipperStrange 2019-04-24 15:35:00
I’ve roamed google for almost 2weeks now
SkipperStrange 2019-04-24 15:35:20
It’s making development sad
senhorY 2019-04-24 18:47:18
You’ll need laravel passport
Hfally 2019-04-24 20:53:38
SkipperStrange 2019-04-24 15:31:37
Having 419 auth issues while posting using $.ajax()

Hello, have you found a fix yet?

SkipperStrange 2019-04-24 20:54:01
No henry
SkipperStrange 2019-04-24 20:54:28
senhorY 2019-04-24 18:47:18
You’ll need laravel passport

I installed passport already

SkipperStrange 2019-04-24 20:54:53
SkipperStrange 2019-04-24 20:54:28
I installed passport already

Thats what I’m using for authentication

SkipperStrange 2019-04-24 20:55:48
When I issue a normal post request, it works but when its ajax, i get the 419
SkipperStrange 2019-04-24 20:56:45
I’m using a single controller method where i try to detect if the request is ajax before i save
Hfally 2019-04-24 20:58:24
SkipperStrange 2019-04-24 20:54:01
No henry

Hold on bro

Hfally 2019-04-24 20:58:55
You don’t really need passport, since its within the same application
SkipperStrange 2019-04-24 20:59:18
Hfally 2019-04-24 20:58:55
You don’t really need passport, since its within the same application

Yh

SkipperStrange 2019-04-24 21:00:39
The app has an api section which is in an api folder thats the reason ive installed passport
SkipperStrange 2019-04-24 21:00:55
But still facing the issue
Hfally 2019-04-24 21:01:01
SkipperStrange 2019-04-24 20:59:18
Yh

Add this inside your head tag:

<meta name=”csrf-token” content=”{{ csrf_token() }}”>

SkipperStrange 2019-04-24 21:01:27
Hfally 2019-04-24 21:01:01
Add this inside your head tag:

<meta name=”csrf-token” content=”{{ csrf_token() }}”>

Tried this as well

SkipperStrange 2019-04-24 21:01:45
Even adding it to the payload as a header
Hfally 2019-04-24 21:02:36
Did you also add this inside a document.ready above all other scripts:

$.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } });

SkipperStrange 2019-04-24 21:03:12
Hfally 2019-04-24 21:02:36
Did you also add this inside a document.ready above all other scripts:

$.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } });

In the header tag?

senhorY 2019-04-24 21:04:19
Have you run passport:key?
SkipperStrange 2019-04-24 21:04:41
Cant remember
SkipperStrange 2019-04-24 21:04:49
Let me run it again
senhorY 2019-04-24 21:04:52
Try it
Hfally 2019-04-24 21:05:41
SkipperStrange 2019-04-24 21:03:12
In the header tag?

No, before making any ajax call…

<script>
$(function (){

$.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } });

});
</script>

SkipperStrange 2019-04-24 21:05:54
Ok
senhorY 2019-04-24 21:05:56
I always do the ajax requests with Vue, and laravel has the headers already set up for me
SkipperStrange 2019-04-24 21:06:09
Ok
Hfally 2019-04-24 21:06:38
Hfally 2019-04-24 21:05:41
No, before making any ajax call…

<script>
$(function (){

$.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: $(‘meta[name=”csrf-token”]’).attr(‘content’) } });

});
</script>

Add this to your master blade after your jquery and before any other custom script

SkipperStrange 2019-04-24 21:06:51
Would you advise i use vue for my front end?
senhorY 2019-04-24 21:07:09
No if you don’t need it
SkipperStrange 2019-04-24 21:07:18
Ok
SkipperStrange 2019-04-24 21:07:35
Hfally 2019-04-24 21:06:38
Add this to your master blade after your jquery and before any other custom script

I’m trying this

SkipperStrange 2019-04-24 21:07:46
Will let you guys know
Hfally 2019-04-24 21:07:53
Hfally 2019-04-24 21:06:38
Add this to your master blade after your jquery and before any other custom script

This should however be done with this:

<meta name=”csrf-token” content=”{{ csrf_token() }}”>

In ur head tag

Hfally 2019-04-24 21:08:13
SkipperStrange 2019-04-24 21:07:35
I’m trying this

Alright bro

SkipperStrange 2019-04-24 21:09:40
Quick question
senhorY 2019-04-24 21:10:03
Why not this:

<script>
$(function (){
$.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: {{csrf_token()}} } });

});
</script>

SkipperStrange 2019-04-24 21:10:28
This would mean I don’t need to include @csfr in the ajax form if I’m right?
Hfally 2019-04-24 21:10:37
SkipperStrange 2019-04-24 21:10:28
This would mean I don’t need to include @csfr in the ajax form if I’m right?

Yh exactly..

Hfally 2019-04-24 21:11:01
senhorY 2019-04-24 21:10:03
Why not this:

<script>
$(function (){
$.ajaxSetup({ headers: { ‘X-CSRF-TOKEN’: {{csrf_token()}} } });

});
</script>

I don’t get the question bro?

senhorY 2019-04-24 21:11:37
Hfally 2019-04-24 21:11:01
I don’t get the question bro?

I mean you could include the csrf_token right inside the js

senhorY 2019-04-24 21:11:50
No need for the meta tag
|