简体   繁体   English

我可以在 laravel 中使用 phpqrcode libraby 吗? https://sourceforge.net/projects/phpqrcode/

[英]i can use phpqrcode libraby in laravel ? https://sourceforge.net/projects/phpqrcode/

i try to use phpqrcode library in laravel project this package is very popular, this is her link https://sourceforge.net/projects/phpqrcode/ i use class qrCode in controller but i got this error message: "Class "QRcode" not found" error when i use phpqrcode class in laravel framework我尝试在 laravel 项目中使用 phpqrcode 库,这个 package 非常受欢迎,这是她的链接https://sourceforge.net/projects/phpqrcode/我在 controller 中使用 class qrCode 但我收到此错误消息:"Class notQRcode在 laravel 框架中使用 phpqrcode class 时发现错误

this is my controller这是我的 controller

public function store(Request $request)
    {
       $input =  $request->all();
       // include(app_path().'/phpqrcode/qrlib.php');
        $code = $request->email ;
        $filename ='test' . md5($code) . '.png';
        QRcode::png($code, \public_path("temp/$filename"));
        $input['qr_code']= $filename;
        Participant::create($input);
        return response()->json(['status'=>'success','message'=>'participant saved succefully !' ],201);

    }

How did you proceed with the installation of the lib into your project?您是如何将 lib 安装到您的项目中的?

The lib documentation has some steps that you should follow in order to get started.Please check on the INSTALL FILE. lib 文档有一些您应该遵循的步骤才能开始。请检查安装文件。

lib 安装文件的屏幕截图

Personally, I would recommend you use a dependency installed from composer.就个人而言,我建议您使用从 composer 安装的依赖项。

Some popular ones can be found at packagist.一些流行的可以在 packagist 找到。 Try out this as it is well documented试试这个,因为它有据可查

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM