Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auth::user(), Session and Cookies are not carry over #46

Open
ginndee opened this issue Apr 17, 2019 · 0 comments
Open

Auth::user(), Session and Cookies are not carry over #46

ginndee opened this issue Apr 17, 2019 · 0 comments

Comments

@ginndee
Copy link

ginndee commented Apr 17, 2019

I created a page that that has Auth::user() to get the information i need in that page. but it redirect to login page although the page that will generate into image is also authenticated.

Here is my code for the html that will convert to image

		$cookie = Cookie::get('category');

		if (!$cookie) {

				return redirect()->to('public/' . $category);

		}

		$user = Auth::user();
		$category = !empty($category) ? $category : $cookie;

		if (!$user) {

				return redirect()->to('/survey/' . $category);

		}

             return view('multi-preview', compact('user', 'category'));

And here is the controller for convertion

		$options = [
			  'width' => 1080,
			  'quality' => 90
			];
    		$conv = new \Anam\PhantomMagick\Converter();
    		$conv
    					->source(url('/image/'.$category))
    					->setBinary('C:\phantomjs\phantomjs')
    					->setImageOptions($options)->toJpg()->save('/images/google.png');
				$conv->serve();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant