Hey, is there any way to login both in API and Session in Laravel?

|
Silvana744 2019-02-01 10:14:28
StanleyMasinde 2019-02-01 10:12:43
I get your point thanks

You’re welcome. Search for Javascript libraries that make your life a whole lot easier 🙂

StanleyMasinde 2019-02-01 10:15:58
StanleyMasinde 2019-02-01 10:11:11
Change ownership to www-data (the whole folder) then permissions to 744 for folders and 644 for files

chown -r www-data:www-data /yourproject
this will make your server the owner of the files and set its permission to 7 and others 4

StanleyMasinde 2019-02-01 10:16:14
Silvana744 2019-02-01 10:14:28
You’re welcome. Search for Javascript libraries that make your life a whole lot easier 🙂

Headed to npmjs.org

sonvisalpv 2019-02-01 10:21:10
it still error
StanleyMasinde 2019-02-01 10:22:30
sonvisalpv 2019-02-01 10:21:10
it still error

That error is caused by lack of proper permissions. What server are you on

sonvisalpv 2019-02-01 10:23:07
i am use ec2
StanleyMasinde 2019-02-01 10:23:55
sonvisalpv 2019-02-01 10:23:07
i am use ec2

I don’t know what that is

sonvisalpv 2019-02-01 10:25:15
aws
sonvisalpv 2019-02-01 10:25:20
server
StanleyMasinde 2019-02-01 10:25:52
sonvisalpv 2019-02-01 10:25:20
server

It’s a vps right?

sonvisalpv 2019-02-01 10:26:03
yes
StanleyMasinde 2019-02-01 10:26:10
What os?
sonvisalpv 2019-02-01 10:26:25
ubuntu
StanleyMasinde 2019-02-01 10:26:35
Install apache2
StanleyMasinde 2019-02-01 10:26:57
Or nginx
sonvisalpv 2019-02-01 11:14:25
i am use both
sonvisalpv 2019-02-01 11:14:32
bc use vestcap
StanleyMasinde 2019-02-01 11:54:33
Ok fix the permissions I see no problem with vendor being 777
sonvisalpv 2019-02-01 11:55:06
i am try to chmod 777 already but still
StanleyMasinde 2019-02-01 11:57:54
sonvisalpv 2019-02-01 11:55:06
i am try to chmod 777 already but still

Do it recursively
chmod -R 777

sonvisalpv 2019-02-01 11:59:52
ok late me try again
l_alexis 2019-02-01 16:43:10
Hey, is there any way to login both in API and Session in Laravel?
There is API-route using Passport and I need save the login data to Session. I’ve tried to save the session data manually:
Auth::guard(‘web’)->getSession()->put(
Auth::getName(),
$user->getAuthIdentifier()
);
and that does not work. Right after this I can see the user ID in Auth::getSession(), but there is nothing when I try to open another page.
Shahdadiaria 2019-02-01 17:06:00
l_alexis 2019-02-01 16:43:10
Hey, is there any way to login both in API and Session in Laravel?
There is API-route using Passport and I need save the login data to Session. I’ve tried to save the session data manually:
Auth::guard(‘web’)->getSession()->put(
Auth::getName(),
$user->getAuthIdentifier()
);
and that does not work. Right after this I can see the user ID in Auth::getSession(), but there is nothing when I try to open another page.

i had the same problem in lumen it solve when i start session in web.php i think if you start session in route.php your problem will solve

l_alexis 2019-02-01 17:08:30
Shahdadiaria 2019-02-01 17:06:00
i had the same problem in lumen it solve when i start session in web.php i think if you start session in route.php your problem will solve

Auth::getSession()->regenerate()?

Shahdadiaria 2019-02-01 17:09:09
no
session_start();
l_alexis 2019-02-01 17:11:38
Shahdadiaria 2019-02-01 17:09:09
no
session_start();

does not work. By the way, dump(Auth::getSession()) outputs not same session ID as in another page (but both the requests has the same laravel_session value)

Shahdadiaria 2019-02-01 17:12:51
what do you saving in session ?
l_alexis 2019-02-01 17:13:16
I need to make the User authorized in the session
Shahdadiaria 2019-02-01 17:14:17
l_alexis 2019-02-01 17:13:16
I need to make the User authorized in the session

if you’r using API save token in session

l_alexis 2019-02-01 17:15:30
Shahdadiaria 2019-02-01 17:14:17
if you’r using API save token in session

are you about the accessToken created by Passport?

Shahdadiaria 2019-02-01 17:18:29
i dont know how you developed your site but i generate a token when a user create account and when the user login i save the token in his session this way i authoriz my user
l_alexis 2019-02-01 17:23:17
I’m using API for Vue frontnend and on login I generate a token just like you said. Now I need to restrict access to a web route so I need load the user by Auth::user(). The problem is that user was authorized using api guard and I’m trying to get the user using web guard
l_alexis 2019-02-01 17:26:23
To check the user using SessionGuard I supposedly need to save the user ID to session while login, but it uses different session ID and don’t even create the session file in storage/framework/sessions
l_alexis 2019-02-01 17:27:52
I’ve also tried to add StartSession and EncryptCookies middlewares to api middleware group and this didn’t help
berlin5556666 2019-02-02 10:05:59
hi guys

i have some table
1. Follow Table that contains follower and following user_id

2. user table

3. post table

i want get paginated posts of people that i following

can you help me that how to retrieve posts ?

Best regards

Kevi 2019-02-02 10:20:51
Using Eloquent or DB Builder?
Ahmed Magdi 2019-02-02 11:04:56
You have 3 tables

One for users
And one for posts
And one for flowers
The last one based in relationship between users and posts
Mean it contains user_id and post_id
From these tabel you can retrieve posts that you following

berlin5556666 2019-02-02 15:18:02
Kevi 2019-02-02 10:20:51
Using Eloquent or DB Builder?

eloquent

berlin5556666 2019-02-02 15:19:05
Ahmed Magdi 2019-02-02 11:04:56
You have 3 tables

One for users
And one for posts
And one for flowers
The last one based in relationship between users and posts
Mean it contains user_id and post_id
From these tabel you can retrieve posts that you following

the last just contains follower and following id

LookBig 2019-02-02 17:19:15
StanleyMasinde 2019-02-01 09:02:04
Guys I need your opinion here.

Which is better? Creating pdfs on the backend ( this seems to take lots of time)

Or printing it on the front-end using JavaScript?

Let’s talk

https://plugins.jquery.com/PrintArea/

PrintArea | jQuery Plugin RegistryJquery
StanleyMasinde 2019-02-02 17:19:57
LookBig 2019-02-02 17:19:15
https://plugins.jquery.com/PrintArea/

Thank you but that wasn’t what I was looking for

ilyosdev 2019-02-02 17:25:30
StanleyMasinde 2019-02-01 09:02:04
Guys I need your opinion here.

Which is better? Creating pdfs on the backend ( this seems to take lots of time)

Or printing it on the front-end using JavaScript?

Let’s talk

It depends on your project

Leetump 2019-02-02 17:40:19
How I integrate admin panel
Leetump 2019-02-02 17:41:17
In laravel
murodkadirkhanoff 2019-02-02 17:48:37
Leetump 2019-02-02 17:40:19
How I integrate admin panel

Voyager

Leetump 2019-02-02 17:51:39
What
murodkadirkhanoff 2019-02-02 18:22:34
Leetump 2019-02-02 17:51:39
What

Searchin google voyager laravel

ErgashevXurshid 2019-02-02 18:31:57
murodkadirkhanoff 2019-02-02 17:48:37
Voyager

Yes right

Leetump 2019-02-02 18:33:42
But How I integrate
Ahmed Magdi 2019-02-02 18:40:51
berlin5556666 2019-02-02 15:19:05
the last just contains follower and following id

Yes … but following id is means users or posts?

|