jeudi 2 décembre 2021

Laravel project homepage loads perfectly. But other pages not

I have an issue with the inner pages. The homepage of the project works well. But when I click on the menu items which are dynamically generated by product categories, it prints ^ "ja" on every page.

The same project files are also stored in a dem folder under the parent directory. Homepage and other inner pages in this demo directory work well and every page loads completely. enter image description here

The output from the parent directory is as shown.

Tried editing the file in the following directory shows some changes.

public_html/vendor/symfony/var-dumper/Dumper/HtmlDumper.php

Does anyone who faced the same situation ever, help me to solve the issue.



via Chebli Mohamed

Override laravel Mailgun Transport for support multiple domain (Laravel 5.2)

We are sending email from our application by mailgun. We are using laravel 5.2.

But we have multiple mailgun domain created to sending email.

'mailgun' => [
    'domain' => env('MAILGUN_DOMAIN'),
    'business_domain' => env('MAILGUN_DOMAIN_FOR_BUSINESS'),
    'secret' => env('MAILGUN_SECRET')
],

Now we wants to send email like this.

  1. Mail::send() this methods sending email by default domain.

  2. But when we wants to create a different facade like MailByBusiness::send() with send email by business domain.

for archiving this functionality, how to override mailgun transport class and make a facade ?



via Chebli Mohamed

mercredi 1 décembre 2021

Laravel 5.x error install "Class ExpectedQPair.php doesn't comply with psr-4 autoloading standard "

I took a project that is in laravel 5.6, and did the usual... clone, composer-update, and I got this error message.

image error enter image description here

Class Egulias\EmailValidator\Exception\ExpectedQPair located in C:/laragon/www/spa-blog/vendor/egulias/email-validator/EmailValidator\Exception\ExpectingQPair.php does not comply with psr-4 autoloading standard. Skipping.
> Illuminate\Foundation\ComposerScripts::postAutoloadDump
> @php artisan package:discover


  [ErrorException]
  Undefined index: name


Script @php artisan package:discover handling the post-autoload-dump event returned with error code 1

I created the .env and generated the key, but it didn't allow me to run composer install or update either. I did the typical clean cache and dump-autoload, but I still can't move forward with the project.

What can be happening, what do you recommend me to do to solve this error?

Thank you in advance



via Chebli Mohamed

csrf-token mismatch error in laravel on server

I'm using this code to submit data through ajax in laravel

$('#submit').submit(function (e) {
    e.preventDefault();

    let formData = new FormData(this);

    $.ajaxSetup({
        headers: {
        'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    $.ajax({
        xhr: function() {
          var xhr = new window.XMLHttpRequest();
      
          xhr.upload.addEventListener("progress", function(evt) {
            if (evt.lengthComputable) {
              var percentComplete = evt.loaded / evt.total;
              percentComplete = parseInt(percentComplete * 100);
             
      
              if (percentComplete === 100) {
               
              }
      
            }
          }, false);
      
          return xhr;
        },
        url: $(this).attr('action'),
        type: "POST",
        data:  formData,
        dataType:'JSON',
        contentType:false,
        cache: false,
        processData: false,

but getting csrf token mismatch when i upload my code on live server.

enter image description here

enter image description here

Any solution is highly appreciated Thanks



via Chebli Mohamed

Can anybody tell the if file doesn't exists it redirect to webinstaller

Can anybody tell the if file doesn't exists it redirect to webinstall. How to go the redirection to webinstaller url in laravel when i deleting the .env file is 500 error



via Chebli Mohamed

convert a sql query to php laravel query

convert a sql query to php laravel query .

DB::select("SELECT distinct q_id,theme, ownerID, p_id, q_type, screen, leadin, scenario, option_text, o_media, correct, display_method, score_method, q_media, q_media_width, q_media_height, marks_correct, marks_incorrect, display_pos, STATUS, correct_fback, feedback_right,last_edited, locked, settings FROM (papers, questions) LEFT JOIN options ON questions.q_id = options.o_id WHERE paper=$id AND papers.question=questions.q_id GROUP BY(q_id) ORDER BY screen ASC");



via Chebli Mohamed

lundi 29 novembre 2021

Is it possible to copy file directly from sign url fetch from amazon S3?

I have fetch url from AWS Bucket like this: https://{bucket_path}/iportalDocuments/99/aid.jpeg?X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIARYDJGMIUARGRF2Y3%2F20211130%2Feu-west-1%2Fs3%2Faws4_request&X-Amz-Date=20211130T065101Z&X-Amz-SignedHeaders=host&X-Amz-Expires=1200&X-Amz-Signature=f2e7ccba4e7d42238d03c311cc0fb9768fb47b52891d8cbe86def3f4f827762e

Is it possible to copy file from url using spatie library. Thank you in advance..



via Chebli Mohamed