How to fix oauth private key does not exist problem in Laravel?

If we get error as Auth private key does not exist on the browser when we run any laravel project .

Something similar to

privet auth key not found

Then we just need to install the passport and do the changes to the places where needed.

Command to install Passport:

php artisan passport:install

Soon after the passport is install we will get the following things:

  1. Client id
  2. Client secret
client id and client secret

We need to put client id in the in env files where required.

Somewhat similar to given below:

placing client id and secret

We need to change the client id and client secret to all the places where the concern configuration are used.

Few important links for reference :

  1. Setup laravel project and understand folder structure click here.
  2. Crud operation and detailed explaination. click here.

Tagged : / / / /

How to fix vendor directory not present ?

whenever we run the artisan command to migrate the control looks for the vendor directory and some files inside it. thus if the vendor directory is not present, the command will not get execuited and we will get error.

The error which we see looks like :-

vendor directory not present

To overcome this error we need to update the composer thus we need to write

composer update 

This would download and update the composer and all the packages and files inside it.

The updated pages will look like:

The complete packages which will be downloaded and updated are listed below.

PS C:\xampp\htdocs\mhn-doctors-ms> composer update 
Loading composer repositories with package information
Warning from You are using an outdated version of Composer. Composer 2 is now available and you should upgrade. See
Updating dependencies (including require-dev)
Package operations: 96 installs, 0 updates, 0 removals
- Installing kylekatarnls/update-helper (1.2.1): Loading from cache
- Installing symfony/thanks (v1.2.10): Loading from cache
- Installing symfony/finder (v3.4.47): Loading from cache
- Installing psr/log (1.1.3): Loading from cache
- Installing symfony/debug (v3.4.47): Loading from cache
- Installing symfony/polyfill-ctype (v1.22.1): Loading from cache
- Installing vlucas/phpdotenv (v2.6.7): Loading from cache
- Installing symfony/css-selector (v5.2.4): Loading from cache
- Installing tijsverkoyen/css-to-inline-styles (2.2.3): Loading from cache
- Installing symfony/polyfill-mbstring (v1.22.1): Loading from cache
- Installing symfony/var-dumper (v3.4.47): Loading from cache
- Installing symfony/routing (v3.4.47): Loading from cache
- Installing symfony/process (v3.4.47): Loading from cache
- Installing symfony/polyfill-php72 (v1.22.1): Loading from cache
- Installing symfony/polyfill-intl-normalizer (v1.22.1): Loading from cache
- Installing symfony/polyfill-intl-idn (v1.22.1): Loading from cache
- Installing symfony/polyfill-php70 (v1.20.0)
- Installing paragonie/random_compat (v2.0.19): Loading from cache
- Installing symfony/http-foundation (v3.4.47): Loading from cache
- Installing symfony/event-dispatcher-contracts (v1.1.9): Loading from cache
- Installing psr/container (1.1.1): Loading from cache
- Installing symfony/event-dispatcher (v4.4.20): Loading from cache
- Installing symfony/polyfill-php56 (v1.20.0)
- Installing symfony/http-kernel (v3.4.47): Loading from cache
- Installing symfony/console (v3.4.47): Loading from cache
- Installing symfony/polyfill-iconv (v1.22.1): Loading from cache
- Installing doctrine/lexer (1.2.1): Loading from cache
- Installing egulias/email-validator (3.1.1): Downloading (100%)
- Installing swiftmailer/swiftmailer (v6.2.7): Loading from cache
- Installing ramsey/uuid (3.9.3): Loading from cache
- Installing psr/simple-cache (1.0.1): Loading from cache
- Installing symfony/translation-contracts (v1.1.10): Loading from cache
- Installing symfony/translation (v4.3.11): Loading from cache
- Installing nesbot/carbon (1.39.1): Loading from cache
- Installing mtdowling/cron-expression (v1.2.3): Loading from cache
- Installing monolog/monolog (1.26.0): Loading from cache
- Installing league/mime-type-detection (1.7.0): Loading from cache
- Installing league/flysystem (1.1.3): Loading from cache
- Installing erusev/parsedown (1.7.4): Loading from cache
- Installing doctrine/inflector (1.4.3): Loading from cache
- Installing laravel/framework (v5.5.50): Loading from cache
- Installing maximebf/debugbar (v1.16.5): Loading from cache
- Installing barryvdh/laravel-debugbar (v3.4.2): Loading from cache
- Installing fideloper/proxy (3.3.4): Loading from cache
- Installing psr/http-message (1.0.1): Loading from cache
- Installing zendframework/zend-diactoros (1.8.7): Loading from cache
- Installing symfony/psr-http-message-bridge (v1.2.0): Loading from cache
- Installing phpseclib/phpseclib (2.0.31): Downloading (100%)
- Installing defuse/php-encryption (v2.3.1): Downloading (100%)
- Installing lcobucci/jwt (3.4.5): Loading from cache
- Installing league/event (2.2.0): Loading from cache
- Installing league/oauth2-server (6.1.1): Loading from cache
- Installing ralouphie/getallheaders (3.0.3): Loading from cache
- Installing guzzlehttp/psr7 (1.8.1): Loading from cache
- Installing guzzlehttp/promises (1.4.1): Loading from cache
- Installing guzzlehttp/guzzle (6.5.5): Loading from cache
- Installing firebase/php-jwt (v5.2.1): Loading from cache
- Installing laravel/passport (v4.0.3): Loading from cache
- Installing jakub-onderka/php-console-color (v0.2): Loading from cache
- Installing jakub-onderka/php-console-highlighter (v0.4): Loading from cache
- Installing nikic/php-parser (v4.10.4): Loading from cache
- Installing dnoegel/php-xdg-base-dir (v0.1.1): Loading from cache
- Installing psy/psysh (v0.9.12): Loading from cache
- Installing laravel/tinker (v1.0.10): Loading from cache
- Installing filp/whoops (2.12.0): Downloading (100%)
- Installing fzaninotto/faker (v1.9.2): Loading from cache
- Installing hamcrest/hamcrest-php (v2.0.1): Loading from cache
- Installing mockery/mockery (1.3.4): Loading from cache
- Installing sebastian/version (2.0.1): Loading from cache
- Installing sebastian/resource-operations (1.0.0): Loading from cache
- Installing sebastian/recursion-context (3.0.1): Loading from cache
- Installing sebastian/object-reflector (1.1.2): Loading from cache
- Installing sebastian/object-enumerator (3.0.4): Loading from cache
- Installing sebastian/global-state (2.0.0): Loading from cache
- Installing sebastian/exporter (3.1.3): Loading from cache
- Installing sebastian/environment (3.1.0): Loading from cache
- Installing sebastian/diff (2.0.1): Loading from cache
- Installing sebastian/comparator (2.1.3): Loading from cache
- Installing doctrine/instantiator (1.4.0): Loading from cache
- Installing phpunit/php-text-template (1.2.1): Loading from cache
- Installing phpunit/phpunit-mock-objects (5.0.10): Loading from cache
- Installing phpunit/php-timer (1.0.9): Loading from cache
- Installing phpunit/php-file-iterator (1.4.5): Loading from cache
- Installing theseer/tokenizer (1.2.0): Loading from cache
- Installing sebastian/code-unit-reverse-lookup (1.0.2): Loading from cache
- Installing phpunit/php-token-stream (2.0.2): Loading from cache
- Installing phpunit/php-code-coverage (5.3.2): Loading from cache
- Installing webmozart/assert (1.10.0): Loading from cache
- Installing phpdocumentor/reflection-common (2.2.0): Loading from cache
- Installing phpdocumentor/type-resolver (1.4.0): Loading from cache
- Installing phpdocumentor/reflection-docblock (5.2.2): Loading from cache
- Installing phpspec/prophecy (v1.10.3): Loading from cache
- Installing phar-io/version (1.0.1): Loading from cache
- Installing phar-io/manifest (1.0.1): Loading from cache
- Installing myclabs/deep-copy (1.10.2): Loading from cache
- Installing phpunit/phpunit (6.5.14): Loading from cache
symfony/var-dumper suggests installing ext-intl (To show region name in time zone dump)
symfony/var-dumper suggests installing ext-symfony_debug
symfony/routing suggests installing symfony/config (For using the all-in-one router or any loader)
symfony/routing suggests installing symfony/yaml (For using the YAML loader)
symfony/routing suggests installing symfony/expression-language (For using expression matching)
symfony/routing suggests installing doctrine/annotations (For using the annotation loader)
symfony/polyfill-intl-normalizer suggests installing ext-intl (For best performance)
symfony/polyfill-intl-idn suggests installing ext-intl (For best performance)
paragonie/random_compat suggests installing ext-libsodium (Provides a modern crypto API that can be used to generate random bytes.) 
symfony/event-dispatcher-contracts suggests installing psr/event-dispatcher
symfony/event-dispatcher suggests installing symfony/dependency-injection
symfony/http-kernel suggests installing symfony/browser-kit
symfony/http-kernel suggests installing symfony/config
symfony/http-kernel suggests installing symfony/dependency-injection
symfony/console suggests installing symfony/lock
egulias/email-validator suggests installing ext-intl (PHP Internationalization Libraries are required to use the SpoofChecking validation)
swiftmailer/swiftmailer suggests installing ext-intl (Needed to support internationalized email addresses)
ramsey/uuid suggests installing ext-libsodium (Provides the PECL libsodium extension for use with the SodiumRandomGenerator)        
ramsey/uuid suggests installing ext-uuid (Provides the PECL UUID extension for use with the PeclUuidTimeGenerator and PeclUuidRandomGenerator)
ramsey/uuid suggests installing moontoast/math (Provides support for converting UUID to 128-bit integer (in string form).)
ramsey/uuid suggests installing ramsey/uuid-console (A console application for generating UUIDs with ramsey/uuid)
ramsey/uuid suggests installing ramsey/uuid-doctrine (Allows the use of Ramsey\Uuid\Uuid as Doctrine field type.)
ramsey/uuid suggests installing paragonie/random-lib (Provides RandomLib for use with the RandomLibAdapter)
symfony/translation suggests installing symfony/config
symfony/translation suggests installing symfony/yaml
monolog/monolog suggests installing graylog2/gelf-php (Allow sending log messages to a GrayLog2 server)
monolog/monolog suggests installing sentry/sentry (Allow sending log messages to a Sentry server)
monolog/monolog suggests installing doctrine/couchdb (Allow sending log messages to a CouchDB server)
monolog/monolog suggests installing ruflin/elastica (Allow sending log messages to an Elastic Search server)
monolog/monolog suggests installing php-amqplib/php-amqplib (Allow sending log messages to an AMQP server using php-amqplib)        
monolog/monolog suggests installing ext-amqp (Allow sending log messages to an AMQP server (1.0+ required))
monolog/monolog suggests installing ext-mongo (Allow sending log messages to a MongoDB server)
monolog/monolog suggests installing mongodb/mongodb (Allow sending log messages to a MongoDB server via PHP Driver)
monolog/monolog suggests installing aws/aws-sdk-php (Allow sending log messages to AWS services like DynamoDB)
monolog/monolog suggests installing rollbar/rollbar (Allow sending log messages to Rollbar)
monolog/monolog suggests installing php-console/php-console (Allow sending log messages to Google Chrome)
league/flysystem suggests installing league/flysystem-eventable-filesystem (Allows you to use EventableFilesystem)
league/flysystem suggests installing league/flysystem-rackspace (Allows you to use Rackspace Cloud Files)
league/flysystem suggests installing league/flysystem-azure (Allows you to use Windows Azure Blob storage)
league/flysystem suggests installing league/flysystem-webdav (Allows you to use WebDAV storage)
league/flysystem suggests installing league/flysystem-aws-s3-v2 (Allows you to use S3 storage with AWS SDK v2)
league/flysystem suggests installing league/flysystem-aws-s3-v3 (Allows you to use S3 storage with AWS SDK v3)
league/flysystem suggests installing spatie/flysystem-dropbox (Allows you to use Dropbox storage)
league/flysystem suggests installing srmklive/flysystem-dropbox-v2 (Allows you to use Dropbox storage for PHP 5 applications)       
league/flysystem suggests installing league/flysystem-cached-adapter (Flysystem adapter decorator for metadata caching)
league/flysystem suggests installing league/flysystem-sftp (Allows you to use SFTP server storage via phpseclib)
league/flysystem suggests installing league/flysystem-ziparchive (Allows you to use ZipArchive adapter)
laravel/framework suggests installing ext-pcntl (Required to use all features of the queue worker.)
laravel/framework suggests installing ext-posix (Required to use all features of the queue worker.)
laravel/framework suggests installing aws/aws-sdk-php (Required to use the SQS queue driver and SES mail driver (~3.0).)
laravel/framework suggests installing doctrine/dbal (Required to rename columns and drop SQLite columns (~2.5).)
laravel/framework suggests installing league/flysystem-aws-s3-v3 (Required to use the Flysystem S3 driver (~1.0).)
laravel/framework suggests installing league/flysystem-rackspace (Required to use the Flysystem Rackspace driver (~1.0).)
laravel/framework suggests installing league/flysystem-cached-adapter (Required to use Flysystem caching (~1.0).)
laravel/framework suggests installing nexmo/client (Required to use the Nexmo transport (~1.0).)
laravel/framework suggests installing pda/pheanstalk (Required to use the beanstalk queue driver (~3.0).)
laravel/framework suggests installing predis/predis (Required to use the redis cache and queue drivers (~1.0).)
laravel/framework suggests installing pusher/pusher-php-server (Required to use the Pusher broadcast driver (~3.0).)
laravel/framework suggests installing symfony/dom-crawler (Required to use most of the crawler integration testing tools (~3.3).)   
maximebf/debugbar suggests installing kriswallsmith/assetic (The best way to manage assets)
maximebf/debugbar suggests installing predis/predis (Redis storage)
symfony/psr-http-message-bridge suggests installing nyholm/psr7 (For a super lightweight PSR-7/17 implementation)
phpseclib/phpseclib suggests installing ext-libsodium (SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.)
phpseclib/phpseclib suggests installing ext-mcrypt (Install the Mcrypt extension in order to speed up a few other cryptographic operations.)
phpseclib/phpseclib suggests installing ext-gmp (Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.)
lcobucci/jwt suggests installing lcobucci/clock (*)
guzzlehttp/psr7 suggests installing laminas/laminas-httphandlerrunner (Emit PSR-7 responses)
psy/psysh suggests installing ext-pcntl (Enabling the PCNTL extension makes PsySH a lot happier :))
psy/psysh suggests installing ext-posix (If you have PCNTL, you'll want the POSIX extension as well.)
psy/psysh suggests installing ext-pdo-sqlite (The doc command requires SQLite to work.)
psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already 
support readline or libedit.)
filp/whoops suggests installing whoops/soap (Formats errors as SOAP responses)
sebastian/global-state suggests installing ext-uopz (*)
phpunit/phpunit-mock-objects suggests installing ext-soap (*)
phpunit/php-code-coverage suggests installing ext-xdebug (^2.5.5)
phpunit/phpunit suggests installing phpunit/php-invoker (^1.1)
phpunit/phpunit suggests installing ext-xdebug (*)
Package mtdowling/cron-expression is abandoned, you should avoid using it. Use dragonmantank/cron-expression instead.
Package zendframework/zend-diactoros is abandoned, you should avoid using it. Use laminas/laminas-diactoros instead.
Package jakub-onderka/php-console-color is abandoned, you should avoid using it. Use php-parallel-lint/php-console-color instead.   
Package jakub-onderka/php-console-highlighter is abandoned, you should avoid using it. Use php-parallel-lint/php-console-highlighter instead.
Package fzaninotto/faker is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/phpunit-mock-objects is abandoned, you should avoid using it. No replacement was suggested.
Package phpunit/php-token-stream is abandoned, you should avoid using it. No replacement was suggested.
Writing lock file
Generating optimized autoload files
Carbon 1 is deprecated, see how to migrate to Carbon 2.
You can run ".\vendor\bin\upgrade-carbon" to get help in updating carbon and other frameworks and libraries that depend on it.  
> @php artisan package:discover
Discovered Package: fideloper/proxy
Discovered Package: laravel/tinker
Discovered Package: nesbot/carbon
Package manifest generated successfully.
42 packages you are using are looking for funding.
Use the `composer fund` command to find out more!
Tagged : / / / /

Intorduction to JavaScript-From Validation

What is form validation?

when we got to any of popular site to register, we notice that they provide feedback when we didn’t fill the data or filled in correct format. we will get message such as:-

“This field is requied(when we leave the field blank).”

“Please enter your phone number in the format XXXXX”(When the data entered is not in correct format).

“Please enter the valid email address.”( when the email entered is not in correct format).

” Password needs to be between 8 to 20 character long and must contain one upper case letter, one symbol and a number.”( A very specific data format is required for the data).

This is called form validation.


Before submitting the data to the server, it is important to ensure that all the fieds are correctly filled. This is called client side validation. It help us to ensure that the data entered matches the requirement. If the data entered is incorrect or simply missing, the server send the data back to the client requesting to resubmit the form with correct data.

There are two types or validation:-

  1. Client side validation:- When the validation is done on the browser is called client side validation.
  2. Server side validation:- when then the validation is done on server is called server side validation.

Three main reasons of validation:

  1. We want to get the right data, in the right format.
  2. We want to protect our users data.
  3. We want to protect ourselves.

Different types of client side varification:-

There are two types of validation:-

  1. built-in form validation:– It uses the HTML5 validation features. This validation generally doesn’t require much JavaScript. Built-in form validation has better performance than JavaScript, but it is not customizable as JavaScript validation.
  2. JavaScript:- JavaScript validation is coded using JavaScript. this is completely customizable, but we need to create it or use a library.

Form validation performs 2 functions:-

  1. Basic validation:- In this validation the is checked that all the mandatary fields must be filled.
  2. Data Format Validation:- In this validation it is checked that all the filled data must be of correct form and value.

Using built-in form validation

One of the most significant features of html5 is the ability to validate user data without relying on JavaScript. This is done by using the validation attributes on form elements. Some of the attributes are written below:

  1. required: It specifies that whether a form field needs to be filled in before submitting.
  2. minlength: Specifies minimum length of the data.
  3. maxlength: Specifies the max length of the data.
  4. pattern: Specifies a regular expression that defines the entered data need to be follow.

Tagged : /