Skip to content

Instantly share code, notes, and snippets.

View Neeraj1005's full-sized avatar
🎯
Focusing

Neeraj Singh Neeraj1005

🎯
Focusing
View GitHub Profile
@Neeraj1005
Neeraj1005 / UsersTable.php
Created January 5, 2021 06:05 — forked from davidgrzyb/UsersTable.php
Livewire Infinite Scroll Example
<?php
namespace App\Http\Livewire;
use App\Models\User;
use Livewire\Component;
class UsersTable extends Component
{
public $totalRecords;
@Neeraj1005
Neeraj1005 / Draggable.php
Created January 21, 2021 20:08
sortable dragable using livewire
<?php
namespace App\Http\Livewire;
use Livewire\Component;
class Draggable extends Component
{
public $things = [
['id'=>1,'title'=>'First Title'],

library used

https://datatables.net/

Disable search, paging, info and additional code is defined for filter option.

In your html add for filter

 <div class="btn-group dropdown keep-open float-right">
    <button type="button" class="btn btn-sm btn-outline-secondary dropdown-toggle" id="login"
@Neeraj1005
Neeraj1005 / nextjs-submit-form.md
Last active March 3, 2021 12:53
In NextJs submit the form using basic react functionality. Basically this form is store for product one or two, three..etc

This is my [slug].js file

import Link from "next/link";
import Head from "next/head";
import React, { useState } from "react";
import { Formik } from 'formik';

const Product = ({ product }) => {
  const item = product.product;
  const currencyCode = product.user.currency.html_code;
@Neeraj1005
Neeraj1005 / NextJs-formik.md
Created March 3, 2021 12:54
submit form in nextjs using formik

this is my [slug].js file

import Link from "next/link";
import Head from "next/head";
import React, { useState } from "react";
import { useFormik } from "formik";

const Product = ({ product }) => {
  const item = product.product;
  const currencyCode = product.user.currency.html_code;
@Neeraj1005
Neeraj1005 / Livewire-descendent-dropdown.md
Created March 8, 2021 12:43
descendent dropdown for country and state Using Livewire

In this I have done descendent dropdown using Laravel Livewire

Country Component

<?php

namespace App\Http\Livewire\Company;

use App\Tbl_accounttypes;
use App\Tbl_countries;
@Neeraj1005
Neeraj1005 / Livewire Toggle Component.md
Created March 17, 2021 08:07
Creating Toggle (active/inactive) button using livewire in Laravel

First create livewire component

php artisan make:livewire ToggleButton

Second Open ToggleButton component file and add this line of code

<?php

namespace App\Http\Livewire;
@Neeraj1005
Neeraj1005 / index.md
Last active August 30, 2022 14:06
Using useEffect create search filter in NextJs

Add Search filter in NextJs using useState and useEffect

index.js

import Layout from "../../components/Layout";
import { NextSeo } from "next-seo";
import { useState, useEffect } from "react";
import CitiesComponent from "../../components/CitiesComponent";

const topCity = () => {
@Neeraj1005
Neeraj1005 / GitDeleteCommands.ps1
Created March 27, 2021 10:31 — forked from cmatskas/GitDeleteCommands.ps1
Git Delete Branch commands
## Delete a remote branch
$ git push origin --delete <branch> # Git version 1.7.0 or newer
$ git push origin :<branch> # Git versions older than 1.7.0
## Delete a local branch
$ git branch --delete <branch>
$ git branch -d <branch> # Shorter version
$ git branch -D <branch> # Force delete un-merged branches
## Delete a local remote-tracking branch
@Neeraj1005
Neeraj1005 / Search.md
Created April 24, 2021 15:57
Create Search in Nextjs and using strapi API

create component Search.js

import { useState } from "react";
import { useRouter } from "next/router";
import styles from "@/styles/Search.module.css";

export default function Search() {
  const [keyword, setKeyword] = useState("");