Skip to content

Tag: php

Laravel: How to access config/Mail variables

I need to get address and name variables on my Mail.php config: ‘from’ => [‘address’ => env(‘MAIL_USERNAME’), ‘name’ => env(‘MAIL_NAME’)], I tried this: Config::get(‘mail.from.*.name’); …

PHP and adding same value to several array keys

I’m using PHP. I would like to add same value to several array keys. This works: Anyway, I’m looking for a shorter way. So, I have tried this: This did not work at all. Any ideas how the job could be done with less code? Answer the obvious and most readable variant is: another option is:

file_get_contents not working with bearer

I keep getting this error Warning: file_get_contents failed to open stream: HTTP request failed! HTTP/1.1 401 Unauthorized Code The middleware i am using with my api accepts the authorization via url parameter or header; If I use the token in the parameter, it works but not being able to send it via header on…

how can i dynamically generate different bootstrap tabs with php

I want to generate different bootstrap nav-tabs for each post and the tab list will be vary, basically based on some condition. Some post it may 3 tabs, some post it may 2 but at least 1 tab should be there. Like the following image The problem i face for each an every post 1st tab class should be .active