samedi 25 mars 2023

Not counting duplicate data

I need a querybuilder query that calculates how many different people the user is messaging without counting the repetitive data.

database photo

Example:

conver_user_id = 165, conver_user_seller_id = 156
conver_user_id = 165, conver_user_seller_id = 156
conver_user_id = 165, conver_user_seller_id = 156
conver_user_id = 165, conver_user_seller_id = 158
conver_user_id = 165, conver_user_seller_id = 158

the result i want : Total count: 2

I will be glad if you help me thank you



via Chebli Mohamed

Laravel 5.5 query with groupBy('userid') works but when run from schedule

$allrecords = Records::all()->groupBy('userid');

this line in function works when run directly BUT: when run function with this line with schedule running stops in this line without raising any error. why? what to do?



via Chebli Mohamed

dimanche 12 mars 2023

White Blank Page in a Laravel Project Rather Than Showing Error [duplicate]

I'm so tired! Due to any kind of error in my laravel project running on localhost, I am getting blank white page! Running from XAMPP's htdocs, at least the routes that have no errors are coming up fine, although routes with error are showing blank white page. Running the project via "php artisan serve" command gives this type of error.

**

Warning: Unknown: failed to open stream: No such file or directory in Unknown on line 0 Fatal error: Unknown: Failed opening required 'C:\xampp\htdocs\pstu\server.php' (include_path='C:\xampp\php\PEAR') in Unknown on line 0

**

Please don't give me the solutions like here (https://stackoverflow.com/questions/27192237/laravel-5-env-local-debug-true-no-errors-shown). I have already tried everything of this link, Nothing worked for me.

Please don't give me the solutions like here text. I have already tried everything of this link, Nothing worked for me.



via Chebli Mohamed

vendredi 10 mars 2023

Uncaught ReferenceError: jQuery is not defined at dataTables.buttons.min.js:5:283

enter image description herei hosted two project in single domain. in root hosted react js and in subfolder hosted laravel. project working but cant access js css

i will try hosting two project in single domain with the help of subfolder



via Chebli Mohamed

jeudi 9 mars 2023

how to solve error in code i need upload formats to the image from jpg, jpeg

enter code hereI need to upload all the formats to the image from jpg, jpeg, so I can upload one image format, which is png, can help me thank you

I need to upload all the formats to the image from jpg, jpeg, so I can upload one image format, which is png, can help me

      <script type="text/javascript">
            var var15671147171873255749ble = [];
            @if(isset($product) && $product->hasMedia('image'))
            @forEach($product->getMedia('image') as $media)
            var15671147171873255749ble.push({
                name: "{!! $media->name !!}",
                size: "{!! $media->size !!}",
                type: "{!! $media->mime_type !!}",
                uuid: "{!! $media->getCustomProperty('uuid'); !!}",
                thumb: "{!! $media->getUrl('thumb'); !!}",
                collection_name: "{!! $media->collection_name !!}"
            });
                    @endforeach
                    @endif
            var dz_var15671147171873255749ble = $(".dropzone.image").dropzone({
                    url: "{!!url('uploads/store')!!}",
                    addRemoveLinks: true,
                    maxFiles: 5 - var15671147171873255749ble.length,
                    init: function () {
                        @if(isset($product) && $product->hasMedia('image'))
                        var15671147171873255749ble.forEach(media => {
                            dzInit(this, media, media.thumb);
                        });
                        @endif
                    },
                    accept: function (file, done) {
                        dzAccept(file, done, this.element, "{!!config('medialibrary.icons_folder')!!}");
                    },
                    sending: function (file, xhr, formData) {
                        dzSendingMultiple(this, file, formData, '{!! csrf_token() !!}');
                    },
                    complete: function (file) {
                        dzCompleteMultiple(this, file);

                        dz_var15671147171873255749ble[0].mockFile = file;
                    },
                    removedfile: function (file) {
                        //this.removeFile(file);
                        dzRemoveFileMultiple(
                            file, var15671147171873255749ble, '{!! url("products/remove-media") !!}',
                            'image', '{!! isset($product) ? $product->id : 0 !!}', '{!! url("uplaods/clear") !!}', '{!! csrf_token() !!}'
                        );
                    }
                });
            dz_var15671147171873255749ble[0].mockFile = var15671147171873255749ble;
            dropzoneFields['image'] = dz_var15671147171873255749ble;
        </script>

thank you



via Chebli Mohamed

Is there a way to override the .env.testing PHPUnit env variable for a specific test?

I am trying to override an ENV variable I set up in .env.testing, currently the implementation uses:

env('APP_ENV') which returns the value from .env.testing

However, I would like the value to be different for a specific test case. Solutions I have tried:

$_SERVER["APP_ENV"] = "local";

env('APP_ENV', 'another_value')

Any clues would be appreciated, I cannot find anything else online



via Chebli Mohamed