This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// String.includes() | |
// The includes() method returns true if a string contains a specified value, otherwise false. | |
let message = "The movie is yet to begin!"; | |
message.includes("begin"); // This will return true. | |
// String.startsWith() | |
// The startsWith() method returns true if a string begins with a specified value, otherwise false. | |
let message = "The movie is yet to begin!"; | |
message.startsWith("The"); // This will return true. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array.from() | |
// The Array.from() method returns an Array object from any object with a length property or any iterable object. | |
// Following will return ["A", "I", "L", "J", "S", "I", "6", "4", "6", "8", "5"] | |
Array.from("AILJSI64685"); | |
// Array.keys() | |
// The Array.keys() method returns an Array Iterator object with the keys of an array. | |
const fruits = ["Avocado", "Kiwi", "Apple", "Mango"]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Array destructuring | |
// Initialize an array with sample data | |
const userDetails = ['Luis James', '24', '[email protected]']; | |
// Destructure the above array - extract the array elements to variables | |
const [username, age, email] = userDetails; | |
console.log(username); // This will print: Luis James | |
console.log(age); // This will print: 24 | |
console.log(email); // This will print: [email protected] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Import the HTTP module by using the require() method. | |
// The require() method is available globally | |
const http = require('http'); | |
// Since we have imported the HTTP module, | |
// we can use methods from that module. | |
// Call the createServer() method inorder to create a server. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file contains the same code of the previous gist. | |
// with a little bit enhancement. | |
const http = require('http'); | |
const server = http.createServer((request, response) => { | |
// The feature to handle the request and send back response | |
// starts from here. | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Name of the email driver or mailer | |
MAIL_MAILER=mailgun | |
# Mailer Host | |
MAIL_HOST=smtp.mailgun.org | |
# Mailer Port | |
MAIL_PORT=587 | |
# Username |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Mail; | |
use Illuminate\Bus\Queueable; | |
use Illuminate\Contracts\Queue\ShouldQueue; | |
use Illuminate\Mail\Mailable; | |
use Illuminate\Queue\SerializesModels; | |
class HelloEmail extends Mailable |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="container" style="padding: 1rem; background: #f5f5f5;"> | |
<p>Good Morning XYZ!</p> | |
<p> | |
Welcome to Laravel. This is a demo of sending emails through | |
the Mailgun email service. | |
</p> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Http\Controllers; | |
use App\Mail\HelloEmail; | |
use Illuminate\Http\Request; | |
use Illuminate\Support\Facades\Mail; | |
class EmailController extends Controller | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
use App\Http\Controllers\Controller; | |
use Illuminate\Support\Facades\Route; | |
/* | |
|-------------------------------------------------------------------------- | |
| Web Routes | |
|-------------------------------------------------------------------------- | |
| |