Skip to content

Instantly share code, notes, and snippets.

View saeedvir's full-sized avatar
🎯
Focusing

saeed abdollahian saeedvir

🎯
Focusing
View GitHub Profile
@saeedvir
saeedvir / after_install_kali.sh
Created February 3, 2024 16:26
after_install_kali.sh
DNS:
178.22.122.100
185.51.200.2
-----------------------
sudo apt install software-properties-common
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
sudo echo "deb http://http.kali.org/kali kali-rolling main non-free contrib" | sudo tee /etc/apt/sources.list
sudo apt update
@saeedvir
saeedvir / spatie laravel-medialibrary__save_media_without_a_model_relationship
Last active January 17, 2024 03:07
spatie/laravel-medialibrary , save media without a model relationship
#1- Create `Media` Model In App\Models
<?php
namespace App\Models;
use Spatie\MediaLibrary\HasMedia;
use Illuminate\Database\Eloquent\Model;
use Spatie\MediaLibrary\InteractsWithMedia;
@echo off
color 0A
title laravel task cronjob for windows © Er.DhruvMishra
Echo.
echo Drag n Drop the artisan file of your project here
echo (it is located in your project folder)
set /p ap=
cls
:starx
SCHTASKS /Create /SC MINUTE /TN laravel /TR "php %ap% schedule:run"
@saeedvir
saeedvir / Laravel_UpdateOrCreateOrIncrement
Last active January 5, 2024 03:52
Laravel UpdateOrCreateOrIncrement
<?php
YourModel::updateOrCreate(
[
'user_id' => '1',
'user_type' => 'admin'
],
[
'user_id' => '1',
'user_type' => 'admin',
'value' => DB::raw('value + 1'),
@saeedvir
saeedvir / TinyMCE Upload image and laravel
Last active December 1, 2023 02:30
TinyMCE Upload image + laravel
/*
* Laravel Route Or Controller
*/
Route::post('tinymce-upload', function (Request $request) {
#Check For Upload (add your security !!!)
$fileName = request()->file('file')->getClientOriginalName();
$path = request()->file('file')->storeAs('uploads', $fileName, 'public');
return response()->json(['location' => "/storage/$path"]);
@saeedvir
saeedvir / Debug.php
Created November 21, 2022 05:03 — forked from sunel/Debug.php
PHP Pretty var_dump
<?php
class Debug {
/**
* A collapse icon, using in the dump_var function to allow collapsing
* an array or object
*
* @var string
*/
@saeedvir
saeedvir / Laravel Data Masking (Encode & Decode Model fields ) Trait
Last active October 19, 2022 07:35
Laravel Data Masking (Encode & Decode Model fields ) Trait
/*
** saeed abdollahian
** Freelance PHP developer & consultant. Laravel specialist.
** Freelance (available)
** https://t.me/PhpWebDeveloper
*/
<?php
namespace App;
/*
@saeedvir
saeedvir / cloudSettings
Last active August 4, 2020 03:53
my Vscode Settings
{"lastUpload":"2020-08-04T03:52:57.654Z","extensionVersion":"v3.4.3"}
@saeedvir
saeedvir / create png from text in php
Created February 19, 2020 14:46
create png from text in php
<?php
$to_store ='test-file.png';
$img_data=null;
$fontSize = 20;
$imgWidth = 400;
$imgHeight = 80;
$angle = 0;
$font = 'font_name.ttf';
@saeedvir
saeedvir / ModelForMedialibrary
Last active January 30, 2020 04:41
how to use "spatie/laravel-medialibrary" in shared host (solved)
by: https://github.com/saeedvir
telegram : https://t.me/PhpWebDeveloper
==============================================
package :
https://github.com/spatie/laravel-medialibrary
("proc_open" function is disabled in shared host)
use this code in your model :