lundi 6 juin 2022

How to Figure Out The Relationship among Webpages in An Individual Website?

Normally, when we make the test scripts either it is Robot Framework or Behat Framework. We will manually find the locator of the element we focused on each web page by using Developer Tools on the browser we use. We can make the scripts because we know the flow or the step of an individual testing scenario. Howver, I want to figure the automated way to extract the information of the relationship among web pages inside an individual website without any manual input and make a script out of it

The purpose of this question is to figure out the way to automatically detect the relationship between each page in an individual website in order to develop a test step and further develop the automated test scripts generator which the scripts can be Robot Framework or Behat Framework for automated testing on an individual website developed by using Laravel Framework which normally contains many web pages inside that are related to each other.

Do you guys have any ideas about this? Please tell me if you have any. Please leave your comments below.



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/1TOFviP
via IFTTT

laravel old env file is downloading while mywebsite/.env in shared hosting in laravel 5.6 in production mode

I am using laravel 5.6 in my shared hosting website. my project .env file is downloading while mywebsite/.env in production mode. The old env file is downloading means I was changed the env file content but downloading the old env file which is not available in my project. I have use the below code in .htacceses but still downloading <Files .env> order allow,deny Deny from all



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/0Ws9gVu
via IFTTT

dimanche 5 juin 2022

image not display in admin panel

Image not display why in laravel, what is the issue controller nd blade is added Controller code

 try{

      $file=$request->file('image');
      $filename=$file->getClientOriginalName();
      $imgname = uniqid().$filename;

      $input['image']= $imgname;
      $destinationPath=public_path('upload/image/');
      $request->file('image')->move($destinationPath, $imgname);

  
        Auth::user();
        $article =  new Article();
        $article -> user_id=Auth::user()->id;
        $article -> title=$request->get('title');
        $article -> description=$request->get('description');
        $article-> image = $filename;
        $article -> status=$request->get('status');
        $article->save();
    $request->session()->flash('alert-success','article has been sucessfully created.');
    return back()->with('success', 'Article created successfully.');   
    }
catch(ModelNotFoundException $exception){
   // do task when error
    return back()->withError($exception->getMessage())->withInput();    }

}

in blade file print this code

 <td><img src=""
                                            width="500px"></td>


from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/Orz6FoG
via IFTTT

jeudi 2 juin 2022

Laravel how to count each rows ID on tables relationship

so i have a 5 tables in my database with pivot, Countries, Cities, Shops, Users, shop_employee their relationship is this

Countries  | Cities      | Shops     | shop_employees| Users 
 id        | country_id  | city_id   |  shop_id      | id
                                        employee_id

my goal is i want to count each City, shop, employees in Country

this is my controller

class CountryController extends Controller
{
    public function country(){
       $countries = Country::with(['cities.shops.employees'])->get();
       return view('country',['countries'=>$countries]);
    }
}

this is my model Country

class Country extends Model
{
    public function cities(){
        return $this->hasMany(City::class);
    }
}

this is my model City

class City extends Model
{
    public function shops(){
        return $this->hasMany(Shop::class);
    }
}

this is my model Shops

class Shop extends Model
{
    public function employees(){
        return $this->belongsToMany(User::class,'shop_employees','shop_id','employee_id');
    }
}

this is my view

        <table class="table-fixed">
                <thead>
                  <tr>
                    <th class="py-2 px-2 border border-gray-300">Country</th>
                    <th class="py-2 px-2 border border-gray-300">City</th>
                    <th class="py-2 px-2 border border-gray-300">Shop</th>
                  </tr>
                </thead>
                <tbody>
                @foreach ($countries as $country)
                <tr >
                    <td class="py-2 px-2 border border-gray-300"></td>
                    <td class="py-2 px-2 border border-gray-300"></td>
                    <td class="py-2 px-2 border border-gray-300"></td>
                  </tr>
                @endforeach
                </tbody>
              </table>

i tried this code its working fine the City is counting


the output, in this output i want to display the count of shops and employee

enter image description here

but when im trying this code it gives me a error

  $country->cities->shops->count() or
  $country->cities->shops->employees->count() 

error: Property [shops] does not exist on this collection instance



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/mC9aetG
via IFTTT

How to save multiple array input data in Database in Laravel PHP

Hello Geeks i am stuck here. I am beginner and want to know how to save and update array data in database. this is laravel form requested data

I want to save data like this : mysql database

here is my form request, i want to save data in mysql database, with new row :

"_token" => "FoyoYvFXmNAggbQuMq6PN243QS43MkY99Nq3UAni"
"description" => array:2 [▼
 0 => "<h3>Shared Hosting Plan</h3>"
 1 => "<h3>Cloud Hosting Plan</h3>"
]
"site_id" => array:2 [▼
 0 => "5361"
 1 => "5361"
]
"category_id" => array:2 [▼
 0 => "1"
 1 => "3"
]
"field_1" => array:2 [▶]
"field_2" => array:2 [▶]
"field_3" => array:2 [▶]
"field_4" => array:2 [▶]
"field_5" => array:1 [▶]
"price" => array:2 [▶]
"update_plan" => "Save Plans"
]```




from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/HCj5uDe
via IFTTT

How to fetch mobile contacts in laravel?

I am using laravel framework to develop mobile application ,i have one blocker how to fetch contacts from device by using laravel api,can anyone give me suggestions how to achieve this one..?



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/Zwa3FRG
via IFTTT

mercredi 1 juin 2022

cant seem to change my url to tally with my lavarel app

So what I am trying in my mac hosts file is:

127.0.0.1 firstproject.test

But when I run the local server and hit firstproject.test nothing happens. I was expecting that URL to resolve to 127.0.0.1?

using php artisan serve



from Newest questions tagged laravel-5 - Stack Overflow https://ift.tt/ycl03jZ
via IFTTT