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’); …
Tag: php
Laravel. morphToMany in cascade mode
I am looking a way of doing the following: Let’s say we have a Theater application and we have three Models: Event, Session and Seat on one hand and Rate on the other hand. We have a morphToMany …
How to select columns from joined tables: laravel eloquent
I have a different problem from this. The scenario is same but I am in need of more filtration of the results. Let me explain. Consider I have 2 tables vehicles id name staff_id distance …
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:
PHP Spread Syntax in Array Declaration
PHP supports the spread syntax for variadic functions. In JavaScript, you can use the spread syntax to do this: However, trying to do this in PHP: Results in this error: Parse error: syntax error, unexpected ‘…’ (T_ELLIPSIS), expecting ‘]’ Is using the spread syntax this way not …
SyntaxError: identifier starts immediately after numeric literal, str_replace variable to javascript
so i have this variable $number = “1944/UN31/KEP/2017” then i want to replace the “/” to “” so i create new variable: i can access my $number variable to js before using (in laravel blade): but when i replaced the string and the 2nd variable : i got an error in my debuger s…
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 insert these multiple row data into mysql database
This is my html ajax and js code, it’s dynamic input field form i want to insert multiple data into mysql database following these column “pro” “des” “qty” “price” “sub_total” . “qty” and “price” used auto sum value to &…
Digest Auth Socket Server to Server
How can I realize digest authentication and subscription with sockets in a Server to Server application with PHP. What options do I have?
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