Posts

Be 10x 10 tools from sessions

 gamma.app  create ppt paywallhub.com sci-hub.se ui.playground.ai  for creating images with prompt  app.yoodli.ai   for job search resume practice for your speech ChatGPT codedamn.com/ai    help to find out the bug in your code Gemini formula.dog creates the formula for Excel

Send email by Outlook in php Mailer

1. Enable Less Secure Apps Access (Not Recommended - Security Risk): Warning: This approach is generally not recommended due to security concerns. It allows access from any less secure app, including potentially malicious ones. Consider alternative methods (2 or 3) if possible. Sign in to your Microsoft account and navigate to Security Settings:  https://account.microsoft.com/account/manage-my-account Under "Advanced Security," select "Turn on two-step verification" (recommended for overall account security). Then, enable "Less secure apps" access ( use with caution ). 2. Use an App Password (Recommended): Generate an app password specifically for PHPMailer in your Microsoft account security settings. This password will be used in place of your regular Outlook password for enhanced security. 3. Configure PHPMailer: PHP <?php require 'vendor/autoload.php' ; // Assuming you have Composer installed use PHPMailer \ PHPMailer \ PHPMailer ; ...

Laravel Join with two coloums

 <?php namespace App\Http\Controllers; use App\Models\User; use Illuminate\Support\Facades\DB; class UserController extends Controller {     public function getUserOrders()     {         // Using Eloquent with inner join (default)         $usersWithOrders = User::join('orders', function ($join) {             $join->on('users.id', '=', 'orders.user_id');             $join->on('users.email', '=', 'orders.email'); // Additional join condition         })->get();         // Using DB facade with a more complex join (optional)         $complexJoin = DB::table('users')             ->select('users.id', 'users.name', 'orders.id as order_id', 'orders.product_id', 'orders.created_at')             ->join('orders', function ($join) {   ...

Second Highest Salary In SQL

 SELECT MAX(salary) AS second_highest_salary FROM employees WHERE salary < (   SELECT MAX(salary)   FROM employees ); select salary AS second_highest_salary  from emp order by desc limit 1,1 SELECT salary FROM (SELECT salary, ROW_NUMBER() OVER(ORDER BY salary DESC) as rank FROM `emp` ) emp where rank = 2; SELECT salary FROM (SELECT salary, DENSE_RANK() OVER(ORDER BY salary DESC) as rank FROM `emp` ) emp where rank = 2;

Add Css And Js Files on Specific Page In laravel

  1. Using Blade Layout Sections: Laravel's Blade templating engine provides a powerful way to manage layouts and include specific content on different pages. Here's how to achieve this: a. Base Layout ( layouts/app.blade.php ): <!DOCTYPE html> <html> <head> <title>My Website</title> @yield('page-css') <link rel="stylesheet" href="{{ asset('css/app.css') }}"> </head> <body> @include('partials.header') <main>@yield('content')</main> @include('partials.footer') @yield('page-js') <script src="{{ asset('js/app.js') }}"></script> </body> </html> b. Specific Page View ( views/home.blade.php ): @extends('layouts.app') @section('content')   @endsection @section('page-css')   <link rel="stylesheet" href="{{ asset('css/home.css') }}">  @endsection @se...

Diffrence between Put and Patch

PUT: Imagine you're replacing the entire contents of a document. With PUT, you send the complete updated version of the data to the server. It's like rewriting the whole document. PATCH: This is like editing specific parts of a document. You only send the changes you want to make, leaving the rest untouched. Example: Let's say you have a user profile with information like name, email, and phone number. PUT: If you want to update the entire profile with new data for all fields (name, email, phone), you'd use PUT and send the complete new user information. PATCH: If you only want to change the user's email address, you'd use PATCH and send just the updated email information. Here's the key difference: PUT: Replaces the entire resource. PATCH: Updates specific parts of a resource. 

Print Laravel Query Or Debug Laravel Query

Method 1:-  $posts = Post::where('id',' '> ,10)->toSql(); dd($posts); Method 2:- DB::enabLeQueryLog(); // Enable query tog $posts = Post::with('comments')->where('id',' '> ,10)->get(); dd(DB::getQueryLog()); // Show results of tog Method 3:- $posts = Post::with('comments')->where('id',' '> ,10)->get(); $comments = Comments::all(); DB::listen (function($query) { print_r(value: "DB:" . $query->sql ."[".implode(separator. " , " , $query->bindings) . "]"); });