php Questions

2

Solved

I'm wondering if there is any good reason why this behaviour is possible in the current PHP 5.4 implementation: trait T { public function test(PDO $pdo) {} } class C { use T; public function t...
Satanism asked 17/7, 2012 at 11:21

2

Solved

Is there woocommerce function that will return me all related orders (at least the order ID) for the specific subscription that user has bough? I have found in this official documentation Subscrip...

2

Is there any way, using reflection or otherwise, to change a readonly property that has already been set? We sometimes do that in tests, and we don't want to avoid using readonly props just for tes...
Hon asked 18/3, 2022 at 17:12

3

Solved

I have two model resources and I want to be merged into a flat array without having to explicitly define all the attributes of the other resource. Model 1: id name created_at Model 2: id alter...
Emotionality asked 7/2, 2018 at 17:40

3

I'm currently using MySQL Workbench to write very complex SQL Queries. To compare between different approaches, I need to know how many records have been returned by my query very quickly. So, is ...
Entrench asked 5/9, 2016 at 7:59

4

Solved

I've tried a bunch of different functions and approaches but so far I haven't been able to get it working. The goal is to add an Advanced Custom Field group to the backend of Wordpress with some PH...
Christyna asked 7/1, 2020 at 13:4

4

Solved

I wanted to make a PHP function that would make text bold between double asterisks, and italic between one asterisk, (quite like the editor on Stack Overflow). The same rules apply, if there's a sp...
Glutinous asked 8/10, 2013 at 16:57

4

Solved

Laravel 5 provides translations using the @lang helper <!-- file: template.blade.php --> @lang('some text') Laravel 5 also has the possibility to pluralize strings depending on a variable. /...
Riegel asked 3/9, 2018 at 10:18

5

I need to create a word document from a word template, its something like, we need to replace the few strings (say variables) in the template with the values. Please tell how we can do this in PHP...
Kief asked 4/1, 2010 at 17:23

7

My whole application, made in Laravel 5.2, is working perfectly fine but when i tried to get list of routes through following command: php artisan route:list It shows me following error: [...
Reduce asked 22/3, 2016 at 8:28

5

Solved

I'm new to Laravel and looking for a good way to seed a pivot table using factories. I don't want to use plain seeders. I'll show you the case: I have three tables (users, skills, and user_skill). ...
Souvenir asked 2/10, 2016 at 16:33

8

I have a case where file_exists() is always returning false. My latest attempt was to just test to see if it would return true for $_SERVER["SCRIPT_FILENAME"] and then return the value of the path ...
Gatekeeper asked 25/11, 2009 at 19:59

5

Solved

I was using phpmyadmin (Version information: 4.0.10deb1) on php 7.0.7 & nginx 1.4.6 . When I was trying to import a csv file to one of tables, I saw the max size allowed indicated on the phpmya...
Czarism asked 28/7, 2016 at 2:59

3

Solved

I need to record virtual Page Events with the Google Tag Manager PHP API. So far I have this code: $client = new Google_Client(); $client->setApplicationName("Partner Inquiry"); $client-&gt...
Legatee asked 12/6, 2015 at 10:44

5

I'm implementing an API in Laravel using JSON:API specification. In it I have a resource, let's call it Ponds, with many-to-many relationships with another resource, let's call it Ducks. Accordi...
Weintrob asked 11/3, 2019 at 14:37

12

I just restart my laravel 8.0 project and I got this below error, please what could be wrong, this happens anytime I run "PHP artisan serve" TypeError fclose(): Argument #1 ($stream) m...
Reitareiter asked 8/2, 2021 at 21:11

1

I'm not sure what the correct way is to early return in a function when using the yield keyword. Is a "return void" return; the correct return value? Because the return type is specified to be ite...
Carillon asked 23/5, 2020 at 10:30

2

Solved

Before I updated to WC at 4.3.1 ,I had this code and it worked well add_action( 'rest_api_init', function () { register_rest_route( 'px-module-woocommerce', '/px/cart', array( 'methods' => 'P...
Rollick asked 24/7, 2020 at 15:52

4

I typed this into terminal $ curl -X POST http://localhost:3000/voice and I got this error curl: (7) Failed to connect to localhost port 3000: Connection refused I've looked everywhere for ...
Matrilineage asked 21/6, 2016 at 19:32

8

Solved

I am using Laravel's Mutator functionality and I have the following Mutator: public function setFirstNameAttribute($value) { $this->attributes['first_name'] = strtolower($value); } However I...
Cawley asked 8/5, 2017 at 7:10

3

I'm currently working in laravel and react js. I've made API end points in laravel for login registration with laravel passport. Now, I've made following route to get user details when api_token is...
Dandle asked 23/12, 2018 at 17:46

7

I’m sending a .php file POST data from a java application. The .php file is not accepting the POST data. file_get_contents(‘php://input’) is empty and $_POST is empty. I know the problem isn’t with...
Honeyhoneybee asked 3/8, 2011 at 8:29

2

Solved

I need to add a microsecond to a Datetime object in PHP. I am trying to do it adding a time interfal a fraction of a second to the Datetime but it is not working. $date = new Datetime('2018-06-05 ...
Mier asked 6/6, 2018 at 12:41

5

I am upgrading my project to Laravel 9. However, when I tried to run php artisan, I got an error message. In Auth.php line 60: To use the Auth::routes() method, please install the laravel/ui packa...
Awlwort asked 19/3, 2022 at 10:26

4

Solved

I've written a simple query for searching a keyword in the database. $keyword = "keyword sample"; $keyword = str_replace(" ", "%", $keyword); $this->db->selec...
Afrit asked 20/3, 2014 at 20:21

© 2022 - 2024 — McMap. All rights reserved.