Skip to content

Instantly share code, notes, and snippets.

@ravibhoraniya
ravibhoraniya / gist:61f64d29c099d068fbadfa1007d0b1bf
Last active March 4, 2024 12:03
Short Method update with file upload - Laravel
public function adminDriverDataUpdate(Request $request)
{
$post = $request->all();
$request->validate([
'name' => 'required',
'username' => [
'required',
Rule::unique('users')->ignore($post['id']),
],
'phone' => 'required',
echo "# Code" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:ravibhoraniya/ttt.git
git push -u origin master
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use DB;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Redirect;
use View;
use Validator;
use Hash;
use Carbon\Carbon;
use Input;
/**
* crerate zip file
* (*) for all file in directory
*/
sudo zip -r name.zip *
/**
* crerate zip file
* (-x) exclude specific file or directory
/**
** check php version and extension status
**/
php -v
php -m
/**
** change php version
/* clean cache */
php bin/magento cache:clean
/* reindex */
php bin/magento indexer:reindex
/* ugrade */
php bin/magento setup:upgrade
function wp_bootstrap_starter_widgets_init2() {
register_sidebar( array(
'name' => esc_html__( 'Widgets Name', 'wp-bootstrap-starter' ),
'id' => 'widgets_slug',
'description' => esc_html__( 'Add widgets here.', 'wp-bootstrap-starter' ),
'before_widget' => '<section id="%1$s" class="widget %2$s">',
'after_widget' => '</section>',
'before_title' => '<h3 class="widget-title">',
'after_title' => '</h3>',
) );
/*------------------------ visual composer example ---------------------*/
add_filter('site_transient_update_plugins', 'remove_update_notifications');
function remove_update_notifications($value) {
if ( isset( $value ) && is_object( $value ) ) {
unset($value->response[ 'js_composer/js_composer.php' ]);
}
}