Skip to main content

Posts

'cross-env' is not recognized as an internal or external command

I came to this error when i had already websocket installed and npm run watch was running and i was trying to install  php artisan ui vue -- auth Now to solve this error stop npm run watch if it was running and write in console:  npm cache clear --force then,  npm install and, npm run dev This should work if it doesn't then run  npm cache clear --force npm install cross -env npm install npm run dev

(Laragon) Fatal error: Allowed memory size of 1610612736 bytes exhausted (tried to allocate 4096 bytes)

 Go to laragon folder open bin then php then php-7.2.19-win32-VC15-x64 and open php.ini file. and after opening php.ini file search memory_limit and you will probably get memory_limit=512M and you have to change the memory_limit from 512 to -1.  In this link  https://getcomposer.org/doc/articles/troubleshooting.md#memory-limit-errors it is mentioned that: Use - 1 for unlimited or define an explicit value like 2G Now, restart laragon and in the terminal you can install your desired composer package example:  composer require tymon/jwt-auth Thanks

npm run watch error in laravel 8

 When you try scaffolding or for any js compiling reason you would have tried npm install and npm run watch at any point of time in laravel. well, now i have seen that i am getting error while trying npm run watch to compile the mix file.  solution to that is simply run :  npm run development -- --watch It will do the same as npm run watch. it will compile all the asset files as before.

How to show the remaining days in php

{{  \Carbon\ Carbon :: parse ( $salesmantarget -> month_year )-> format ( 'F j, Y' )  }}              <?php                  $OldDate  =  strtotime ( $salesmantarget -> month_year );                $NewDate  =  date ( 'M j, Y' ,  $OldDate );                $diff  =  date_diff ( date_create ( date ( "M j, Y" )), date_create ( $NewDate ));                               if ( $diff -> format ( "%R%a days" ) >  0 )           ...

Current Server Discovery and Monitoring Engine is Deprecated

When building connection using mongoose you might get an error saying Current server discovery and monitoring engine is deprecated.  Error:  current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor. So, basically two of the options need to be passed to the mongoose.connect method.  so these are:{ useNewUrlParser: true} and {useUnifiedTopology: true} See the example below: mongoose . connect ( "mongodb://localhost:27017/fruitsDB" , {    useNewUrlParser :   true ,    useUnifiedTopology :   true , }); Here, fruitsDB is the database name. Now, if you run your file say for example app.js, you will not that error again.

MongoDB Setup Guide for Beginner

Why MongoDB? Answer:  MongoDB stores data in flexible , JSON-like documents. Think like this is json database. What makes everything easy with json database is maping of the object. when you store anything in tables,rows and columns, accessing the data can be little bit challenging, and can be costly process  for your processor. But on the other hand, in the NoSql since everything is stored in mapping of key value pair, it is easier+faster and everything becomes easy  and simple with that. Scalability is challenging in mysql database.  This kind of scaling is super easy  in mongoDB . So it's getting high in demand on scalability. changing schema is so much easy. Drawbacks with mysql and other relational database is:  1) Hard to understand 2) Adding features harder 3) Inefficiant MongoDB solved this problems. who is using mongoDB? Amazon web services, Microsoft Azure, Google Cloud Platform a...