Wednesday, December 23, 2020

windows activator code save as (file name : windows10.cmd) and run as administrator

 @echo off

title Activate Windows 10 ALL versions for FREE!&cls&echo ============================================================================&echo #Project: Activating Microsoft software products for FREE without software&echo ============================================================================&echo.&echo #Supported products:&echo - Windows 10 Home&echo - Windows 10 Home N&echo - Windows 10 Home Single Language&echo - Windows 10 Home Country Specific&echo - Windows 10 Professional&echo - Windows 10 Professional N&echo - Windows 10 Education&echo - Windows 10 Education N&echo - Windows 10 Enterprise&echo - Windows 10 Enterprise N&echo - Windows 10 Enterprise LTSB&echo - Windows 10 Enterprise LTSB N&echo.&echo.&echo ============================================================================&echo Activating your Windows...&cscript //nologo slmgr.vbs /ckms >nul&cscript //nologo slmgr.vbs /upk >nul&cscript //nologo slmgr.vbs /cpky >nul&set i=1&wmic os | findstr /I "enterprise" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NPPR9-FWDCX-D2C8J-H872K-2YT43 >nul&cscript //nologo slmgr.vbs /ipk DPH2V-TTNVB-4X9Q3-TJR4H-KHJW4 >nul&cscript //nologo slmgr.vbs /ipk WNMTR-4C88C-JK8YV-HQ7T2-76DF9 >nul&cscript //nologo slmgr.vbs /ipk 2F77B-TNFGY-69QQF-B8YKP-D69TJ >nul&cscript //nologo slmgr.vbs /ipk DCPHK-NFMTC-H88MJ-PFHPY-QJ4BJ >nul&cscript //nologo slmgr.vbs /ipk QFFDN-GRT3P-VKWWX-X7T3R-8B639 >nul&goto server) else wmic os | findstr /I "home" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk TX9XD-98N7V-6WMQ6-BX7FG-H8Q99 >nul&cscript //nologo slmgr.vbs /ipk 3KHY7-WNT83-DGQKR-F7HPR-844BM >nul&cscript //nologo slmgr.vbs /ipk 7HNRX-D7KGG-3K4RQ-4WPJ4-YTDFH >nul&cscript //nologo slmgr.vbs /ipk PVMJN-6DFY6-9CCP6-7BKTT-D3WVR >nul&goto server) else wmic os | findstr /I "education" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk NW6C2-QMPVW-D7KKK-3GKT6-VCFB2 >nul&cscript //nologo slmgr.vbs /ipk 2WH4N-8QGBV-H22JP-CT43Q-MDWWJ >nul&goto server) else wmic os | findstr /I "10 pro" >nul
if %errorlevel% EQU 0 (cscript //nologo slmgr.vbs /ipk W269N-WFGWX-YVC9B-4J6C9-T83GX >nul&cscript //nologo slmgr.vbs /ipk MH37W-N47XK-V7XM9-C7227-GCQG9 >nul&goto server) else (goto notsupported)
:server
if %i%==1 set KMS=kms7.MSGuides.com
if %i%==2 set KMS=kms8.MSGuides.com
if %i%==3 set KMS=kms9.MSGuides.com
if %i%==4 goto notsupported
cscript //nologo slmgr.vbs /skms %KMS%:1688 >nul&echo ============================================================================&echo.&echo.
cscript //nologo slmgr.vbs /ato | find /i "successfully" && (echo.&echo ============================================================================&echo.&echo #My official blog: MSGuides.com&echo.&echo #How it works: bit.ly/kms-server&echo.&echo #Please feel free to contact me at msguides.com@gmail.com if you have any questions or concerns.&echo.&echo #Please consider supporting this project: donate.msguides.com&echo #Your support is helping me keep my servers running everyday!&echo.&echo ============================================================================&choice /n /c YN /m "Would you like to visit my blog [Y,N]?" & if errorlevel 2 exit) || (echo The connection to my KMS server failed! Trying to connect to another one... & echo Please wait... & echo. & echo. & set /a i+=1 & goto server)
explorer "http://MSGuides.com"&goto halt
:notsupported
echo ============================================================================&echo.&echo Sorry! Your version is not supported.&echo.
:halt
pause >nul

Tuesday, December 22, 2020

vue js laravel validation Vee Validate

 

Vee Validate for Laravel backend validation

Simple vue js plugin that makes it easier to show validation errors from Laravel validation by using vee-validate.

Getting Started

In your script entry point:

import Vue from 'vue';
import VeeValidate from 'vee-validate';
import VeeValidateLaravel from 'vee-validate-laravel';
 
Vue.use(VeeValidate);
Vue.use(VeeValidateLaravel);
 

From Laravel:

 
$request->validate([
    'name' => 'required|min:3|max:255'
]);
 
 

In Vue classes:

 
<template>
    <div class="form-group" v-bind:class="{'has-error' : errors.has('name')}">
        <label for="name">Name</label>
        <input 
            type="text" 
            name="name"
            class="form-control"
            v-model="name"
            v-validate="'required'" />
        <div v-show="errors.has('name')" class="help-block">{{ errors.first('name') }}</div>
    </div>
</template>
 
<script>
    export default {
        methods: {
            doValidation() {
                const data = {
                    name: this.name
                };
            
                axios.post('/example', data).then(res => {
                }).catch(err => {
                    this.$setLaravelValidationErrorsFromResponse(err.response.data);
                });
            }
        }
    }
</script>
 


Tuesday, December 15, 2020

Mysql database Backup+Restore

 #Backup MySql Database

mysqldump -u root -p sitedb > /var/www/sitedomain/db/sitedomaindb_20.sql;

mysqldump -u root -p site_db > sitedomain_db.sql;

#Restore MySql Database
sudo mysql -u root -p site_db < /var/www/sitedo_main/dev/db/sitedo_maindb.sql

Monday, December 7, 2020

Laravel singleton vs bind

 Use bind for reusable classes or objects - the object is constructed each time it is called. If you need multiple instances of a class, use bind

Use singleton for a class or object that you need access to throughout the application - the object is only constructed once and so retains state throughout execution. If you only need a single, shared, instance of a class, use singleton

For example:

app\Support\TestClass.php

<?php

namespace App\Support;

class TestClass
{
    protected $value = 0;

    public function increase()
    {
        $this->value++;

    return $this->value;
    }
}

AppServiceProvider.php

...
public function register()
{
    $this->app->singleton(
        'test1',
        \App\Support\TestClass::class
    );

    $this->app->bind(
        'test2',
        \App\Support\TestClass::class
    );
}
...

Tinker:

>>> app('test1')->increase()
=> 1
>>> app('test1')->increase()
=> 2
>>> app('test1')->increase()
=> 3

>>> app('test2')->increase()
=> 1
>>> app('test2')->increase()
=> 1
>>> app('test2')->increase()
=> 1

Sunday, December 6, 2020

Send email to those users whos TrialExpiringSoon schedule command

<?php

namespace App\Console\Commands;

use App\Mail\TrialExpiringSoon;
use App\Team;
use Exception;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Mail;

class EmailTeamsWithExpiringTrials extends Command
{
    protected $signature = 'ohdear:email-teams-with-expiring-trials';

    protected $description = 'Email teams with expiring trials.';

    protected $mailsSent = 0;

    protected $mailFailures = 0;

    public function handle()
    {
        $this->info('Sending trial expiring soon mails...');

        Team::all()
            ->filter->onSoonExpiringTrial()
            ->each(function (Team $team) {
                $this->sendTrialEndingSoonMail($team);
            });

        $this->info("{$this->mailsSent} trial expiring mails sent!");
                
        if ($this->mailFailures > 0) {
           $this->error("Failed to send {$this->mailFailures} trial expiring mails!");
        }
    }

    protected function sendTrialEndingSoonMail(Team $team)
    {
        try {
            if ($team->wasAlreadySentTrialExpiringSoonMail()) {
                return;
            }
                        
            $this->comment("Mailing {$team->owner->email} (team {$team->name})");
            Mail::to($team->owner->email)->send(new TrialExpiringSoon($team));

            $this->mailsSent++;

            $team->rememberHasBeenSentTrialExpiringSoonMail();
        } catch (Exception $exception) {
            $this->error("exception when sending mail to team {$team->id}", $exception);
            report($exception);
            $this->mailFailures++;
        }
    }
}

 

Saturday, November 28, 2020

Laravel sslcommerze intregation code demo

 $sslcommerz = new SSLCommerz();

        $sslcommerz->setPaymentDisplayType('hosted'); // enum('hosted', 'checkout')
        $sslcommerz->setPrimaryInformation([
            'total_amount' => (float) Str::round($item->kl_charge_paid),
            'currency'     => 'USD', //$item->currency,
        ]);
        $sslcommerz->setTranId($this->generateTransaction()); // set your transaction id here
        $sslcommerz->setSuccessUrl(route('payment.success'));
        $sslcommerz->setFailUrl(route('payment.failed'));
        $sslcommerz->setCancelUrl(route('payment.cancel'));
        $sslcommerz->setCustomerInformation([
            'cus_name'     => $buyer->fullName,
            'cus_add1'     => $buyer->country_id,
            'cus_city'     => $buyer->country_id,
            'cus_postcode' => $buyer->country_id,
            'cus_country'  => $buyer->country_id,
            'cus_email'    => $buyer->email,
            'cus_phone'    => $buyer->mobile,
        ]);
        $sslcommerz->setShipmentInformation([
            // 'ship_name'       => 'Store Test',
            // 'ship_add1'       => 'Dhaka',
            // 'ship_add2'       => 'Dhaka',
            // 'ship_city'       => 'Dhaka',
            // 'ship_state'      => 'Dhaka',
            // 'ship_postcode'   => '1000',
            // 'ship_country'    => 'Bangladesh',
            'shipping_method' => 'NO',
        ]);

        $sslcommerz->setAdditionalInformation([
            'value_a' => $type,
            'value_b' => $item->item_description['reference_id'],
            'value_c' => $buyer->encrypt,
            'value_d' => $item->item_id,
        ]);

        $sslcommerz->setEmiOption(0); // enum(1, 0)
        $sslcommerz->setProductInformation([
            'product_name'     => $item->item_description['item_name'],
            'product_category' => 'Goods',
            'product_profile'  => 'physical-goods',
        ]);

        $sslcommerz->setProductAmount((float) Str::round($item->total_amount));

        $response = $sslcommerz->initPayment($sslcommerz);
                                                            //dd($response);
        return redirect()->to($response['GatewayPageURL']); // redirect to gateway page url