remigis
4 days ago
134
6
Laravel

The Process class relies on proc_open, which is not available on your PHP installation.

Posted 4 days ago by remigis

The Process class relies on proc_open, which is not available on your PHP installation.

public function action($id, $action){
        if($action == "confirm"){
            return $this->confirm($id);
        }
        if($action == "ignore"){
            return $this->ignore($id);
        }
        
        return redirect()->back()->with('errors', ["This action not available"]);
    }
    
    public function confirm($id){
        $invitation = $this->getData($id);
        Mail::to($invitation->getEmail())->send(new RegistrationLink($invitation->getLink()));
        $invitation->sent = 1;
        $invitation->save();
        return redirect()->back()->with('success', ['Email with registration link sent successfully.']);
    }
    
    public function ignore($id){
        $invitation = $this->getData($id);
        Mail::to($invitation->getEmail())->send(new RegistrationLinkDeclined());
        $invitation->delete();
        return redirect()->back()->with('success', ['Registration request declined and deleted.']);
    }
    
    public function getData($id){
        try {
            $invitation = Invitation::where('id', $id)->firstOrFail();
        } catch (ModelNotFoundException $e) {
            return redirect()->back()->with('errors', ['This invitation request do not exist']);
        }
        
        if($invitation->sent != 0){
            return redirect()->back()->with('errors', ['Invitation already sent']);
        }
              
        return $invitation;
    }

When i run same code in localhost I get this: https://ibb.co/dG1gGR8

Don't know if problem is in this code. But i think there is something wrong with mailing.

Please sign in or create an account to participate in this conversation.