Search the Community
Showing results for tags 'laravel'.
-
Hello! I'm using Lang::trans within a php hook for EMailPreSend. I set 'credited' in each language override file: $_LANG['locale'] = "en_GB"; $_LANG['credited'] = "has been credited"; and $_LANG['locale'] = "ro_RO"; $_LANG['credited'] = ": tranzacția a fost creditată"; Then, in the hook: $merge_fields = []; $paymentMethodTitle = "Bank Transfer"; $newSubject = $paymentMethodTitle.' '.Lang::trans('credited'); $merge_fields['custom_subject'] = $newSubject; $vars = array_merge( $vars, $merge_fields ); return $vars; In the Email Template, the subject is {$custom_subject}, which shows $newSubject variable just fine. But I guess Lang::trans doesn't use the client's language. The email template (body) uses the client's language without issue, but ... how in the world do I get Lang::trans in EMailPreSend to use the client's language? I just want the client's language to be used when sending the client an email (call me silly!). Thanks for any clues!
- 1 reply
-
- email template
- hooks
-
(and 2 more)
Tagged with:
-
Hello, I'm working on an Addon Module to store a License Key for an addon. I can have it verify the get the license key from the table.. but what I'm trying to do is figure out how to put a check_license within this: class License extends Model { /** @var string $table The table in which the addon settings are stored. (mod_mylicensetable) */ protected $table = 'mod_squareLicensing'; //protected function results($results); private $vString = "16da9d4d6fc1e1ec25ce622d59d3d34e2b147bed894296693492985d85d27868"; } $Licensedata = License::where('id', '1')->first( As such, I can get my License data as expected, however, within the Addon Module itself -- to ideally get everything, the check needs to be inside the Class. I'd like to do something like function verify_license { //--get information from original license call and do our actions for invalid or active } Can someone give me guidance? I'm new working with Laravel. I know how to do a license call with the default check_sample.php and have adapted that as needed, and have built upon it.. but working with the classes are new to me. Any help and pointers would be greatly appreciated 🙂
-
Hello WHMCS Community! I come here to try to clarify a doubt. I developing a custom provisioning module and I want to use the Eloquent Model from Laravel to manipulate the database over the Query Builder which is mentioned in the documentation. Are there any restrictions on use? Regards!
-
- database
- database model
-
(and 1 more)
Tagged with:
-
I'm trying to learn the new approach from v6 that uses Laravel for queries but this seems rather more messy (at least for me than the old way which is going to be deprecated. For example I made this query: This works and it gets the users logged in domains but the problem is that all results are into the single $dom variable as ouput. I tried setting them in $row like the a standard PHP query to MySQL but it does not work. Neither arrays worked for me. The problem with this approach is that I cannot use domains separately in the code. Is there an easier way to pull domains out of a users account?
