Skip to content

Instantly share code, notes, and snippets.

Improve Query Result - Make it faster.
******** Results ********
//All Rows
$users = DB::table('users')->get();
//Single record
$user = DB::table('users')->where('name', 'John')->first();
echo $user->name;
1. first login to your gmail account.
2. under Manage account > Sign In And Security > Sign In to google.
3. enable two step verification.
4. then you can generate app password.
5. you can use that app password in .env file.
----------------------------------------------
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
try {
$result = '';
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => 'http://54.185.108.244:5000/doAIImageProcessing?img_URL=' . $image_url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
**************** To export db from RDS ***********
mysqldump -h rds.host.name -u remote_user_name -p remote_db --set-gtid-purged=OFF > remote_db.sql
//add *****set gtid purged off**** - AWS RDS create problem if not added.
When prompted for password, provide the password
***************** To import db on RDS *******************
mysql -h rds.host.name -u remote_user_name -p remote_db < remote_db.sql
When prompted for password, provide the password
@Bhavya8181
Bhavya8181 / Git & GitHub Crash Course: Create a Repository From Scratch!
Created February 12, 2024 05:52 — forked from jack2jm/Git & GitHub Crash Course: Create a Repository From Scratch!
Learn how to create a Git repository, clone it, make changes, and submit changes to GitHub
1. install git.
2. Create repository
3. Copy Clone Url
*********** Clone Project **************
Commadn: git clone clone_url here_folder_name_ifspecify
e.g git clone https://github.com/...../test.git example_repo
********** ******* Git Status ********* ************
<!DOCTYPE html>
<html>
<head>
<script type='text/javascript'>
function init() {
var canvas = document.getElementById("canvas");
context = canvas.getContext("2d");
images = new Array();
@Bhavya8181
Bhavya8181 / New Project Setup Code
Created February 12, 2024 05:52 — forked from jack2jm/New Project Setup Code
Laravel - New Project Setup to server
Clone project
git clone https://[email protected]/username/project_name
2. run command
composer install
3. create .htaacess file and pase below code.
4. create .env file and paste below code.
================= .env file example ================================
@Bhavya8181
Bhavya8181 / Laravel Project Deployment ON Server
Created February 12, 2024 05:51 — forked from jack2jm/Laravel Project Deployment ON Server
Here is basic thing to deploy laravel project to server.
1. Clone project to /var/www/html and respective folder.
2. Put.htaccess file to that folder - Link - https://drive.google.com/file/d/1fT-rkw9ZMJp_Hr4kKOBJ1m37rpz6XA3R/view?usp=sharing
3. If still its not working - then Server - rewrite rule is not working. needs to be updated it.
4. Go to /etc/apache2/apache2.conf file.
Make it like this
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All <----------- by default its None - make it to All
Require all granted <------------ denied by default
1. Create a cors file
Run this artisan command:
php artisan make:middleware Cors
2. Now open Cors.php from *App\Http\Middleware* folder and replace handle() function with this code:
public function handle($request, Closure $next)
{
//return $next($request);
header("Access-Control-Allow-Origin: *");