database/seeds/Product_categoryTableSeeder.php
/**
     * Run the database seeds.
     *
     * @return void
     */
Run the database seeds.
@return void
Run the database seeds . @return void
public function run()
    {
$data = $response->getBody();
$data = json_decode($data);
if(count($data) > 0){
    for($i = 1; $i < 10; $i++){
        foreach ($data as $value) {
            DB::table('product_categories')->insert([
                'name' => $value->title . $i,
                'image' => $value->url,
                'text' => $value->text . " " . $value->text . " " . $value->text
            ]);
        }
    }
}
    }
public function run ( ) { }
Run the database seeds.
Run the database seeds .
//        $client = new Client(); //        $response = $client->request('GET', 'https://jsonplaceholder.typicode.com/photos'); //         //        $data = $response->getBody(); //        $data = json_decode($data); //         //        if(count($data) > 0){ //            for($i = 1; $i < 10; $i++){ //                foreach ($data as $value) { //                    DB::table('product_categories')->insert([ //                         //                        'name' => $value->title . $i, //                        'image' => $value->url, //                        'text' => $value->text . " " . $value->text . " " . $value->text //                    ]); //                } //            } //        }