Posts

Showing posts with the label web security

Laravel Validation - Unique rule with multiple column and condition.

Today I am going to share, How we can use Laravel validation rule `unique`. If you have worked with laravel and familiar with laravel validation, you must know what does 'unique' rule checks. If not let me give here a brief about this. In simple words, It is similar to a unique key constraint applied to a column in the database table. 'Unique' rule check there is no similar value exists in the given database table column, to value matching with the provided input value. The general format of the rule is: unique:table //when input name is similar to column name OR unique:table,column OR unique:Model,attribute Examples: 'email' => 'unique:users' //here users is table name OR 'email' => 'unique:c,email_address' //can give custom column name. OR 'email' => 'unique:User,email'  //here User is a model class This is a very simple usage ...

How to Block Inspect Element and Right Click on Your Website using Simple JavaScript

Assuming you are well aware of What is an SSL certificate? Why we need it? here I am going to guide you for How you can apply an SSL certificate for your website hosted on Linux or Ubuntu Server using Apache 2 server. You can either purchase a new SSL certificate or can generate it for free on  sslforfree.com  which authorized by  Letsencrypt  the first non-profit CA. After Purchasing or getting your SSL certificate you have actually 2 SSL files, Certificate and Private Key. You can upload both SSL files (certificate.crt and private.key) on the server: Create a new folder in Directory `/home/user-name/.ssh`. Create or upload files certificate (.cert) file as certificate.crt and Private key (.key) as private.key in the folder created earlier. Now edit Virtual Host configuration for the website for which you want to apply the SSL certificate. sudo nano /etc/apache2/sites-enabled/{yourwebsitedomain....