dourao1896 2018-09-02 18:12
浏览 133

在laravel中使用google API

I previously taught my self php, but now I want to migrate to a framework I have chosen Lavarel currently.

I have been able to do this directly in plain php, but I am having problem re-implementing it in the newest version of Lavarel.

I created a controller based on the google Calendar API.

The first step is authenticating, and that is where my problem exists.

I do the setup, display the google permissions, and accept the permissions. At this point Google does a callback.

If I route the callback to GoogleCalendar@callback then it calls the constructor again re-displaying the google authentication request in an infinite loop.

If I route the callback to another class it gets the tokens, but then the wrong class has the token. I have placed the token in a database, but how do I transfer execution back to the GoogleCalendar class.

return redirect()->action('GoogleCalendar@part2',['code' => $input['code']]);

This fails, even though the class and function exist I get an error message like they don't.

I was able to store the token in the user table, however, I need to pass control back to the GoogleCalendar controller with an operative $client string.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 stm32开发clion时遇到的编译问题
    • ¥15 lna设计 源简并电感型共源放大器
    • ¥15 如何用Labview在myRIO上做LCD显示?(语言-开发语言)
    • ¥15 Vue3地图和异步函数使用
    • ¥15 C++ yoloV5改写遇到的问题
    • ¥20 win11修改中文用户名路径
    • ¥15 win2012磁盘空间不足,c盘正常,d盘无法写入
    • ¥15 用土力学知识进行土坡稳定性分析与挡土墙设计
    • ¥70 PlayWright在Java上连接CDP关联本地Chrome启动失败,貌似是Windows端口转发问题
    • ¥15 帮我写一个c++工程