php artisan clear-compiled
composer dump-autoload
php artisan optimize
composer dump-autoload -o
re-install composer
php artisan clear-compiled
composer dump-autoload
php artisan optimize
composer dump-autoload -o
re-install composer
To protect your Javascript code or at least make it so hard for anyone to steal your work is to obfuscate your coding .. here are some online sites that do just that ..
And these sites can minify your code
And finally, some tools to Lint your code
If you want to make a concatenate between 2 columns inside of your select in Laravel you can simply use DB::raw(‘CONCAT(…
Here is an example
User::select(
'id',
DB::raw('CONCAT(first_name," ",last_name) as full_name')
)
->orderBy('full_name')
->get();
If you want to read the content of a file in the public folder using Laravel, you can use this code
$file_name = "test.dat";
$file_url = 'public\subfolder\\'. $file_name;
$content = file_get_contents(base_path($map_url));
base_path is a helper function to generate a fully qualified path to a given file relative to the project root directory
If you want to host your website with one company and your emails in another you have to edit your domain name DNS Zone.

All you have to do is to add A host @ to point to your website host and “mail” to point to your email server and finally add MX record @ with priority 0 and Points to mail.yourdomain.com ..
For more details, check this page:
If you are trying to decrypt a file or a bunch of files using batch file in windows you will write something like this:
gpg --pinentry-mode=loopback --batch --yes --passphrase "abc%123" --decrypt-files *.pgp
and you put the above code in a .bat file and run it but you got an error like:
gpg: public key decryption failed: Bad passphrase
You are 1000% sure the passphrase is correct .. well the problem is in the passphrase itself as it contains a special character that needs to be escaped .. in the above example , the passphrase : “abc%123” must be written like this: “abc%%123” as %% is the escape of % … for a complete list of batch file escape characters , check this link
in case if you are wondering about the meaning of
–pinentry-mode=loopback
it is used to prevent the gui from pooping up and asking for the passphrase.
Another important point , to make the batch option work without problem .. you have to make sure that the encrypted file extensions is *.pgp
Normal Javascript execution:
HTML parsing paused till script is fetched and executed then resume .

HTML parsing continue while script is being fetched but pauses when script is executed.

Script fetching continues while HTML is parsing but only execute when HTML parsing is completed.

For more details, check this page: https://bitsofco.de/async-vs-defer/
Here is the steps the browser takes to render a web page after receiving the content from the server:
You can use Google chrome DevTool “Performance” to view rendering in progress with details and charts.
For more details, check this page:
https://bitsofco.de/understanding-the-critical-rendering-path/
To view the latest sql query executed in Laravel you can
DB::enableQueryLog(); print_r(DB::getQueryLog());
Note that you have to enable the query log before executing the query and view/print it after execution ..
A good practice is to enable it only in Local environment
if (App::environment('local')) {
// The environment is local
DB::enableQueryLog();
}
When doing a raw data query from user input like this:
$someVariable = Input::get("some_variable");
$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = '$someVariable'") );
we are at risk of SQL injection , to avoid that we can bin parameters to our query like this:
$someVariable = Input::get("some_variable");
$results = DB::select( DB::raw("SELECT * FROM some_table WHERE some_col = :somevariable"), array(
'somevariable' => $someVariable,
));
Another point is that if we want to do a raw that doesn’t return a value, we can do it like this
DB::statement( 'ALTER TABLE HS_Request AUTO_INCREMENT=1111' );
and that way can take parameters as well
DB::statement( 'ALTER TABLE HS_Request AUTO_INCREMENT=:incrementStart', array('incrementStart' => 1111) );