Jump to content

bashabi

New Members
  • Posts

    2
  • Joined

  • Last visited

bashabi's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. The first array is a result of database model query. The structure is a database model structure. $array1 = Array ( [0] => Array ( [name] => ID [table] => DatabaseModelTable ) [1] => Array ( [name] => GuestListID [table] => DatabaseModelTable ) [2] => Array ( [name] => Name [table] => DatabaseModelTable ) [3] => Array ( [name] => UpdatedAt [table] => DatabaseModelTable ) [4] => Array ( [name] => UpdaterPeopleID [table] => DatabaseModelTable ) [5] => Array ( [name] => ConcRV [table] => DatabaseModelTable ) ) The second array is a result of another select query. The structure of this array is like following $array2 = Array ( [0] => Array ( [ID] => 1 [NumberOfTickets] => 21 ) [1] => Array ( [ID] => 2 [NumberOfTickets] => 12 ) ) The relation between two arrays s ID . I want to merge these two array and make it one single array . The resulting array actually will add an extra column in the first array and look like the following $result = Array ( [0] => Array ( [name] => ID [table] => DatabaseModelTable ) [1] => Array ( [name] => GuestListID [table] => DatabaseModelTable ) [2] => Array ( [name] => Name [table] => DatabaseModelTable ) [3] => Array ( [name] => UpdatedAt [table] => DatabaseModelTable ) [4] => Array ( [name] => UpdaterPeopleID [table] => DatabaseModelTable ) [5] => Array ( [name] => ConcRV [table] => DatabaseModelTable ) [6] => Array ( [name] => NumOfTickets [table] => DatabaseModelTable ) ) How can I do that. Please help me with code. I am really very bad with array and loops
  2. I want my application will send a email after 10 minutes of sending another email. In my application A user completes registration with payment Application sends the user a payment confirmation email Now I want to send another email 10 minutes After payment confirmation email with welcome tips Below is the function where for user setup . public function finishUserSetup($Sub){ if($Sub == 0){ $subscription = SubscriptionPlans::where('identifier', '=', "Monthly")->first(); $expiry = date('Y-m-d', strtotime('+' . $subscription->months . ' months')); $sub_period = "monthly"; } else{ $subscription = SubscriptionPlans::where('identifier', '=', "Annually")->first(); $expiry = date('Y-m-d', strtotime('+' . $subscription->months . ' months')); $sub_period = "annually"; } $this->expiry_date = $expiry; $this->user_type = "SUB"; $this->subscription_period = $sub_period; $this->update(); $replaceArray = array( 'fullname' => $this->forename . " " . $this->surname, 'subscriptionName' => $subscription->name, ); EmailTemplate::findAndSendTemplate("paymentconfirm", $this->email, $this->forename . " " . $this->surname, $replaceArray); } In the above function the last line of code is the one which sends a payment confirmation email to the user which is EmailTemplate::findAndSendTemplate("paymentconfirm", $this->email, $this->forename . " " . $this->surname, $replaceArray); I want to execute the following line of code 10 minutes after the above one EmailTemplate::findAndSendTemplate("WelcomeTips", $this->email, $this->forename . " " . $this->surname, $replaceArray); How to do that. that is running the last line of code 10 minutes after
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.