Category : php

I am building a module called Student in Laravel. I use the routes.php file inside the Student folder to write routes related to student module.. When I use just Route::get(‘/main’, function () { return view(‘welcome’); }); program working fine without error. But when I am using Route::get(‘/student’, ‘[email protected]’); there is an error: Target class [StudentController] ..

Read more

I’m trying to create a folder in a newly created shared drive, using Google’s PHP API Client with the following code (Note the API connection and service is all working without issue): //Create the drive $drive = new Google_Service_Drive_Drive(); $drive->setName( "Drive Name" ); $create_drive_response = $service->drives->create( uniqid(), $drive ); $drive_id = $create_drive_response->id; //Create the folder ..

Read more

I’m struggling with casting a multidimensional array. This is my input data: $data = [ ‘product_name’ => ‘T-Shirt’, ‘price’ => ‘123’, ‘available_until’ => ‘2021-01-01’, ‘colors’ => [ [‘color’ => ‘Red’], [‘color’ => ‘Blue’], [‘color’ => ‘Green’], ], ]; and I would like to cast this input data to MongoDB. MongoDB is not so important in ..

Read more

The images that are posted on a wordpress blog gets marked up as, <figure class="wp-block-image size-large"> <img src="http://localhost/ela/wp-content/uploads/2020/07/MG_5512_23.jpg" alt="" class="wp-image-541" srcset="http://localhost/ela/wp-content/uploads/2020/07/MG_5512_23.jpg 683w, http://localhost/ela/wp-content/uploads/2020/07/MG_5512_23-200×300.jpg 200w" sizes="(max-width: 683px) 100vw, 683px"> </figure> I’d like to have the images encased in the following structure; <div class="img-box"> <div class="item loaded"> <img src="http://localhost/ela/wp-content/uploads/2020/07/07_40.jpg" data-src="http://localhost/ela/wp-content/uploads/2020/07/07_40.jpg" alt="title"> </div> </div> I did find some ..

Read more