Is this a correct way of defining new directory for uploading in Laravel 9

I want to make a separate writable directory for images that are going to uploaded in a Laravel 9 project, so I tried adding this into filesystems.php:

    'upload' => [
        'driver' => 'local',
        'root' => storage_path('app/upload'),
        'url' => env('APP_URL') . '/storage/app',
        'visibility' => 'public',
        'throw' => false,
    ],

And here is the link:

public_path('storage/upload') => storage_path('app/upload'),

Then ran php artisan storage:link and now the links are already exists.

But I wonder, did I define this new directory correctly?

(Because I’m in the middle of debugging something and now I need to make sure that this directory is defined properly inside filesystems.php).

So if you have any idea about this, please let me know…

Thanks.

peer’s certificate issuer is not recognized. php curl [duplicate]

I got this issue while curling.

following is my code

    `$php_curl = curl_init();
    curl_setopt_array($php_curl, [
            CURLOPT_URL => route('verify-account'),
            CURLOPT_RETURNTRANSFER => true,
            CURLOPT_ENCODING => "",
            CURLOPT_MAXREDIRS => 10,
            CURLOPT_TIMEOUT => 30000,
            CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
            CURLOPT_CUSTOMREQUEST => "POST",
            CURLOPT_POSTFIELDS => ($params),
        ]
    );
    $final_results = curl_exec($php_curl);
    $err = curl_error($php_curl);
    curl_close($php_curl);`

i dint get any response from mcurlopt_url

PQSL right print order with php

I want to have the following struct on my print: (https://i.stack.imgur.com/e16ya.png)

My problem is that i want to all Nomos to be printed together for every Perifereia.

my code is:

$sql = pg_query($conn,"SELECT   Όνομα_Περιφέρειας,
Όνομα_Νομού,
Όνομα_Δήμου,
Γεωγραφικό_Μήκος,
Γεωγραφικό_Πλάτος
FROM Δήμοι
ORDER BY Όνομα_Περιφέρειας,Όνομα_Νομού,Όνομα_Δήμου ASC
");

while ($row = pg_fetch_row($sql)) {
echo "Περιφέρεια $row[0]";
echo ("\n");
echo "  Νομός $row[1]";
echo ("\n");
echo "      Δήμος $row[2]: $row[3],$row[4]";
echo ("\n");
}

now my result is (https://i.stack.imgur.com/Avunw.png)

I want annotation that runs after method call itself according to return type in PHP

For example I have method that has boolean return type. I need a annotation or structure which it runs if method return true in PHP. Key point is I need separate the concerns, I don’t want write this logic inside the method. Is it possible in PHP. Actually I need kind of reflection structure in like Java has.

Libraries that i found, don’t provide this structure. Is there any suggestion?

How to use Table Data in Table Headers , PHP5, Mysql

i am creating a daily report grouped by the types of product, at the moment this is displayed as a list as below

Production Date Egg Type Total
22/01/2023 Free Range 22000
22/01/2023 Itensive 10000

what i am trying to achieve is to use the eggtype as the headers with the required volume underneath. showing the daily total of all egg_type at the end

M/S Free Range Intensive Day Total
Monday 5000 5000 5000 15000
Tuesday 10000 5000 12000 27000
Wednesday
Thursday
Friday

Here is the code i am currently using

<table id="datatable2" name="datese" class="table table-striped table-bordered" style="width:100%">
                        <thead>
        <tr>
    
        <td>Date</td>
        <td>Egg Type</td>
        <td>Product</td>
        <td>Total Kg</td>

        </tr> 
        </thead>
                     <?php

// Connect to database server
    mysql_connect("localhost", "cl30-bumble", "password") or die (mysql_error ());

    // Select database
    mysql_select_db("cl30-bumble") or die(mysql_error());

$post_at = $_POST["start_date"]; 
$post_at_to_date = $_POST["end_date"];

$query = "SELECT egg_type, egg_group, total_kg, production_date, SUM(total_kg) FROM order_process WHERE production_date BETWEEN '$post_at' AND '$post_at_to_date' AND product_cat = 'liquid_egg'  GROUP BY egg_type, egg_group, production_date ORDER BY FIElD(production_date,'Monday','Tuesday','Wednesday','Thursday','Friday') "; 
     
$result = mysql_query($query) or die(mysql_error());

// Print out result
while($row = mysql_fetch_array($result)){
    
 echo ' 
        <tr>
    
        <td>'.$row["production_date"].'</td>
        <td>'.$row["egg_type"].'</td>
        <td>'.$row["egg_group"].'</td>
        <td>'.$row["SUM(total_kg)"].'</td>
    
        
        
        </tr>
       
        ';
}
mysql_close();


?>
 </table>

i now this old version of php as im carrying on from last creator using php5.4 to develope this application .

Any help or guidance would be much appreciated. or if this is even possible.

Thank you

new to php mysql, so been reading through books and or course Google 🙂 cannot find how to do the above

Clickable phone number and mail in PHP [closed]

PHP Hello. I need to add clickable phone number and mail. Can You help?

  <?php if(!empty($header_email)): ?>
       <li><span>
         <i class="fa <?php echo esc_attr($header_email_icon);?>"></i></span>
           <?php echo esc_html($header_email);?></li>
                <?php endif; ?>
         <?php if(!empty($header_phone)): ?>
           <li><span><i class="fa <?php echo esc_attr($header_phone_icon);?>"></i></span>     <?php echo esc_html($header_phone);?></li>
                <?php endif; ?>

Should I add?

<a href="mail"><?php echo esc_html($header_email);?></a> 
<a href="tel"><?php echo esc_html($header_phone);?></a>

Regards

auto change last modified date every 30 minuites for specific pages

please i have three pages in my wp website (auto changeable content) their ID’s ( 34 ,16 ,56 ) and i need to
change the last modified date and time automaticly every 30 minuits to the current date and time
and send the modified pages to the sitemap. please help me to do that

need to automaticly change last modified date

Cannot use laravel relationship property in blade view

I am trying to use a property from model relationship {{$item->items->item_name}}, but it says Attempt to read property "item_name" on null.

However, when I am trying to {{dd($item->items->item_name)}} it returns a string "Old Boots.

Why does it happen? The value is definitely there but I cant echo it…

UserItems table: id | user_id | item_id

UserItem Model:

<?php

namespace AppModels;

use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateDatabaseEloquentModel;

class UserItem extends Model
{
    use HasFactory;

    public function items()
    {
        return $this->hasOne(Item::class, 'id');
    }
}

Item table structure: id | item_name

Item Model:

<?php

namespace AppModels;

use IlluminateDatabaseEloquentFactoriesHasFactory;
use IlluminateDatabaseEloquentModel;

class Item extends Model
{
    use HasFactory;
}

Controller function:

public function heroView() :View
{
    return view('hero', [
        'userItems' => UserItem::with('items')->where('user_id', Auth::id())->get()
    ]);
}

View:

        <table>
            @foreach ($userItems as $item)
            <tr>
                <td>{{$item->items->item_name}}</td>
            </tr>
            @endforeach
        </table>

In view {{dd($item)}}:

enter image description here

Please how can i retrieve join query data from mysql in flutter?

I have the following code that logs a user in if successfully authenticated and it will pass a username to the dashboard page. How can I use the transferred username to get only the details of the specific user in mysql and display it in the Dashboard screen?………………………………

`Future login() async {
    var url = 'https://xxxxxxxxxxxxxx.com/login.php';
    var response = await http.post(Uri.parse(url), body: {
      "svcNo": user.text,
      "password": pass.text,
    });
    var data = json.decode(response.body);
    if (data.toString() == "Success") {
      Fluttertoast.showToast(
        msg: 'Login Successful',
        backgroundColor: Colors.green,
        textColor: Colors.white,
        toastLength: Toast.LENGTH_SHORT,
      );
      // ignore: use_build_context_synchronously
      Navigator.push(
        context,
        MaterialPageRoute(
          builder: (context) => DashBoard(
            svcnoIPPIS: user.text,
          ),
        ),
      );
    } else {
      Fluttertoast.showToast(
        backgroundColor: Colors.red,
        textColor: Colors.white,
        msg: 'Svc No and password invalid',
        toastLength: Toast.LENGTH_SHORT,
      );
    }
  }
Future<Object> getData() async {
    var url = 'https://xxxxxxxxxxxxxxxxx.com/getData.php/';
    var response = await http.post(Uri.parse(url), body: {
      "svcNo": widget.svcnoIPPIS,
    });
    final items = json.decode(response.body).cast<Map<String, dynamic>>();
    List<Object> user = items.map<User>((json) {
      return User.fromJson(json);
    }).toList();
    return user;
    if (response.statusCode == 200) {
      return User.fromJson(jsonDecode(response.body));
    } else {
      throw Exception('Failed to load album');
    }
    }
<?php
    $db = mysqli_connect('localhost','$username','$password','$theDatabase');
    $svc_no = $_POST['svcNo'];
    $sql = "SELECT name, rank, start_date, SUM(amount) from $table u join $anotherTable c on u.svcNo_IPPIS = c.svcNo_IPPIS WHERE c.svcNo_IPPIS = '.svc_no.'";
    $result = mysqli_query($db,$sql);
    $finalResult=array();
     while($fetchData=$result->fetch_assoc()){
    $finalResult[]=$fetchData;
    }
    echo json_encode($finalResult);
    ?>`

WordPress Website is being redirected to another link

I created a website on WordPress on the domain “https://new.fulldigitalnews.com/” and then I uploaded the files and database to another domain “https://bsengworks.com/” and also I put the URL correctly in the database.

But still when I open “https://bsengworks.com/” it is redirected to the previous domain “https://new.fulldigitalnews.com/”

Help me with it.

database wp_option SS
even user URL is correct.

Tried removing the wordpress installation from Cpanel. And I re-installed it and created again but it is being redirected again.

woocommerce hook on custom order status changed

hey I was trying to make a plugin that sends WhatsApp messages on order status change so this is my code

add_action("woocommerce_order_status_changed", "order_status_wapp",10,3); 
function order_status_wapp($order_id, $old_status, $new_status){  
 if( $new_status == "processing" && carbon_get_theme_option( 'show_processing' )) {       require("incl/apicall.php");  
$message = carbon_get_theme_option( 'processing_message' );       
require("incl/message_attr.php");            
}

the code is working well when changing the status from the order table area ( actions ), but changing the status from the order details or programmatically shows no effect. is there any hook that triggers status change no matter what the way of changing is?

how to use url2png service in symfony twig files

url2png service for php I am using this function in script tag in twig file of symfony project.

   <script>
 function url2png_v6($url) 
{
   $URL2PNG_APIKEY = "PXXXX";
   $URL2PNG_SECRET = "SXXXX";

    $options['url'] = urlencode($url);
    # usage
    $options['unique'] = round(time() / 60 / 60, 0);     
    $options['fullpage'] = 'false';    
    $options['thumbnail_max_width'] = 'false';      
    $options['viewport'] = "1280x1024"; 
 
    foreach ($options as $key => $value) {
        $_parts[] = "$key=$value";
    }
    $query_string = implode("&", $_parts);
    $TOKEN = md5($query_string . $URL2PNG_SECRET);

    return "https://api.url2png.com/v6/$URL2PNG_APIKEY/$TOKEN/png/?$query_string";
}
   </script>

I am calling this function into html twig body as like

      <div class="vehicle-img mx-auto">                                            
          <img alt="eRideshare" src="{{url2png_v6(company.website_url)}}" >
      </div>

the variable company.website_url returns the exact url example:www.example.com
it returns the error that function is unknown.

enter image description here

How can I use this function in twig body