<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: سامية🌻</title>
    <description>The latest articles on DEV Community by سامية🌻 (@sissysmart1).</description>
    <link>https://dev.to/sissysmart1</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F496054%2F861bacb4-ec7a-4441-9ef5-d3b83c8b7355.jpg</url>
      <title>DEV Community: سامية🌻</title>
      <link>https://dev.to/sissysmart1</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/sissysmart1"/>
    <language>en</language>
    <item>
      <title>Introduction to Virtualization</title>
      <dc:creator>سامية🌻</dc:creator>
      <pubDate>Sun, 04 Apr 2021 11:46:56 +0000</pubDate>
      <link>https://dev.to/sissysmart1/introduction-to-virtualization-7nn</link>
      <guid>https://dev.to/sissysmart1/introduction-to-virtualization-7nn</guid>
      <description>&lt;p&gt;Virtualization allows you to separate the Operating System from the underlying hardware&lt;br&gt;
Virtualization is NOT the same as Cloud Computing.  Virtualization is a Type of Cloud Computing.&lt;br&gt;
Hypervisors are the software that Operating System "Instances" run on.&lt;br&gt;
Virtualization allows you to easily migrate servers between pieces of physical hardware&lt;br&gt;
Virtualization allows you to consolidate multiple cheap physical servers into one server&lt;br&gt;
An "Instance" is a "Virtual Computer" installed on a Hypervisor.&lt;br&gt;
1.###&lt;strong&gt;Type 1 Hypervisors&lt;/strong&gt;&lt;br&gt;
Called Bare Metal Hypervisor&lt;br&gt;
Installs directly on to hardware&lt;br&gt;
You use Management Software installed on a different computer to manage a Type 1 Hypervisor box.&lt;br&gt;
Based on XEN.&lt;br&gt;
Generally the Hypervisor is free, but you pay for the Management software&lt;br&gt;
Over Allocation allows you to allocate more total resources to the Instances of the operating systems then the physical server has.  At any one time all Instances CANNOT use more resources then the total amout that the server has.&lt;br&gt;
2.###&lt;strong&gt;Type 2 Hypervisors&lt;/strong&gt;&lt;br&gt;
Called Hosted Hypervisor&lt;br&gt;
Type 2 Hypervisors are installed onto an Operating System such as Windows 7, OSX or Linux. (VirtualBox, Virtual PC)&lt;br&gt;
Be careful allocating resources to virtual machines.  You have the ability to allocate so many resources to the virtual machines that you crash the host machine.&lt;br&gt;
Networking can start acting "weird" on the host machine when Virtual Machines are running&lt;br&gt;
Converting to Virtualization&lt;br&gt;
Vendors of Virtualization software have "conversion" software that will convert an Operating System that installed on a Physical Computer into a Virtual Machine&lt;br&gt;
Many pieces of Backup Software no backup servers directly into a Virtual Machine.&lt;br&gt;
&lt;strong&gt;Note:&lt;/strong&gt;&lt;br&gt;
Be careful of licensing!!! Per Server/ Per Socket/ Per Core&lt;br&gt;
Virtualization software is stable, and not "cutting" or "bleeding" edge technology.&lt;br&gt;
&lt;strong&gt;Resources:&lt;/strong&gt;&lt;br&gt;
*Xen&lt;br&gt;
*Citrix&lt;br&gt;
*VMWare&lt;br&gt;
*VirtualBox&lt;br&gt;
*Virtual PC&lt;/p&gt;

</description>
      <category>cloud</category>
      <category>virtualization</category>
      <category>computerscience</category>
      <category>programming</category>
    </item>
    <item>
      <title>How To Use/Create Middleware Laravel 8 Example</title>
      <dc:creator>سامية🌻</dc:creator>
      <pubDate>Fri, 04 Dec 2020 13:01:08 +0000</pubDate>
      <link>https://dev.to/sissysmart1/how-to-use-create-middleware-laravel-8-example-4jj9</link>
      <guid>https://dev.to/sissysmart1/how-to-use-create-middleware-laravel-8-example-4jj9</guid>
      <description>&lt;p&gt;Today In this tutorial, you will learn how to create middleware and how it use in laravel 8 applications.&lt;/p&gt;

&lt;p&gt;Simply laravel middleware filter all the HTTP requests in laravel based on projects. For example when the user is doing any request that time middleware check user is logged in or not and redirect accordingly. Any user is not logged in but he wants to access the dashboard or other things in projects that time middleware filter requests redirect to the user.&lt;/p&gt;

&lt;p&gt;This example of active or inactive users access laravel 8 app or not. So, add this middleware with routes to restrict logged user to access routes, if he/she is inactive by admin.&lt;br&gt;
&lt;strong&gt;Step1 :Create Middleware:&lt;/strong&gt;&lt;br&gt;
Open the terminal and execute the following command to create custom middleware in laravel 8. So let’s open your command prompt and execute below command on it to learn PHP middleware:&lt;br&gt;
&lt;strong&gt;Step 1: Create Middleware&lt;/strong&gt;&lt;br&gt;
Open the terminal and execute the following command to create custom middleware in laravel 8. So let’s open your command prompt and execute below command on it to learn PHP middleware:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;php artisan make:middleware CheckStatus&lt;/code&gt;&lt;br&gt;
After successfully create middleware, go to app/http/kernel.php and register your custom middleware here :&lt;br&gt;
   &lt;strong&gt;app/Http/Kernel.php&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php


namespace App\Http;


use Illuminate\Foundation\Http\Kernel as HttpKernel;


class Kernel extends HttpKernel
{
    ....


    /**
     * The application's route middleware.
     *
     * These middleware may be assigned to groups or used individually.
     *
     * @var array
     */
    protected $routeMiddleware = [
        ....
        'checkStatus' =&amp;gt; \App\Http\Middleware\CheckStatus::class,
    ];
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;step 2: Implement Logic In Middleware:&lt;/strong&gt;&lt;br&gt;
After successfully register your middleware in laravel project, go to app/http/middleware and implement your logic here :&lt;br&gt;
  &lt;strong&gt;app/Http/Middleware/CheckStatus.php&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

namespace App\Http\Middleware;

use Closure;

class CheckStatus
{
    /**
     * Handle an incoming request.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  \Closure  $next
     * @return mixed
     */
    public function handle($request, Closure $next)
    {
        if (auth()-&amp;gt;user()-&amp;gt;status == 'active') {
            return $next($request);
        }
        return response()-&amp;gt;json('Your account is inactive');

    }
}
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;step 3:Add Route&lt;/strong&gt;&lt;br&gt;
Simply create a laravel route and use custom middleware with routes for filter every HTTP request:&lt;br&gt;
&lt;strong&gt;&lt;strong&gt;routes/web.php&lt;/strong&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;use App\Http\Controllers\HomeController;
use App\Http\Middleware\CheckStatus;

Route::middleware([CheckStatus::class])-&amp;gt;group(function(){

Route::get('home', [HomeController::class,'home']);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 4: Add Method In Controller&lt;/strong&gt;&lt;br&gt;
 Create one method name home and add this method on &lt;strong&gt;HomeController.php&lt;/strong&gt; file, which is placed on **app/Http/Controllers/ **directory We lare learn the middleware tutorial:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;?php

 namespace App\Http\Controllers;

 use Illuminate\Http\Request;
 class HomeController extends Controller
 {
     public function home()
     {
         dd('You are active');
     }
 }
?&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
