Skip to content

Instantly share code, notes, and snippets.

View arvindsvt's full-sized avatar

Arvind Shrivastwa arvindsvt

  • Ahmedabad
View GitHub Profile
@arvindsvt
arvindsvt / react-crud-php-api-mysql
Created August 9, 2025 10:17
react-crud-php-api-mysql
npm create vite@latest my-project -- --template reactcd my-project https://v3.tailwindcss.com/docs/guides/vite
https://www.reacttutorial.com/fetching-api-request-in-react
https://codepen.io/shubham829/pen/jQRRjd
https://www.freecodecamp.org/news/how-to-fetch-api-data-in-react/
https://legacy.reactjs.org/docs/lists-and-keys.html
https://stackoverflow.com/questions/43985933/rendering-a-table-using-reactjs
https://www.reacttutorial.com/fetching-api-request-in-react
@arvindsvt
arvindsvt / React Listing Api
Created August 7, 2025 07:15
React Listing Api
import React, { useState, useEffect } from 'react'
const About = () => {
const [data, setData] = useState(null)
const [loading, setLoading] = useState(true)
const [error, setError] = useState(null)
useEffect(() => {
const fetchData = async () => {
try {
@arvindsvt
arvindsvt / dark admin
Last active May 3, 2024 13:41
dark admin
https://techzaa.getappui.com/velonic/index.html
https://techzaa.getappui.com/velonic/layouts/tables-datatable.html
file:///C:/Users/Dell/Desktop/New%20folder/New%20folder/New%20folder/techzaa.getappui.comveloniclayoutstables-datatable.html
<html lang="en" data-bs-theme="dark" data-layout-mode="fluid" data-menu-color="dark" data-topbar-color="light"
data-layout-position="fixed" data-sidenav-size="default" class="menuitem-active">
<head>
<meta charset="utf-8">
<title>Datatables | Velonic - Bootstrap 5 Admin &amp; Dashboard Template</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@arvindsvt
arvindsvt / sqlcrudephp-api-with-jwt-auth-blob-master
Created April 29, 2024 14:20
sqlcrudephp-api-with-jwt-auth-blob-master
<?php
class Database
{
private $localhost = "localhost";
private $username = "root";
private $password = "";
private $database = "php_api_jwt";
private $mysqli = "";
private $result = array();
@arvindsvt
arvindsvt / validate
Created April 26, 2024 02:16
validate
if(empty($data_to_db['user_name'])) {
$_SESSION['errors']['user_name'] = "User name is required";
}
if(empty($data_to_db['user_email'])) {
$_SESSION['errors']['user_email'] = "Email is required";
}
if( filter_var( $data_to_db['user_email'] , FILTER_VALIDATE_EMAIL) ) {
$_SESSION['errors']['user_email'] = "Email is required";
}
if (empty($data_to_db['password'])) {
@arvindsvt
arvindsvt / model form offcanvas table metarial
Last active April 16, 2024 15:50
model form offcanvas table metarial
https://www.freecodecamp.org/news/how-to-build-a-dropdown-menu-with-javascript/
Multi Select Dropdown with Search in Bootstrap 5 https://codepen.io/mohan-aiyer/pen/gOWveJE
https://demos.codexworld.com/multi-select-dropdown-list-with-checkbox-jquery/
https://www.youtube.com/watch?v=fZgGc9XoZ6U https://drive.google.com/file/d/152j7Er6q5MeFPQPpJ7XmqfQjCqRzBNmD/view
https://laraget.com/blog/select2-and-laravel-ajax-autocomplete
https://www.techiediaries.com/laravel-8-ajax-crud-modal-pagination/
<!DOCTYPE html>
<!--
Template Name: Stack - Stack - Bootstrap 4 Admin Template
Author: PixInvent
@arvindsvt
arvindsvt / request-only-not-work-laravel
Last active April 14, 2024 15:44
request-only-not-work-laravel
https://stackoverflow.com/questions/38271551/why-does-if-statement-with-request-only-not-work-laravel
$request->only('name', 'age', 'cheese');
// ['name' => 'Pingu', 'age' => '22', 'cheese' => 'gorgonzola']
// Retrieve a portion of the validated input data...
$validated = $request->safe()->only(['name', 'email']);
$validated = $request->safe()->except(['name', 'email']);
add this function to our escaped blade statement:
https://stackoverflow.com/questions/78154387/laravel11-mysql-migration-problem-with-collation-general-error-1273-unknown-c
DB_COLLATION=utf8mb4_unicode_ci
@arvindsvt
arvindsvt / dropzone-ckeditor-image-upload
Last active April 12, 2024 05:15
dropzone-ckeditor-image-upload
https://www.itsolutionstuff.com/post/laravel-6-ckeditor-image-upload-exampleexample.html
https://stackoverflow.com/questions/32810231/add-public-to-asset-path-in-laravel
//https://www.positronx.io/laravel-drag-and-drop-image-file-upload-tutorial-with-example/
Route::get('upload-ui', [FileUploadController::class, 'dropzoneUi' ]);
https://www.fundaofwebit.com/post/drag-and-drop-image-file-upload-in-laravel#google_vignette
https://dev.to/kingsconsult/how-to-upload-files-with-drag-n-drop-and-image-preview-in-laravel-8-using-dropzone-49hd
//https://phppot.com/javascript/dropzone-progress-bar/
Route::post('file-upload', [FileUploadController::class, 'dropzoneFileUpload' ])->name('dropzoneFileUpload');
@arvindsvt
arvindsvt / validate-an-api-request-in-laravel
Last active April 14, 2024 16:21
validate-an-api-request-in-laravel
https://medium.com/@sgandhi132/how-to-validate-an-api-request-in-laravel-35b46470ba88
https://www.youtube.com/watch?v=IvKMPwybSKI
Final code of “LoginRequest.php” file
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Http\Exceptions\HttpResponseException;
use Illuminate\Contracts\Validation\Validator;
class LoginRequest extends FormRequest
@arvindsvt
arvindsvt / disable-laravel-eloquent-auto-incrementcustom-primary-key
Last active April 6, 2024 09:48
disable-laravel-eloquent-auto-incrementcustom-primary-key
class UserVerification extends Model
{
// if your key name is not 'id'
// you can also set this to null if you don't have a primary key
protected $primaryKey = 'your_key_name';
public $incrementing = false;
// In Laravel 6.0+ make sure to also set $keyType
protected $keyType = 'string';