exec - Returns last line of commands output
passthru - Passes commands output directly to the browser
system - Passes commands output directly to the browser and returns last line
shell_exec - Returns commands output
\`\` (backticks) - Same as shell_exec()
popen - Opens read or write pipe to process of a command
proc_open - Similar to popen() but greater degree of control
pcntl_exec - Executes a program
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Saeed Abdollahian | |
Telegram: | |
https://t.me/PhpWebDeveloper | |
*/ | |
function getServerLoad() | |
{ | |
$load = 0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"preset": "laravel", | |
"exclude": [ | |
"storage", | |
"bootstrap/cache" | |
], | |
"rules": { | |
"concat_space": { | |
"spacing": "one" | |
}, |
کدی تمیز است که به راحتی توسط همه ی اعضای تیم قابل درک باشد. کد تمیز میتواند توسط توسعه دهنده ای به غیر از نویسنده ی آن، خوانده و توسعه داده شود. خوانایی، قابلیت نگهداری، تغییر و توسعه پذیری کد، تنها زمانی امکان پذیر است که شما درک درستی از نحوه ی کار کد پیدا کنید.
- از قوانین استاندارد (مثل: نام گذاری کلاس ها و توابع، میزان فرورفتگی یا ایندنتیشن و ...) پیروی کنید. ([Standard Conventions][Standard Conventions])
- تا حد امکان پیچیدگی را در کد کاهش دهید. همیشه سادگی بهتر است. (قانون [KISS][KISS])
- سورس کد را تمیز تر از زمانی که تحویل می گیرید، تحویل دهید. (قانون [Boy Scout][Boy Scout])
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#1- Create `Media` Model In App\Models | |
<?php | |
namespace App\Models; | |
use Spatie\MediaLibrary\HasMedia; | |
use Illuminate\Database\Eloquent\Model; | |
use Spatie\MediaLibrary\InteractsWithMedia; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
YourModel::updateOrCreate( | |
[ | |
'user_id' => '1', | |
'user_type' => 'admin' | |
], | |
[ | |
'user_id' => '1', | |
'user_type' => 'admin', | |
'value' => DB::raw('value + 1'), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* 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"]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Debug { | |
/** | |
* A collapse icon, using in the dump_var function to allow collapsing | |
* an array or object | |
* | |
* @var string | |
*/ |