From 45d36d13bc79599e67cc8692a7b4127ee202c84f Mon Sep 17 00:00:00 2001 From: itspatkar <94187044+itspatkar@users.noreply.github.com> Date: Wed, 11 Dec 2024 22:09:07 +0530 Subject: [PATCH] Updated Structure --- blockchain.html | 276 +++++------ git.html | 1177 ++++++++++++++++++++++++----------------------- html.html | 247 +++++----- laravel.html | 684 +++++++++++++-------------- markdown.html | 198 ++++---- pacman.html | 8 +- 6 files changed, 1323 insertions(+), 1267 deletions(-) diff --git a/blockchain.html b/blockchain.html index 7f84d61..e4d9e4f 100644 --- a/blockchain.html +++ b/blockchain.html @@ -37,18 +37,18 @@

Blockchain

# Blockchain

-

A blockchain is a digitized, decentralized ledger of transactions. Blockchains record a continuously growing list of records, called blocks, which are linked and secured using cryptography.

- -
+
+

A blockchain is a digitized, decentralized ledger of transactions. Blockchains record a continuously growing list of records, called blocks, which are linked and secured using cryptography.

+
    +
  • A blockchain is a distributed database that maintains a continuously growing list of records, called blocks, secured from tampering and revision.
  • +
  • Each block contains a timestamp and a link to a previous block.
  • +
  • A blockchain is typically managed by a peer-to-peer network collectively adhering to a protocol for validating new blocks.
  • +
  • Once recorded, information cannot be altered without the alteration of all subsequent blocks.
  • +
+
• Genesis Block :

The Genesis Block, also known as Block 0, is the very first block upon which additional blocks in a blockchain are added. It is effectively the ancestor that every other block can trace its lineage back to since every block references the one preceding it. The Genesis Block is a critical element of a blockchain network because it serves as the foundation for the entire network.

-
-
+
• Blockchain Explorer :

A blockchain explorer is a platform that allows people to search and navigate a blockchain. They're not necessary for using the blockchain. However, they offer a valuable service to those who wish to inspect a blockchain in detail. You can view transactions on the blockchain, smart contract code, account balances, and more.

@@ -56,50 +56,52 @@
• Blockchain Explorer :

# Types of Blockchain

-
    -
  • -
    Public :
    -
      -
    • Anyone is allowed to join and participate in the consensus.
    • -
    • Fully decentralized, secured and immutable ledge system.
    • -
    • Transactions are anonymous but transparent to everyone.
    • -
    -
  • -
  • -
    Private :
    -
      -
    • A single organization will have authority over the network.
    • -
    • Privacy, faster output and power efficient.
    • -
    • Simplified data handling process but not open to everyone.
    • -
    -
  • -
  • -
    Federated or Consortium :
    -
      -
    • Multiple organizations influences the blockchain newtork.
    • -
    • Decentralized, extremely fast and scalable system.
    • -
    • Network regulations preserves security and privacy.
    • -
    -
  • -
  • -
    Hybrid :
    -
      -
    • Authorative access, only certain elements are private.
    • -
    • Flexible controll over what data is kept public and private.
    • -
    • Decentralized regulated and highly scalable system.
    • -
    -
  • -
+
+
    +
  • +
    Public :
    +
      +
    • Anyone is allowed to join and participate in the consensus.
    • +
    • Fully decentralized, secured and immutable ledge system.
    • +
    • Transactions are anonymous but transparent to everyone.
    • +
    +
  • +
  • +
    Private :
    +
      +
    • A single organization will have authority over the network.
    • +
    • Privacy, faster output and power efficient.
    • +
    • Simplified data handling process but not open to everyone.
    • +
    +
  • +
  • +
    Federated or Consortium :
    +
      +
    • Multiple organizations influences the blockchain newtork.
    • +
    • Decentralized, extremely fast and scalable system.
    • +
    • Network regulations preserves security and privacy.
    • +
    +
  • +
  • +
    Hybrid :
    +
      +
    • Authorative access, only certain elements are private.
    • +
    • Flexible controll over what data is kept public and private.
    • +
    • Decentralized regulated and highly scalable system.
    • +
    +
  • +
+

# Smart Contracts

-

Smart contracts are self-executing contracts with predefined rules and conditions encoded on a blockchain. They are written in programming languages such as Solidity (for Ethereum) or Vyper and operate autonomously without the need for intermediaries.

-
+
+

Smart contracts are self-executing contracts with predefined rules and conditions encoded on a blockchain. They are written in programming languages such as Solidity (for Ethereum) or Vyper and operate autonomously without the need for intermediaries.

+
• Web3.JS :

Web3.JS is a popular JavaScript library that allows you to interact with the Ethereum network (and smart contracts). If you want to build an application, you can use Web3.JS to connect to the Ethereum blockchain and make the front-end of your application.

-
-
+
• ABI Bytecode :

ABI stands for Application Binary Interface. The ABI is typically provided as a JSON (JavaScript Object Notation) file or an ABI-encoded string. Smart contracts are written in high-level languages like Solidity and compiled into bytecode, which is then deployed on the blockchain or Ethereum Virtual Machine (EVM) for execution. The ABI Array contains all functions, inputs, and outputs, as well as all variables and their types, from a smart contract. Inside, there are assembly opcodes telling the EVM during execution of a smart contract where to jump to. Those jump destinations are the first 4 bytes of the keccak hash of the function signature.

@@ -107,16 +109,15 @@
• ABI Bytecode :

# Consensus Mechanism

-

Blockchain networks rely on a consensus mechanism to achieve agreement among nodes about the validity of transactions and the order in which they are added to the blockchain. Common consensus mechanisms include Proof of Work (PoW), Proof of Stake (PoS), and Practical Byzantine Fault Tolerance (PBFT).

-
+
+

Blockchain networks rely on a consensus mechanism to achieve agreement among nodes about the validity of transactions and the order in which they are added to the blockchain. Common consensus mechanisms include Proof of Work (PoW), Proof of Stake (PoS), and Practical Byzantine Fault Tolerance (PBFT).

+
• Proof of Work (PoW) :

In a PoW-based blockchain network, miners compete to solve a complex mathematical puzzle or algorithm. The process of solving this puzzle is called mining.

-
-
+
• Proof of Stake (PoS) :

In a PoS-based blockchain network, participants are called validators. Validators are chosen to create new blocks and validate transactions based on the amount of cryptocurrency they hold and "stake" in the network.

-
-
+
PoW and PoS :

In a PoW system, miners compete to find a solution to an equation that will allow them to add a block to the blockchain. In a PoS system, validators stake their cryptocurrency on the chain they want to mine. The more they stake, the more likely they will solve the next block. When they reach a consensus on a block, they get rewarded with more of the cryptocurrency. Critics argue that PoS may lead to centralization.

@@ -124,8 +125,9 @@
PoW and PoS :

# Tokens

-

A token refers to a digital asset or a unit of value that is created, issued, and transferred within a blockchain system. Tokens can represent various types of assets, such as cryptocurrencies, utility tokens, security tokens, or even non-fungible tokens (NFTs).

-
+
+

A token refers to a digital asset or a unit of value that is created, issued, and transferred within a blockchain system. Tokens can represent various types of assets, such as cryptocurrencies, utility tokens, security tokens, or even non-fungible tokens (NFTs).

+
• Fungible Tokens :

A fungible token is a type of digital asset that is interchangeable with other tokens of the same type. Fungible tokens are identical, non-unique and indistinguishable from one another, meaning that each token holds the same value and can be exchanged on a one-to-one basis.

    @@ -134,8 +136,7 @@
    • Fungible Tokens :
  • Divisible
  • ERC-20 or ERC-777 Standard
-
-
+
• Non-Fungible Tokens (NFT) :

Non-Fungible Tokens are unique digital assets that represent ownership or proof of authenticity for a specific item or piece of content. NFTs have gained popularity in digital art, collectibles, virtual real estate, and gaming. Each NFT has a distinct value and cannot be exchanged on a one-to-one basis like cryptocurrencies. One token may be similar to another, but they have properties that ensure no two tokens can ever be the same.

    @@ -149,11 +150,11 @@
    • Non-Fungible Tokens (NFT) :

    # Ethereum

    -

    Ethereum is the blockchain platform that enables the creation and execution of smart contracts and decentralized applications (dApps).

    -
    +
    +

    Ethereum is the blockchain platform that enables the creation and execution of smart contracts and decentralized applications (dApps).

    +
    • ERC-20 :

    ERC-20 stands for Ethereum Request for Comment 20, which is a technical standard or protocol used for creating and implementing fungible tokens on the Ethereum blockchain. It defines a set of rules and standards that a token contract must follow in order to be considered an ERC-20 token. ERC-20 allows developers to create smart-contract-enabled tokens that can be used with other products and services.

    -
    ERC-20 Contents :

    ERC-20 is a list of functions and events that must be implemented into a token for it to be considered ERC-20 compliant. These functions (called methods in the ERC) describe what must be included in the smart-contract-enabled token, while events describe an action.

    The functions a token must have are -
    @@ -178,14 +179,15 @@
    ETH vs ERC-20 :

    # Truffle

    -

    Truffle is a development framework for Ethereum; It is used to streamline the process of building, testing, and deploying smart contracts on the Ethereum network. Truffle provides a suite of tools and libraries that aid in the development and management of Ethereum-based decentralized applications (dApps).

    -
      -
    • Truffle downloads a solidity compiler in the background (the version is defined in truffle-config).
    • -
    • Then it looks in the contracts folder for all solidity files and runs them through the solidity compiler.
    • -
    • From the compiled contracts it creates json-artifacts, which contain not only the ABI, but also the bytecode and the AST and much more.
    • -
    • When we deploy the code using truffle migrations, it will also contain the contract address on a specific network.
    • -
    -
    +
    +

    Truffle is a development framework for Ethereum; It is used to streamline the process of building, testing, and deploying smart contracts on the Ethereum network. Truffle provides a suite of tools and libraries that aid in the development and management of Ethereum-based decentralized applications (dApps).

    +
      +
    • Truffle downloads a solidity compiler in the background (the version is defined in truffle-config).
    • +
    • Then it looks in the contracts folder for all solidity files and runs them through the solidity compiler.
    • +
    • From the compiled contracts it creates json-artifacts, which contain not only the ABI, but also the bytecode and the AST and much more.
    • +
    • When we deploy the code using truffle migrations, it will also contain the contract address on a specific network.
    • +
    +
    Truffle Folder Structure :
    • Contracts : This directory contains the Solidity smart contracts for your project. It usually has a separate file for each contract, along with any libraries or interfaces.
    • @@ -195,8 +197,7 @@
      Truffle Folder Structure :
    • Build : The build folder is automatically generated by Truffle and contains the compiled contracts and build artifacts. It includes the ABI (Application Binary Interface) JSON files, bytecode, and other necessary information for interacting with your contracts.
    • App (Optional) : If you are building a decentralized application (DApp), you may have an "app" or "client" folder that contains the frontend code (HTML, CSS, JavaScript, etc.) for your DApp. This folder is not specific to Truffle but is commonly included in Truffle projects for convenience.
    -
    -
    +
    Truffle Commands :
    • truffle init : Initializes a new Truffle project by creating the necessary directory structure and configuration files.
    • @@ -209,12 +210,9 @@
      Truffle Commands :
    • truffle create : Creates new contract, migration, test, or other files/templates within the Truffle project's directory structure.
    • truffle build : Compiles and generates an optimized build of your DApp for production deployment. It typically creates a bundled version of your frontend code and deploys it to an appropriate location.
    -
    -
    +
    • Ganache :

    Truffle Ganache is a local blockchain development tool that provides a personal Ethereum blockchain for development and testing purposes. It is part of the Truffle suite. Ganache allows developers to create a local Ethereum network with predefined accounts and pre-funded Ether. This allows you to simulate a blockchain environment on your local machine without the need to connect to a public or test network.

    -
    -
    Deploy smart contracts on ganache (cli) -
    • Start ganache: ganache
    • @@ -225,69 +223,71 @@
      Deploy smart contracts on ganache (cli) -

      # Hardhat

      -

      Hardhat is a development environment for Ethereum smart contracts. It is a popular alternative to Truffle and provides a comprehensive toolset for compiling, testing, and deploying smart contracts.

      -
        -
      • -
        Set Up Project :
        -
          -
        • Create a new directory for project.
        • -
        • Run npm init to initialize a new Node.js project (if haven't already).
        • -
        • Install Hardhat by running: npm install --save-dev hardhat.
        • -
        -
      • -
      • -
        Configure Hardhat :
        -
          -
        • Create a hardhat.config.js file in the root of project directory.
        • -
        • In the configuration file, we can specify the network settings, compiler version, plugins, and other options.
        • -
        -
      • -
      • -
        Write Smart Contracts :
        -
          -
        • Create a contracts directory in project and write Solidity smart contracts in separate .sol files.
        • -
        • We can import other contracts, libraries, or interfaces as needed.
        • -
        -
      • -
      • -
        Write Tests :
        -
          -
        • Create a test directory in project.
        • -
        • Write automated tests for contracts using the testing framework (e.g., Mocha or Hardhat's built-in testing framework).
        • -
        -
      • -
      • -
        Compile Contracts :
        -
          -
        • Run npx hardhat compile to compile Solidity contracts.
        • -
        • The compiled contracts and build artifacts will be generated in a build directory.
        • -
        -
      • -
      • -
        Run Tests :
        -
          -
        • Execute test scripts to ensure that contracts behave as expected.
        • -
        • Run npx hardhat test to run the tests located in the test directory.
        • -
        • Hardhat will automatically deploy the contracts to its built-in local network for testing.
        • -
        -
      • -
      • -
        Deploy Contracts :
        -
          -
        • Define deployment scripts in the scripts directory or create a new script specifically for deploying contracts.
        • -
        • Use the Hardhat API to deploy contracts to a specific network or the local development network.
        • -
        • Run the deployment script using: npx hardhat run <script-name>.
        • -
        • Deploy on hardhat development node with: npx hardhat node (starts local ethereum node i.e. hardhat Network).
        • -
        • Run scripts: npx hardhat run --network localhost scripts/deploy.js
        • -
        -
      • -
      • -
        Interact With Contracts :
        -
          -
        • Use the Hardhat console or write JavaScript/TypeScript scripts to interact with deployed contracts.
        • -
        -
      • -
      +
      +

      Hardhat is a development environment for Ethereum smart contracts. It is a popular alternative to Truffle and provides a comprehensive toolset for compiling, testing, and deploying smart contracts.

      +
        +
      • +
        Set Up Project :
        +
          +
        • Create a new directory for project.
        • +
        • Run npm init to initialize a new Node.js project (if haven't already).
        • +
        • Install Hardhat by running: npm install --save-dev hardhat.
        • +
        +
      • +
      • +
        Configure Hardhat :
        +
          +
        • Create a hardhat.config.js file in the root of project directory.
        • +
        • In the configuration file, we can specify the network settings, compiler version, plugins, and other options.
        • +
        +
      • +
      • +
        Write Smart Contracts :
        +
          +
        • Create a contracts directory in project and write Solidity smart contracts in separate .sol files.
        • +
        • We can import other contracts, libraries, or interfaces as needed.
        • +
        +
      • +
      • +
        Write Tests :
        +
          +
        • Create a test directory in project.
        • +
        • Write automated tests for contracts using the testing framework (e.g., Mocha or Hardhat's built-in testing framework).
        • +
        +
      • +
      • +
        Compile Contracts :
        +
          +
        • Run npx hardhat compile to compile Solidity contracts.
        • +
        • The compiled contracts and build artifacts will be generated in a build directory.
        • +
        +
      • +
      • +
        Run Tests :
        +
          +
        • Execute test scripts to ensure that contracts behave as expected.
        • +
        • Run npx hardhat test to run the tests located in the test directory.
        • +
        • Hardhat will automatically deploy the contracts to its built-in local network for testing.
        • +
        +
      • +
      • +
        Deploy Contracts :
        +
          +
        • Define deployment scripts in the scripts directory or create a new script specifically for deploying contracts.
        • +
        • Use the Hardhat API to deploy contracts to a specific network or the local development network.
        • +
        • Run the deployment script using: npx hardhat run <script-name>.
        • +
        • Deploy on hardhat development node with: npx hardhat node (starts local ethereum node i.e. hardhat Network).
        • +
        • Run scripts: npx hardhat run --network localhost scripts/deploy.js
        • +
        +
      • +
      • +
        Interact With Contracts :
        +
          +
        • Use the Hardhat console or write JavaScript/TypeScript scripts to interact with deployed contracts.
        • +
        +
      • +
      +
      diff --git a/git.html b/git.html index 6e4584d..873ffce 100644 --- a/git.html +++ b/git.html @@ -44,51 +44,54 @@

      GIT

      # Initial Setup

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      CommandInfo
      git --versionshow installed git version
      git --help [command]help for specified command
      git config --global user.name "<username>"set git username
      git config --global user.email "<email>"set git email
      git config --global --listlist saved global configs
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      CommandInfo
      git --versionshow installed git version
      git --help [command]help for specified command
      git config --global user.name "<username>"set git username
      git config --global user.email "<email>"set git email
      git config --global --listlist saved global configs
      +
      +

      Note : All global settings are saved in a file .gitconfig in your home directory.

      -

      Note : All global settings are saved in a file .gitconfig in your home directory.

      # Git Ignore File

      -
        -
      • It is a special config file. Any files added to it will be excluded from the git repo.
      • -
      • This file should be in the root folder of the repository.
      • -
      • File name: .gitignore
      • -
      • Collection of useful .gitignore templates
      • -
      -
      Ex :
      -
      # setup.txt will be excluded
      +                
      +
        +
      • It is a special config file. Any files added to it will be excluded from the git repo.
      • +
      • This file should be in the root folder of the repository.
      • +
      • File name: .gitignore
      • +
      • Collection of useful .gitignore templates
      • +
      +
      Ex :
      +
      # setup.txt will be excluded
       setup.txt
       
       # All files with extension.sh will be excluded
      @@ -96,172 +99,177 @@ 
      Ex :
      # folder bin will be excluded bin/
      +

      # Setting Repo

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - -
      CommandInfo
      git initinitialize current directory as git repo
      git init [repo]create local repo
      git clone https://github.com/[username]/[repo]clone remote repo over https
      git clone ssh://git@github.com/[username]/[repo].gitclone remote repo over SSH
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + +
      CommandInfo
      git initinitialize current directory as git repo
      git init [repo]create local repo
      git clone https://github.com/[username]/[repo]clone remote repo over https
      git clone ssh://git@github.com/[username]/[repo].gitclone remote repo over SSH
      +

      # View and Inspect Changes

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      CommandInfo
      git statusshow untracked files
      git diffshow difference between commits and working tree (unstaged changes)
      git diff [source-branch] [target-branch]show diff between branches
      git diff [commit] [commit]show diff between two commits
      git diff HEADshow all stage + unstage changes
      git logshow commits log
      git log -nshow last n commits log
      git log --summaryshow commits history in detailed
      git log [commit]show info of commit
      git log [branch] [commit]show commit log of specified branch
      git log --onelineshow each commit in single line only
      git log --graph --decorateshow commit history in formatted way
      git log -gshow reflog entries from most recent one to older ones
      git showshow recent commited changes
      git show [commit|file]show changes for commit or file
      git blame [file]show last modified revisions & authors for file
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      CommandInfo
      git statusshow untracked files
      git diffshow difference between commits and working tree (unstaged changes)
      git diff [source-branch] [target-branch]show diff between branches
      git diff [commit] [commit]show diff between two commits
      git diff HEADshow all stage + unstage changes
      git logshow commits log
      git log -nshow last n commits log
      git log --summaryshow commits history in detailed
      git log [commit]show info of commit
      git log [branch] [commit]show commit log of specified branch
      git log --onelineshow each commit in single line only
      git log --graph --decorateshow commit history in formatted way
      git log -gshow reflog entries from most recent one to older ones
      git showshow recent commited changes
      git show [commit|file]show changes for commit or file
      git blame [file]show last modified revisions & authors for file
      +
      +

      Note : HEAD is a pointer which points at the current working tree and working branch.

      -

      Note : HEAD is a pointer which points at the current working tree and working branch.

      # Staging and Unstaging

      -
      - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
      CommandInfo
      git add [file]add file to stage area or index
      git add .add all changes to stage area or index
      git add -Aadd all changes to stage area or index
      git restore [file]discard changes in working directory
      git restore --staged [file]unstage file
      git rm -r [file]remove file or folder from working tree and index
      git checkout .delete all unstage changes or restore working tree
      git checkout -- [file]discard changes to file
      git checkout [commit]move/switch HEAD to specified commit, in detached HEAD state
      -
      -
      +
      +
      + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
      CommandInfo
      git add [file]add file to stage area or index
      git add .add all changes to stage area or index
      git add -Aadd all changes to stage area or index
      git restore [file]discard changes in working directory
      git restore --staged [file]unstage file
      git rm -r [file]remove file or folder from working tree and index
      git checkout .delete all unstage changes or restore working tree
      git checkout -- [file]discard changes to file
      git checkout [commit]move/switch HEAD to specified commit, in detached HEAD state
      +
      Note :
      • Working tree = unstaged = untracked
      • @@ -272,371 +280,383 @@

        # Staging and Unstaging

        # Commit and Rebase

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git commitcommit staged changes
        git commit -m "Commit Message"commit staged changes with commit message
        git commit -a -m "Commit Message"stage and commit changes (git add+commit)
        git revert [commit]revert commit by producing new commit
        git commit --amendamend/change last commit
        git commit --amend --no-editamend last commit without changing commit message
        git commit --amend -m "Commit Message"amend last commit with changing message
        git rebasemerge branch without creating additional merge commit
        git rebase -i HEAD~nsquash commits ie combine series of commits and condense it to few commits interactively
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git commitcommit staged changes
        git commit -m "Commit Message"commit staged changes with commit message
        git commit -a -m "Commit Message"stage and commit changes (git add+commit)
        git revert [commit]revert commit by producing new commit
        git commit --amendamend/change last commit
        git commit --amend --no-editamend last commit without changing commit message
        git commit --amend -m "Commit Message"amend last commit with changing message
        git rebasemerge branch without creating additional merge commit
        git rebase -i HEAD~nsquash commits ie combine series of commits and condense it to few commits interactively
        +
        +

        Note : Never rebase on a public branch. Other teams may face conflicts as rebasing changes checksums.

        -

        Note : Never rebase on a public branch. Other teams may face conflicts as rebasing changes checksums.

        # Reset

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git resetreset current HEAD to specified state (reset index)
        git reset HEAD~nreset HEAD to last n-th commit
        git reset --soft [commit]doesn't touch index file or working tree but resets head to commit
        git reset --mixed [commit]resets index but not working tree ie changed files are preserved but not marked for commit (default action)
        git reset --hard [commit]resets index and working tree, Any changes to tracked files in working tree since commit are discarded
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git resetreset current HEAD to specified state (reset index)
        git reset HEAD~nreset HEAD to last n-th commit
        git reset --soft [commit]doesn't touch index file or working tree but resets head to commit
        git reset --mixed [commit]resets index but not working tree ie changed files are preserved but not marked for commit (default action)
        git reset --hard [commit]resets index and working tree, Any changes to tracked files in working tree since commit are discarded
        +
        +

        + Note : checkout vs reset
        + Git reset is specifically about updating the index and moving the HEAD.
        + Git checkout is about updating the working tree to the index or the specified tree.
        + It will update the HEAD only if you checkout a branch. If not, then you end up with a detached HEAD. +

        -

        - Note : checkout vs reset
        - Git reset is specifically about updating the index and moving the HEAD.
        - Git checkout is about updating the working tree to the index or the specified tree.
        - It will update the HEAD only if you checkout a branch. If not, then you end up with a detached HEAD. -

        # Push

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git pushpush commited changes to remote (default or remembered branch)
        git push [remote] [branch]push commited changes to remote branch
        git push -u origin [branch]push commited changes to remote branch & remember branch
        git push origin --delete [branch]delete remote branch
        git push -fforce push changes, required when command refuses to update remote ref that is not ancestor of local ref (usally happen with rebase)
        git push --force-with-lease - when rebased on already pushed changes, force pushing will lose pushed commit history by others. Force with lease gives flexibility to override new commits on your remote branch, while protecting old - commit history -
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git pushpush commited changes to remote (default or remembered branch)
        git push [remote] [branch]push commited changes to remote branch
        git push -u origin [branch]push commited changes to remote branch & remember branch
        git push origin --delete [branch]delete remote branch
        git push -fforce push changes, required when command refuses to update remote ref that is not ancestor of local ref (usally happen with rebase)
        git push --force-with-lease + when rebased on already pushed changes, force pushing will lose pushed commit history by others. Force with lease gives flexibility to override new commits on your remote branch, while protecting old + commit history +
        +
        +

        Note : Use the force-with-lease option instead of f with push.

        -

        Note : Use the force-with-lease option instead of f with push.

        # Fetch Merge and Pull

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git fetch [remote]download objects and refs (branches, tags) from remote (doesn't merge)
        git fetch [short-name]fetch objects and refs from remote
        git fetch --allfetch all remotes
        git merge [branch]merge fetched histories/changes to active branch
        git merge [source-branch] [target-branch]merge fetched changes into target-branch from source-branch
        git pullfetch and merge changes from origin (git fetch+marge)
        git pull [remote] [branch]pull changes from specified remote branch
        git pull --rebasefetch latest changes from origin & rebase
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git fetch [remote]download objects and refs (branches, tags) from remote (doesn't merge)
        git fetch [short-name]fetch objects and refs from remote
        git fetch --allfetch all remotes
        git merge [branch]merge fetched histories/changes to active branch
        git merge [source-branch] [target-branch]merge fetched changes into target-branch from source-branch
        git pullfetch and merge changes from origin (git fetch+marge)
        git pull [remote] [branch]pull changes from specified remote branch
        git pull --rebasefetch latest changes from origin & rebase
        +

        # Branch

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git branchlist branch (* is current working branch)
        git branch -alist all branches (local + remote)
        git branch -rlist all remote branches
        git branch [branch]create new branch
        git branch -d [branch]delete branch
        git branch -u [branch]set upstream branch
        git push origin --delete [branch]delete remote branch
        git switch [branch]switch branch
        git switch -c [branch]create & switch to new branch
        git checkout [branch]switch branch
        git checkout -switch to branch last checked out
        git checkout -b [branch]create & switch to new branch
        git checkout -b [branch] [branch]/Originclone remote branch and switch to it
        git branch -m [new-branch]rename current local branch
        git branch -m [old-branch] [new-branch]rename local branch
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git branchlist branch (* is current working branch)
        git branch -alist all branches (local + remote)
        git branch -rlist all remote branches
        git branch [branch]create new branch
        git branch -d [branch]delete branch
        git branch -u [branch]set upstream branch
        git push origin --delete [branch]delete remote branch
        git switch [branch]switch branch
        git switch -c [branch]create & switch to new branch
        git checkout [branch]switch branch
        git checkout -switch to branch last checked out
        git checkout -b [branch]create & switch to new branch
        git checkout -b [branch] [branch]/Originclone remote branch and switch to it
        git branch -m [new-branch]rename current local branch
        git branch -m [old-branch] [new-branch]rename local branch
        +
        +

        Note : It is recommended to create branches from the main branch.

        -

        Note : It is recommended to create branches from the main branch.

        # Remote

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git remoteshow active remote
        git remote -vshow active remote url
        git remote show [remote]show info about remote
        git remote add origin [path-to-repo]add remote repository
        git remote add [short-name] [repository-path]add new remote repo as short-name
        git remote rename [old-name] [new-name]rename remote
        git remote remove [short-name]delete remote
        git remote set-url origin ssh://git@github.com/[username]/[repository-name].gitset repo`s origin to SSH
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git remoteshow active remote
        git remote -vshow active remote url
        git remote show [remote]show info about remote
        git remote add origin [path-to-repo]add remote repository
        git remote add [short-name] [repository-path]add new remote repo as short-name
        git remote rename [old-name] [new-name]rename remote
        git remote remove [short-name]delete remote
        git remote set-url origin ssh://git@github.com/[username]/[repository-name].gitset repo`s origin to SSH
        +

        # Stash

        -
        - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CommandInfo
        git stashsave index state WIP on stash
        git stash -usave index state with untracked changes on stash
        git stash save "stash-name"save WIP with name stash-name on stash
        git stash applyapply changes from stash to current branch
        git stash apply stash@{n}apply changes from stash n to current branch
        git stash listlist saved stash entries
        git stash popremove single most recent stash entry and apply to current working tree
        git stash dropremove single most recent stash entry
        git stash clearremove all stashed entries
        git stash branch [branch-name]create new branch from stash and switch to it, also drop corresponding stash
        -
        -
        +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
        CommandInfo
        git stashsave index state WIP on stash
        git stash -usave index state with untracked changes on stash
        git stash save "stash-name"save WIP with name stash-name on stash
        git stash applyapply changes from stash to current branch
        git stash apply stash@{n}apply changes from stash n to current branch
        git stash listlist saved stash entries
        git stash popremove single most recent stash entry and apply to current working tree
        git stash dropremove single most recent stash entry
        git stash clearremove all stashed entries
        git stash branch [branch-name]create new branch from stash and switch to it, also drop corresponding stash
        +
        Note :
        • As in the array, the stash index begins at 0.
        • @@ -647,70 +667,73 @@

          # Stash

          # Reflog

          -
          - - - - - - - - - - - - - - - - - -
          CommandInfo
          git reflogmanage reflog information
          git branch [branch-name] [commit]restore specified commit to branch
          +
          +
          + + + + + + + + + + + + + + + + + +
          CommandInfo
          git reflogmanage reflog information
          git branch [branch-name] [commit]restore specified commit to branch
          +
          +

          Note : Git reflog can be used to restore deleted or lost commits.

          -

          Note : Git reflog can be used to restore deleted or lost commits.

          # Tags

          -
          - - - - - - - - - - - - - - - - - - - - - - - - - -
          CommandInfo
          git tag [tag|version]create new tag
          git tag -a [tag|version] -m "Tag Message"create new tag with message
          git tag [commit]give tag to commit
          git tag or git tag -l or git tag --listlist all tags
          +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + +
          CommandInfo
          git tag [tag|version]create new tag
          git tag -a [tag|version] -m "Tag Message"create new tag with message
          git tag [commit]give tag to commit
          git tag or git tag -l or git tag --listlist all tags
          +

          # Tips

          -
          +
          • Undo recent commit :

          Undo or delete the most recent remote commit.

          $ git reset --hard HEAD~1
           $ git push -f
          -
          -
          +
          • Local to remote repo :

          Creating a local repository and connecting to a non-empty remote repository.

          $ git init
          diff --git a/html.html b/html.html
          index 55cd0d1..4d48460 100644
          --- a/html.html
          +++ b/html.html
          @@ -64,7 +64,7 @@ 

          # HTML Page Structure

          # Tags

          -
          +
          • Heading
          @@ -102,8 +102,7 @@
          • Heading
          -
          -
          +
          • Containers
          @@ -129,8 +128,7 @@
          • Containers
          -
          -
          +
          • Text Formatting
          @@ -231,8 +229,7 @@
          • Text Formatting
          -
          -
          +
          • Others
          @@ -261,8 +258,7 @@
          • Others
          -
          -
          +
          • Semantic Elements
          @@ -325,9 +321,10 @@
          • Semantic Elements
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          CharEntity
          &&amp;
          &lowast;
          &sim;
          &and;
          <&lt;
          >&gt;
          ©&copy;
          ®&reg;
          &trade;
          ×&times;
          &bull;
          &larr;
          &rarr;
          &uarr;
          &darr;
          +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          CharEntity
          &&amp;
          &lowast;
          &sim;
          &and;
          <&lt;
          >&gt;
          ©&copy;
          ®&reg;
          &trade;
          ×&times;
          &bull;
          &larr;
          &rarr;
          &uarr;
          &darr;
          +
          +

          More? Click Here

          -
          diff --git a/laravel.html b/laravel.html index 11233c0..c689e43 100644 --- a/laravel.html +++ b/laravel.html @@ -36,287 +36,295 @@

          Laravel

          # Laravel Framework

          -

          Laravel is an open-source PHP web framework used for building web applications, based on the Model-View-Controller (MVC) architectural pattern. Laravel offers a wide range of features, including routing, middleware, authentication, sessions, caching, database management (with Eloquent ORM), and templating with Blade.

          -

          A web framework provides a structure, foundation and starting point for creating application, allowing to focus on creating application. It includes a collection of pre-written code, libraries, APIs, and tools that developers can use to build applications more efficiently.

          +
          +

          Laravel is an open-source PHP web framework used for building web applications, based on the Model-View-Controller (MVC) architectural pattern. Laravel offers a wide range of features, including routing, middleware, authentication, sessions, caching, database management (with Eloquent ORM), and templating with Blade.

          +

          A web framework provides a structure, foundation and starting point for creating application, allowing to focus on creating application. It includes a collection of pre-written code, libraries, APIs, and tools that developers can use to build applications more efficiently.

          +

          # Folder Structure

          -
            -
          • -

            app : This directory contains the core code of the application. It includes subdirectories, like

            -
              -
            • Console : Contains custom Artisan commands generated using the make:command command.
            • -
            • Exceptions : Contains custom exception handlers generated using the make:exception command..
            • -
            • Http : Contains controllers, middleware, and form requests.
            • -
            • Models : Contains the Eloquent ORM models.
            • -
            • Providers : Contains service providers for application bootstrapping.
            • -
            -
          • -
          • -

            bootstrap : Contains the application's bootstrap files, including app.php, which bootstraps the Laravel framework.

            -
          • -
          • -

            config : Configuration files for various parts of the application, such as database, cache, and session configuration.

            -
          • -
          • -

            database : Contains database migrations, seeds, and model factories.

            -
              -
            • migrations : Database migration files.
            • -
            • seeds : Database seeders.
            • -
            • factories : Model factories for generating test data.
            • -
            -
          • -
          • -

            public : This is the web server's document root. It contains the entry point (index.php), which is the entry point for all requests entering the application and configures autoloading and publicly accessible assets like CSS, JavaScript, and image files.

            -
          • -
          • -

            resources : Contains resources that the application uses, such as views, language files, and assets.

            -
              -
            • css, js, sass : Contains CSS and JavaScript assets.
            • -
            • lang : Language files for localization.
            • -
            • views : Blade templates for generating HTML.
            • -
            -
          • -
          • -

            routes : Contains route definitions for the application.

            -
              -
            • web.php : Routes for the web interface.
            • -
            • api.php : Routes for API endpoints.
            • -
            • console.php : Routes for Artisan commands.
            • -
            -
          • -
          • -

            storage : Contains application storage, such as logs, temporary files, and uploaded files.

            -
              -
            • app : Application-specific files generated by the application.
            • -
            • framework : Cache, sessions, and views used by the framework.
            • -
            • logs : Application log files.
            • -
            -
          • -
          • -

            tests : The tests directory contains your automated tests, such as PHPUnit test cases for the application.

            -
          • -
          • -

            vendor : Contains Composer dependencies.

            -
          • -
          • -

            .env : Environment configuration file.

            -
          • -
          • -

            artisan : Command line utility for interacting with your Laravel application.

            -
          • -
          +
          +
            +
          • +

            app : This directory contains the core code of the application. It includes subdirectories, like

            +
              +
            • Console : Contains custom Artisan commands generated using the make:command command.
            • +
            • Exceptions : Contains custom exception handlers generated using the make:exception command..
            • +
            • Http : Contains controllers, middleware, and form requests.
            • +
            • Models : Contains the Eloquent ORM models.
            • +
            • Providers : Contains service providers for application bootstrapping.
            • +
            +
          • +
          • +

            bootstrap : Contains the application's bootstrap files, including app.php, which bootstraps the Laravel framework.

            +
          • +
          • +

            config : Configuration files for various parts of the application, such as database, cache, and session configuration.

            +
          • +
          • +

            database : Contains database migrations, seeds, and model factories.

            +
              +
            • migrations : Database migration files.
            • +
            • seeds : Database seeders.
            • +
            • factories : Model factories for generating test data.
            • +
            +
          • +
          • +

            public : This is the web server's document root. It contains the entry point (index.php), which is the entry point for all requests entering the application and configures autoloading and publicly accessible assets like CSS, JavaScript, and image files.

            +
          • +
          • +

            resources : Contains resources that the application uses, such as views, language files, and assets.

            +
              +
            • css, js, sass : Contains CSS and JavaScript assets.
            • +
            • lang : Language files for localization.
            • +
            • views : Blade templates for generating HTML.
            • +
            +
          • +
          • +

            routes : Contains route definitions for the application.

            +
              +
            • web.php : Routes for the web interface.
            • +
            • api.php : Routes for API endpoints.
            • +
            • console.php : Routes for Artisan commands.
            • +
            +
          • +
          • +

            storage : Contains application storage, such as logs, temporary files, and uploaded files.

            +
              +
            • app : Application-specific files generated by the application.
            • +
            • framework : Cache, sessions, and views used by the framework.
            • +
            • logs : Application log files.
            • +
            +
          • +
          • +

            tests : The tests directory contains your automated tests, such as PHPUnit test cases for the application.

            +
          • +
          • +

            vendor : Contains Composer dependencies.

            +
          • +
          • +

            .env : Environment configuration file.

            +
          • +
          • +

            artisan : Command line utility for interacting with your Laravel application.

            +
          • +
          +

          # Routes

          -

          A route is a way of mapping HTTP request URIs to a specific controller action or a closure.

          -
          Route::get('/view/{id}', function(string $id){
          +                
          +

          A route is a way of mapping HTTP request URIs to a specific controller action or a closure.

          +
          Route::get('/view/{id}', function(string $id){
               return "User" . $id;
           });
          -
          http://127.0.0.1/view/17
          -
            -
          • /view : It is a route
          • -
          • /17 : It is a routing parameter.
          • -
          -
          Route Methods :
          -
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          MethodDescription
          get()Read data
          post()Add/Create, Update, Delete
          put()Update
          patch()Update
          delete()Delete
          options()Request information about methods supported by server for resource
          match()Used to define route that responds to multiple requests
          any()Used to define route that responds to all requests
          +
          http://127.0.0.1/view/17
          +
            +
          • /view : It is a route
          • +
          • /17 : It is a routing parameter.
          • +
          +
          Route Methods :
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          MethodDescription
          get()Read data
          post()Add/Create, Update, Delete
          put()Update
          patch()Update
          delete()Delete
          options()Request information about methods supported by server for resource
          match()Used to define route that responds to multiple requests
          any()Used to define route that responds to all requests
          +

          # Blades

          -

          Blade is the simple yet powerful templating engine that is included with Laravel. All Blade templates are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to the application. Blade template files use the .blade.php file extension and are typically stored in the resources/views directory.

          -
          Blade Directives :
          -

          In addition to template inheritance and displaying data, Blade also provides convenient shortcuts for common PHP control structures, such as conditional statements and loops called blade directives.

          -
            -
          • -
            Displaying Data :
            -
            {{ "Time : " . $time }}
            -
            -{{!! "<h1>I'm Dev</h1>" !!}}
            -
          • -
          • -
            Comment :
            -
            {{-- This is comment --}}
            -
          • -
          • -
            Raw PHP :
            -
            @php strtoupper("abcd") @endphp
            -
          • -
          • -
            Control Structure :
            -
            @if ($age = 18)
            -    $permission = "Complete"
            -@elseif ($age < 18)
            -    $permission = "Partial"
            -@else
            -    "Incorrect Age"
            -@endif
            -
          • -
          • -
            Switch Stamement :
            -
            @switch($val)
            -    @case(1)
            -        // Case 1
            -        @break
            -    @case(2)
            -        // Case 2
            -        @break
            -    @default
            -        // Default Case
            -@endswitch
            -
          • -
          • -
            Loops :
            -
            {{-- For Loop --}}
            -@for ($i = 0; $i < 10; $i++)
            -    Current value is {{ $i }}
            -@endfor
            -
            -{{-- For Each --}}
            -@foreach ($users as $user)
            -    This is user {{ $user->id }}
            -@endforeach
            -
            -{{-- While Loop --}}
            -@while (true)
            -    <p>I'm looping forever.</p>
            -@endwhile
            -
            -{{-- For Else --}}
            -@forelse ($users as $user)
            -    <li>{{ $user->name }}</li>
            -@empty
            -    <p>No users</p>
            -@endforelse
            -
          • -
          • -
            Loop Control :
            -
            @foreach ($users as $user)
            -    @if ($user->type == 1)
            -        @continue
            -    @endif
            -
            -    <li>{{ $user->name }}</li>
            -
            -    @if ($user->number == 5)
            -        @break
            -    @endif
            -@endforeach
            -
          • -
          • -
            Loop Variables :
            -
            - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
            PropertyDescription
            $loop->indexIndex of current iteration (starts at 0).
            $loop->iterationCurrent iteration (starts at 1).
            $loop->remainingIterations remaining in the loop
            $loop->countTotal number of items in array
            $loop->firstWhether this is first iteration
            $loop->lastWhether this is last iteration
            $loop->evenWhether this is even iteration
            $loop->oddWhether this is odd iteration
            $loop->depthNesting level of current loop
            $loop->parentWhen in nested loop, parent's loop variable
            -
            -
          • -
          • -
            Empty :
            -
            @empty($string)
            -    // Variable, array or collection is Empty
            -@endempty
            -
          • -
          • -
            Isset :
            -
            @isset($records)
            -    // Variable or array key is Set and is Not Null
            -@endisset
            -
          • -
          -
          +
          +

          Blade is the simple yet powerful templating engine that is included with Laravel. All Blade templates are compiled into plain PHP code and cached until they are modified, meaning Blade adds essentially zero overhead to the application. Blade template files use the .blade.php file extension and are typically stored in the resources/views directory.

          + +
          Blade Directives :
          +

          In addition to template inheritance and displaying data, Blade also provides convenient shortcuts for common PHP control structures, such as conditional statements and loops called blade directives.

          +
            +
          • +
            Displaying Data :
            +
            {{ "Time : " . $time }}
            +
            +    {{!! "<h1>I'm Dev</h1>" !!}}
            +
          • +
          • +
            Comment :
            +
            {{-- This is comment --}}
            +
          • +
          • +
            Raw PHP :
            +
            @php strtoupper("abcd") @endphp
            +
          • +
          • +
            Control Structure :
            +
            @if ($age = 18)
            +        $permission = "Complete"
            +    @elseif ($age < 18)
            +        $permission = "Partial"
            +    @else
            +        "Incorrect Age"
            +    @endif
            +
          • +
          • +
            Switch Stamement :
            +
            @switch($val)
            +        @case(1)
            +            // Case 1
            +            @break
            +        @case(2)
            +            // Case 2
            +            @break
            +        @default
            +            // Default Case
            +    @endswitch
            +
          • +
          • +
            Loops :
            +
            {{-- For Loop --}}
            +    @for ($i = 0; $i < 10; $i++)
            +        Current value is {{ $i }}
            +    @endfor
            +
            +    {{-- For Each --}}
            +    @foreach ($users as $user)
            +        This is user {{ $user->id }}
            +    @endforeach
            +
            +    {{-- While Loop --}}
            +    @while (true)
            +        <p>I'm looping forever.</p>
            +    @endwhile
            +
            +    {{-- For Else --}}
            +    @forelse ($users as $user)
            +        <li>{{ $user->name }}</li>
            +    @empty
            +        <p>No users</p>
            +    @endforelse
            +
          • +
          • +
            Loop Control :
            +
            @foreach ($users as $user)
            +        @if ($user->type == 1)
            +            @continue
            +        @endif
            +
            +        <li>{{ $user->name }}</li>
            +
            +        @if ($user->number == 5)
            +            @break
            +        @endif
            +    @endforeach
            +
          • +
          • +
            Loop Variables :
            +
            + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
            PropertyDescription
            $loop->indexIndex of current iteration (starts at 0).
            $loop->iterationCurrent iteration (starts at 1).
            $loop->remainingIterations remaining in the loop
            $loop->countTotal number of items in array
            $loop->firstWhether this is first iteration
            $loop->lastWhether this is last iteration
            $loop->evenWhether this is even iteration
            $loop->oddWhether this is odd iteration
            $loop->depthNesting level of current loop
            $loop->parentWhen in nested loop, parent's loop variable
            +
            +
          • +
          • +
            Empty :
            +
            @empty($string)
            +        // Variable, array or collection is Empty
            +    @endempty
            +
          • +
          • +
            Isset :
            +
            @isset($records)
            +        // Variable or array key is Set and is Not Null
            +    @endisset
            +
          • +
          +
          Passing Data Route to View :
          Route - web.php
          @@ -332,82 +340,87 @@
          Blade - userpage.blade.php

          # Composer

          -

          Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on, and it will manage (install or update) them for you. Composer is not a package manager; it is a dependency manager.

          -
          Composer Commands :
          -
            -
          • -
            Create Laravel Project :
            -
            composer create-project laravel/laravel [Project-Name]
            -
          • -
          • -
            Install Dependency :
            -
            composer install
            -
          • -
          • -
            Update Dependency :
            -
            composer update
            -
          • -
          +
          +

          Composer is a tool for dependency management in PHP. It allows you to declare the libraries your project depends on, and it will manage (install or update) them for you. Composer is not a package manager; it is a dependency manager.

          +
          Composer Commands :
          +
            +
          • +
            Create Laravel Project :
            +
            composer create-project laravel/laravel [Project-Name]
            +
          • +
          • +
            Install Dependency :
            +
            composer install
            +
          • +
          • +
            Update Dependency :
            +
            composer update
            +
          • +
          +

          # Artisan

          -

          Artisan is the command-line interface included with Laravel. Artisan exists at the root of your application as the artisan script and provides a number of helpful commands that can assist in building the application.

          -
          Artisan Commands :
          -
            -
          • -
            Run Project :
            -
            php artisan serve
            -
          • -
          • -
            Create Controller :
            -
            php artisan make:controller [Controller-Name]
            -
          • -
          • -
            Create Resource Controller :
            -
            php artisan make:controller [Resource-Controller] --resource
            -
          • -
          • -
            Create Component :
            -
            php artisan make:component [input]
            -
          • -
          • -
            Create ORM Model :
            -
            php artisan make:model [Model]
            -
          • -
          • -
            Create Migration Table :
            -
            php artisan make:migration [create-user-table]
            -
          • -
          • -
            Run Migrations :
            -
            php artisan migrate
            -
          • -
          • -
            Rollback Migrations :
            -
            php artisan migrate:rollback
            -
          • -
          • -
            Reset Migrations :
            -
            php artisan migrate:reset
            -
          • -
          • -
            Refresh Migrations :
            -
            php artisan migrate:refresh
            -
          • -
          • -
            Create Import/Export Model :
            -
            php artisan make:import [ModelImport] --model=[Model]
            -
            -php artisan make:export [ModelExport] --model=[Model]
            -
          • -
          +
          +

          Artisan is the command-line interface included with Laravel. Artisan exists at the root of your application as the artisan script and provides a number of helpful commands that can assist in building the application.

          +
          Artisan Commands :
          +
            +
          • +
            Run Project :
            +
            php artisan serve
            +
          • +
          • +
            Create Controller :
            +
            php artisan make:controller [Controller-Name]
            +
          • +
          • +
            Create Resource Controller :
            +
            php artisan make:controller [Resource-Controller] --resource
            +
          • +
          • +
            Create Component :
            +
            php artisan make:component [input]
            +
          • +
          • +
            Create ORM Model :
            +
            php artisan make:model [Model]
            +
          • +
          • +
            Create Migration Table :
            +
            php artisan make:migration [create-user-table]
            +
          • +
          • +
            Run Migrations :
            +
            php artisan migrate
            +
          • +
          • +
            Rollback Migrations :
            +
            php artisan migrate:rollback
            +
          • +
          • +
            Reset Migrations :
            +
            php artisan migrate:reset
            +
          • +
          • +
            Refresh Migrations :
            +
            php artisan migrate:refresh
            +
          • +
          • +
            Create Import/Export Model :
            +
            php artisan make:import [ModelImport] --model=[Model]
            +
            +    php artisan make:export [ModelExport] --model=[Model]
            +
          • +
          +

          # Database

          -

          Laravel provides two main approaches for interacting with databases: the query builder and the ORM (Object-Relational Mapping) called Eloquent. The configuration for Laravel's database services is located in the application's config/database.php configuration file.

          -
          +
          +

          Laravel provides two main approaches for interacting with databases: the query builder and the ORM (Object-Relational Mapping) called Eloquent. The configuration for Laravel's database services is located in the application's config/database.php configuration file.

          +
          • Query Builder :

          Laravel Query Builder is a fluent interface for building and running database queries in Laravel without having to write raw SQL statements.

          $users = DB::table('users')->select('name', 'email')->get();
          @@ -418,8 +431,7 @@ 
          • Query Builder :
          'name' => 'John Doe', 'email' => 'john@example.com', ]);
          -
          -
          +
          • Eloquent ORM :

          Laravel's Eloquent ORM is an ActiveRecord implementation for working with databases in PHP. It allows you to interact with your database tables using PHP objects. Each database table has a corresponding "model" that is used to interact with that table.

          User's Model -
          diff --git a/markdown.html b/markdown.html index 1203a8c..63339d8 100644 --- a/markdown.html +++ b/markdown.html @@ -41,171 +41,193 @@

          Markdown

          # Heading

          -
          - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Syntax

          # H1

          ## H2

          ### H3

          #### H4

          ##### H5
          ###### H6
          -
          -
          +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Syntax

          # H1

          ## H2

          ### H3

          #### H4

          ##### H5
          ###### H6
          +
          Heading ID :
          ### Title {#title-1}
           
           This is [title](https://example.com/#title-1).
          - +

          # Text Formatting

          -
          - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          Syntax
          **Strong Text**
          *Emphasized Text*
          ***Strong & Emphasized Text***
          `code`
          ~~Strikethrough~~
          ==Marked Text==
          Subscript~Text~
          Superscript~Text~
          +
          +
          + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
          Syntax
          **Strong Text**
          *Emphasized Text*
          ***Strong & Emphasized Text***
          `code`
          ~~Strikethrough~~
          ==Marked Text==
          Subscript~Text~
          Superscript~Text~
          +

          # Lists

          -
          • Ordered List :
          -
          1. Item
          +                
          +
          • Ordered List :
          +
          1. Item
           2. Item
           3. Item
          -
          • Unordered List :
          -
          - Item
          +                    
          • Unordered List :
          +
          - Item
           - Item
           - Item
          +

          # Tables

          -
          |  Item  | Cost | Stock |
          +                
          +
          |  Item  | Cost | Stock |
           | ------ | ---- | ----- |
           | Apple  | 100  | 25    |
           | Orange | 80   | 50    |
           | Mango  | 200  | 100   |
          -
          Aligning Column :
          -

          Add a colon (:) to the beginning, end, or both to align the columns left, right, and center, respectively.

          -
          | Item    |  Cost  |  Stock |
          +                    
          Aligning Column :
          +

          Add a colon (:) to the beginning, end, or both to align the columns left, right, and center, respectively.

          +
          | Item    |  Cost  |  Stock |
           | :------ | :----: | -----: |
           | Apple   |   100  |    25  |
           | Orange  |   80   |    50  |
           | Mango   |   200  |    100 |
          +

          # Images

          -
          ![Example Image](http://www.example.com/example.png)
          -
          Image with title :
          -
          ![Example Image](http://www.example.com/example.png "Example Image")
          +
          +
          ![Example Image](http://www.example.com/example.png)
          +
          Image with title :
          +
          ![Example Image](http://www.example.com/example.png "Example Image")
          +

          # Code Block

          -
          `$var = "text";`
          -
          ```
          +                
          +
          `$var = "text";`
          +
          ```
           $num1 = 12;
           $num2 = 21;
           
           print($num1 + $num2);
           ```
          +

          # Blockquote

          -
          > This is blockquote.
          +                
          +
          > This is blockquote.
           
           > This is also
           > Blockquote.
          -
          Nested Blockquote :
          -
          > This is blockquote.
          +                    
          Nested Blockquote :
          +
          > This is blockquote.
           
           > > This is nested blockquote.
          +

          # Task List

          -
          - [x] Task Checked
          +                
          +
          - [x] Task Checked
           - [ ] Task
           - [ ] Task
          +

          # Definition List

          -
          Term
          +                
          +
          Term
           : Term definition 1
           : Term definition 2
          +

          # Footnote

          -
          This is a new project. [^1]
          +                
          +
          This is a new project. [^1]
           
           [^1]: Stack is: PHP, Laravel
          +

          # Horizontal Line

          -
          ---
          +
          +
          ---
          +
          diff --git a/pacman.html b/pacman.html index f731ae7..7a6664b 100644 --- a/pacman.html +++ b/pacman.html @@ -33,7 +33,7 @@

          Arch Pacman

          # Install Package

          -
          +
          Full System Upgrade
          pacman -Syu
          @@ -54,7 +54,7 @@
          Install Downloaded Package

          # Query Package

          -
          +
          Search Package
          pacman -Ss [package]
          @@ -77,7 +77,7 @@
          Installed Package Information

          # Remove Package

          -
          +
          Remove Package
          pacman -R [package]
          @@ -91,7 +91,7 @@
          Remove Package, Dependencies & Configs

          # Clean System

          -
          +
          List Orphan/Obsolete Packages
          pacman -Qtdq