Skip to content

Instantly share code, notes, and snippets.

View amir9480's full-sized avatar
🎯
Focusing

Amir Alizadeh amir9480

🎯
Focusing
View GitHub Profile
@amir9480
amir9480 / cloudSettings
Last active December 21, 2020 13:25
Visual Studio Code Settings Sync Gist
{"lastUpload":"2020-12-21T13:25:34.472Z","extensionVersion":"v3.4.3"}
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
@amir9480
amir9480 / helpers.js
Created November 15, 2018 08:16
javascript helpers
window.enToFa = function (text) {
text = String(text);
text = text.replace(/0/g, '۰');
text = text.replace(/1/g, '۱');
text = text.replace(/2/g, '۲');
text = text.replace(/3/g, '۳');
text = text.replace(/4/g, '۴');
text = text.replace(/5/g, '۵');
text = text.replace(/6/g, '۶');
text = text.replace(/7/g, '۷');
@amir9480
amir9480 / index.blade.php
Last active January 18, 2019 07:38
Laravel simple contact view
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Sample contact form</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css">
</head>
<body dir="rtl">
<?php
namespace App\Mail;
use App\Message;
use Illuminate\Bus\Queueable;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;
use Illuminate\Contracts\Queue\ShouldQueue;
@amir9480
amir9480 / Post.php
Last active May 20, 2019 17:46
vasiatlaravel
<?php
class BlogPost extends Model
{
protected $with = [
'category'
];
/**
* Category of this post.
@amir9480
amir9480 / BlogCommentObserver.php
Last active May 20, 2019 17:49
vasiat laravel
<?php
namespace App\Observers;
use App\BlogComment;
use Illuminate\Support\Facades\Auth;
class BlogCommentObserver
{
/**
@amir9480
amir9480 / BlogPost.php
Created May 20, 2019 18:03
vasiat laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Builder;
class BlogComment extends Model
{
protected static function boot()
@amir9480
amir9480 / BlogPost.php
Created May 20, 2019 18:10
vasiat laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class BlogComment extends Model
{
protected $casts = [
'confirmed' => 'boolean'
@amir9480
amir9480 / BlogPost.php
Created May 20, 2019 18:27
vasiat laravel
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class BlogPost extends Model
{
public function getLinkAttribute()
{