lundi 19 décembre 2022

The problem is that when selecting from select it has ware:model, the slider crashes, and when you click on search, it shows 404

When I use livewire The problem is that when selecting from select it has ware:model, the slider crashes, and when you click on search, it shows 404

As shown in the picturesenter image description here

I tried many times but I don't know why

//my view

div class="ne-sidebar sidebar-break-lg col-xl-4 col-lg-12 px-0">

            <div class="sidebar-box item-box-light-md">
              <div class="topic-border color-cinnabar mb-30">
                <div class="topic-box-lg color-cinnabar"> </div>
              </div>
              <div class="bodyimg">
                <form action="" method="post" name="dmarticlesFilter" id="dmarticlesFilter">
                    @csrf
            <div id="dmarticlesfilter_filters">
                <div class="dmarticlesfilter_filters_row">
                <select id="filterCategory634bd4c1cb9b5_0" wire:model="fcategory_id">
                            <option></option>
                            @foreach($firstcategories as $fcat)
                              <option value=""></option>
                            @endforeach
                    </select>



                    <select id="filterCategory634bd4c1cb9b5_1" wire:model="scategory_id">
                            <option></option>
                            @foreach($secondcategories as $scat)
                              <option value=""></option>
                            @endforeach
                    </select>


                        </div>

                        <div class="dmarticlesfilter_filters_values_l">
                            <input placeholder="Title" type="text" name="filterTitle" value="">

                    <span><input type="submit" class="button" id="button" value=""> </span>&nbsp;&nbsp;
                    <a > </a>
                  </div>
                    </div>

                </form>
                </a>
              </div>
            </div>


//my controller

<?php

class HomeComponent extends Component
{
    public $fcategory_id;
    public $scategory_id;
    public $tcategory_id;


    public function render()
    {


        /***************************** */
        $firstcategories = firstcategory::all();
        $secondcategories = secondcategory::where('fcategory_id',$this->fcategory_id)->get();
        $thirdcategories = thirdcategory::where('scategory_id',$this->scategory_id)->get();
        $fourthcategories = fourthcategory::where('tcategory_id',$this->tcategory_id)->get();


        return view('livewire.home-component',['fourthcategories'=>$fourthcategories,'thirdcategories'=>$thirdcategories,'secondcategories'=>$secondcategories,'firstcategories'=>$firstcategories])->layout('layouts.base');
    }
}

I think the problem is with livewire with wire:model



via Chebli Mohamed

dimanche 18 décembre 2022

Returned data from a Script shows select option behind Boostrap Modal on Laravel

I have a simple JavaScript that retrieves set of data from my database and returns the result on my blade page Bootstrap Modal, however, as I enter the keyword value to retrieve, the select option result appears behind the modal form. How can I show it in front or within the modal? I adjusted the height of the modal but still the same. enter image description here



via Chebli Mohamed

vendredi 16 décembre 2022

React + Laravel 5.6 api CORS issue [closed]

I tried all solutions that I could lay my hands and finally, this solution helped progressing 1 step. Laravel 5.6 CORS issue.

However, It is adding duplicate urls in Acess-Control-Allow-Origin' and throwing this error Access to XMLHttpRequest at 'https://test.domain.com/api/login' from origin 'https://test.domain.com' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values 'https://test.domain.com, https://test.domain.com', but only one is allowed. Any suggestion how to prevent it?



via Chebli Mohamed

jeudi 15 décembre 2022

Laravel web application is not connecting to mysql localhost but connecting to mysql command line client

I am working on a Laravel web application and trying to run the website on Mysql localhost but I can't able to do that and when I try to connect, it connects to the database present in Mysql command line client. Are they both mysql commad line client and mysql localhost are different or same.

and why the laravel application is connecting directly to mysql command line client

I have share laravel configuration file such as : 1).env 2)app.php 3)database.php

enter image description here enter image description here enter image description here

I try to connect the laravel application with xampp mysql localhost but it didn't connected.



via Chebli Mohamed

Laravel 5.8 Undefined index: app_name [closed]

Undefined index: app_name (View: C:\Users\Hp\Documents\Coding\project_konekthing\erp_rental\framework\resources\views\auth\login.blade.php)

I've only tried to clone from the git when I run it this error occur

What happened? and how to solve it?



via Chebli Mohamed

mardi 13 décembre 2022

syntax error, unexpected 'readonly' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)

enter image description here I'm trying to decode qr code form local storage but get following error syntax error, unexpected 'readonly' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)


namespace Crm\Http\Controllers;

use Illuminate\Routing\Controller;
use Illuminate\Support\Facades\Storage;
use Libern\QRCodeReader\QRCodeReader;

class ScanQrCodeController extends Controller
{

    // public function __construct(string $imagePath)
    // {
    //     $imagePath = $this->imgPath;
    // }
  
        public  function scanQrCode()
        {
            $qrCodeScan = new QRCodeReader();
            
            $data = Storage::exists('public/uploads/companies/1/1/AVL0CQ/testQR.png');
            $url  = Storage::url('public/uploads/companies/1/1/AVL0CQ/testQR.png');
            $imgPath = (string) 'storage/uploads/companies/1/1/AVL0CQ/testQR.png';
            $qrCodeData = $qrCodeScan->decode($imgPath);
             
            return [
                "qr file exists " => $data,
                "url " => $url,
                //  "qr code output"  => $qrCodeData
            ];

        }

}


via Chebli Mohamed