Home Blog

Simple Experiment – The Uniting of Oil and Water

Oil and water have long been known to be incompatible. Oil and water are two persons that are constantly at odds with one another. When blended in a single container, the oil layer does not dissolve in water and tends to float to the top. However, under some conditions, oil and water can interact. This simple experiment explains the event of oil and water uniting.

Simple Experiment – ​​Its Fairly Easy to Make a Lava Lamp

0

Its proved difficult to obtain in the previous lava lamp experiment using effervescent tablets. This is because effervescent tablets are not available in every home, making them difficult to obtain. We will utilize all of the things that are constantly in the kitchen to make this lava lamp. The utilization of household components will undoubtedly be very simple.

Simple Experiment – ​​Where’s the Starch?

0

Let’s get acquainted with Starch! Starch is a lignin molecule found in most carbohydrates. Carbohydrates are a significant component of most foods. Carbohydrate-rich foods have a pleasant taste and are satisfying. Starch, which is part of the producer of a lovely sweet flavor, is one of the reasons for this excellent taste.

Simple Experiment – Artificial Magnet

0

Magnets are objects that can attract objects in their immediate vicinity. In order to affect other objects, magnets must have two poles. Magnets may attract a wide range of items made of metal, iron, steel, and other similar materials. Magnets have a variety of uses and are commonly seen in everyday life. But do you know where magnets come from? Can you just get magnets from nature or can you make them yourself? How do you make it if you can do it yourself?

Simple Experiment – ​​Natural Indicators for Acid-Base Solutions Test

0

Acids and bases have an impact on one of the body’s processes. Acid-base balance affects the body’s ability to function effectively. Acid-base balance in the blood helps several organs of the body work better, such as metabolism, digestion, and hormone production.

Simple Experiments; How to Make a Manual Compass

0

A compass is a tool that can be used to determine cardinal directions such as north, south, west, and east. A compass is often a pointing arrow that can correctly align itself with the Earth’s magnetic field. This simple experiment demonstrates how useful a manual compass can be in determining navigation or determining the direction of travel so that you don’t get lost. When on a trip, this navigation system is often utilized on numerous modes of transportation as well as by humans.

Simple Experiment – ​​Volcano Erupts

0

A volcano is an active volcano that has a stomach full of boiling lava. Indonesia is home to several volcanoes. There have been several volcanic eruptions. There are numerous volcanoes in East Java that have erupted in the past. Mount Kelud in the Kediri district was one of the volcanoes that ever erupted. Do you know what causes volcanoes to erupt? This experiment will demonstrate how volcanic eruptions take place.

In Laravel, Here’s How to Make a Dynamic Sitemap

A sitemap is an important part of blog management. Its purpose is to make crawling and indexing of our blog content more convenient for search engines. This will, of course, affect the visibility of our material or articles in search engine results. However, this does not rule out the possibility of search engines indexing a site without a sitemap. This is not the case.

Preparing to Make a Sitemap

The url (loc), the last modified date (lastmod), how often it was changed (changefreq), and priority are the most important components to include in a sitemap . The url and the last modified date are the most active of the four elements. Two elements will be made dynamic in this post, while the other two will be made static.

For example, in this discussion, an Eloquent Post Model will be created which contains post_title, post_content, slug, created_at, and updated_at. From this model, the fields that will be used in the sitemap are only slug and updated_at. An example of a migration file that is created is more or less like below.

Schema::create('posts', function (Blueprint $table) {
    $table->id();
    $table->text('post_title');
    $table->longText('post_content');
    $table->string('slug', 200)->unique()->index();
    $table->timestamps();
});

Add the storage configuration in the file config/filesystems.php in section links:

public_path('sitemap') => storage_path('app/sitemap'),

Make a Command Sitemap Generator

The sitemap made in this tutorial is in the form of an xml file that will be updated every 12 p.m. The reason is written as a file so that when the sitemap is crawled by multiple search engine bots at the same time, the server is not overburdened because direct database queries are performed.

The following command can be used to make commands in Laravel:

php artisan make:command SitemapGenerator

Open file Sitemapgenerator.php which is located in app/Console/Commands. Change the following sections:

protected $signature = 'sitemap:generate';

The code above makes a command that can be executed using CMD: php artisan sitemap:generate

protected $description = 'Command to make a sitemap';
public function handle()
{
    $posts = Post::latest()->limit(5000)->get();
    Storage::put('sitemap/post-sitemap.xml', View::make('sitemap.single-sitemap', ['data' => $posts]));
}

Making Templates for Sitemaps

Make a folder named sitemap in resources/view. In that folder add a file single-sitemap.blade.php

Add the following code to the sitemap template:

<?php echo '<?xml version="1.0" encoding="UTF-8"?>'; ?>
<urlset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9 http://www.sitemaps.org/schemas/sitemap/0.9/sitemap.xsd http://www.google.com/schemas/sitemap-image/1.1 http://www.google.com/schemas/sitemap-image/1.1/sitemap-image.xsd"
        xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
    @foreach ($data as $item)
        <url>
            <loc>{{url('/')}}/{{ $item->slug }}</loc>
            <lastmod>{{ $item->updated_at->toAtomString() }}</lastmod>
            <changefreq>weekly</changefreq>
            <priority>0.6</priority>
        </url>
    @endforeach
</urlset>

Making a Sitemap Using Command

After completing all of the preceding steps, try to make a sitemap using the command made in the second step. At the root of the Laravel project, run the following command in cmd.

php artisan sitemap:generate

If the code above runs successfully and there is no error notification, it will make a file called post-sitemap.xml in the folder storage/app/sitemap.

Next we need to make a symlink for the sitemap so that it can be accessed using a URL. The trick is simply to run the command below:

php artisan storage:link

After the symlink has been successfully made, then try to access the sitemap via a browser with the address: domain.com/sitemap/post-sitemap.xml.

Make a Sitemap Automatically

Next is to make a sitemap automatically. The trick is to register the command php artisan sitemap:generate into a cronjob to run periodically as we wish. The method is as follows:

First access SSH then run the command below:

crontab -e

Add the following line of code to the opened cronjob editor

0 0 * * * /usr/local/bin/php /path_laravel/artisan sitemap:generate >> /dev/null 2>&1

Pay attention to the code above there is a section path_laravel which must be replaced according to the laravel project path. The cronjob code above works to run the Sitemap Generator every 12 p.m. every day. So that our sitemap file will always be updated every day.

The last step is to send the sitemap url to the webmaster so that our blog content is indexed immediately.

Simple Experiments – ​​Artificial Loupe

0

A loupe, also known as a magnifying glass, is a tool used to magnify items that are small and difficult to view with the naked eye. Children will find a loupe fascinating because it allows them to distinguish between genuine objects seen with the naked eye and those seen through a loupe, which will appear larger than the real object.

Simple Experiments; Painting on Milk’s Surface

0

On a daily basis, milk is one of the most often drank beverages. Milk is high in calcium, which is essential for bone and tooth health. Milk can be used as a weight gainer in particular circumstances. Milk may also be used to make soap and facial masks. However, did you know that we can paint on milk’s surface? Do you want to learn how? Let’s get started!