JavaScript

Topic: Anything JavaScript, ECMAScript including Node, React, ...
Aug 8, 2018 19:15
u guys rock! :D gonna do some stuff with laravel tonight
Aug 8, 2018 19:14
Thanks! :D
Aug 8, 2018 19:14
@MadaraUchiha Now it makes sence
Aug 8, 2018 19:12
Can we use this to clear the timeout like clearTimeout(14531)?
Aug 8, 2018 19:12
14531
Aug 8, 2018 19:12
@MadaraUchiha nice
Aug 8, 2018 19:11
@MadaraUchiha Im quite confused :df
Aug 8, 2018 19:11
@MadaraUchiha the doSomething function?
Aug 8, 2018 19:09
Or am I wrong?
Aug 8, 2018 19:09
We won't be able to clearTimeout if it's not assigned to the variable\
Aug 8, 2018 19:09
But why do we need these id's then?
Aug 8, 2018 19:09
exactly what u just wrote
Aug 8, 2018 19:09
I used to use something like: yea
Aug 8, 2018 19:08
@LadyBird wow, didn't know that! :)
Aug 8, 2018 19:08
@lady From what value?
Aug 8, 2018 19:08
@LadyBird you mean whenever i create a setTimeout, the browser gives an id to it?
Aug 8, 2018 19:07
@LadyBird wow
Aug 8, 2018 19:06
@LadyBird How the numebr became 2862?
Aug 8, 2018 19:05
wtf :D
Aug 8, 2018 18:54
wanna join me?
Aug 8, 2018 18:54
Who plays clash royale here or csgo?
Aug 8, 2018 18:54
So we can talk about anything, right :d
Aug 8, 2018 18:53
Guys, is this chat about the opinion based question in JS? :)
Aug 8, 2018 12:01
Hey guys wasup
 
Aug 8, 2018 12:38
Are you here? :(
Aug 8, 2018 12:16
Where did u put those session variables when working on the Laravel project?
Aug 8, 2018 12:15
I'm a bit curious why you think it's a bad idea
Aug 8, 2018 12:15
That wouldn't be good if I tried to install a new version of it
Aug 8, 2018 12:14
I could possible to it in the index.php file (of the laravel installation).
Aug 8, 2018 12:14
The only global place to put things specially created for that is Service Provider
Aug 8, 2018 12:13
I'm quite a newbie to Laravel, not sure where to put things :d
Aug 8, 2018 12:09
Why can I use it in the service provider?
Aug 8, 2018 12:09
I don't wanna get into the WP, the WP is only for the admin panel, + -.
Aug 8, 2018 12:09
Not WP session, laravel
Aug 8, 2018 12:00
I'm looking for a way to do it globally.
Aug 8, 2018 12:00
It's not a good place because changing the theme will break these session variables.
Aug 8, 2018 11:59
session([
    'currentUser' => wp_get_current_user(),
    'user' => session('currentUser')->user_login
]);
Aug 8, 2018 11:59
I've set this session data inside the WP theme header.php file:
Aug 8, 2018 11:58
Yea, sure
Aug 8, 2018 11:56
I've been using session('...') to get the value and session(['...' => '...']) to set it but that's just a shortcut. Where should I place session data? I'm sorry if it feels like you've already my question. I'd like to know what's the best way in this situation. Maybe it's very valuable to others but maybe someone here also trying to connect WP with the Laravel and have the same question :) Why putting this data in the Service Provider is bad? Didn't quite understand why it's not a good way? - "I'll have to call that controller on boot while using the boot function, I wouldn't need that."
Aug 8, 2018 11:56
Nice question! :) Yea, I'd need it only for the Laravel. There is a .htaccess file, which redirects to the Laravel public path.
Aug 8, 2018 11:56
Oh, ok, sorry about that. It's the Laravel integrated to the WordPress (but it's a different folder - laravel: prntscr.com/kg5f5e. Inside that folder, you can see a basic file structure of the Laravel: prntscr.com/kg5g3x. It's not a plugin. I've loaded WP functions (wp-load.php file) in the Laravel Service Provider here: prntscr.com/kg5ijm. No fancy stuff here :) The session data I'd like to store is simple. Basic strings and integers :)
Aug 8, 2018 11:56
Where would you put them in my situation? I understand "anywhere you want" but it's not very helpful.
Aug 8, 2018 11:56
Yea, thanks, I simply would like to learn the best practices, so in the future, it's gonna be simple :) But then I'll have to call that controller on boot while using the boot function, I wouldn't need that. Am I right?
Aug 8, 2018 11:56
By saying module, you mean inside the controller? I would have to load that controller every time, maybe using built-in Service Provider boot function would be a better approach?
Aug 8, 2018 11:56
Thank you for the answer, I've already read the full Session documentation on the Laravel :) The problem, I'd like to know where is the best place to store them. By the way, Session::put('hello','world'); Session::save(); syntax is no longer submitted in the newest Laravel docs you linked :)