Skip to content

Instantly share code, notes, and snippets.

View mahammad's full-sized avatar
🌙
That's happening!

Məhəmməd mahammad

🌙
That's happening!
View GitHub Profile
@mahammad
mahammad / Request.php
Last active September 27, 2021 06:23
Laravelde özel Request nasıl yapılıyor?
<?php
namespace App\Http\Requests;
use Illuminate\Foundation\Http\FormRequest;
use Illuminate\Support\Str;
class informationRequest extends FormRequest
{
public function authorize()
@mahammad
mahammad / laravel-component.md
Last active April 22, 2024 10:56
Laravel`de component yapısı . comonent nasıl kullanılır, laravel modal companent

views dizi altında comdizini oluşturdum. Bu dizin benim component'lerimi barındaracak.

com dizinine modal.blade.php dosyası oluşturdum.

bootstrap 4/5 modal tasarımıdır.

  <div class="modal fade text-start modal-{{ $config["class"] ?? 'primary' }}" id="{{ $config["id"]}}" tabindex="-1"
    aria-labelledby="{{ $config["id"]}}Label" aria-hidden="true">
    <div class="modal-dialog modal-dialog-centered {{ $type ?? '' }}">
        <div class="modal-content">
@mahammad
mahammad / php-sayi-yuvarlama.php
Last active November 3, 2021 10:49
PHP'de sayı yuvarlama fonksiyonu
<?php
if (!function_exists('round_up')) {
/**
* @param float $value
* @param integer $places
* @return float
*/
function round_up($value, $places=0)
{
if ($places < 0) { $places = 0; }
@mahammad
mahammad / model.php
Created November 20, 2021 13:43
Laravel model event
<?php
public static function boot()
{
parent::boot();
self::creating(function ($model) {
// ... code here
});
self::created(function ($model) {
@mahammad
mahammad / SanctumAbilityCheck.php
Created November 21, 2021 21:23
How to create laravel sanctum ability
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class SanctumAbilityCheck
{
/**
@mahammad
mahammad / import.sql
Created November 26, 2021 19:19
Ulke sehir il ilce sql
INSERT INTO `cities` (`id`, `country_id`, `name`, `plate_no`, `phone_code`) VALUES
(1, 212, 'ADANA', '1', '322'),
(2, 212, 'ADIYAMAN', '2', '416'),
(3, 212, 'AFYONKARAHİSAR', '3', '272'),
(4, 212, 'AĞRI', '4', '472'),
(5, 212, 'AKSARAY', '68', '382'),
(6, 212, 'AMASYA', '5', '358'),
(7, 212, 'ANKARA', '6', '312'),
(8, 212, 'ANTALYA', '7', '242'),
(9, 212, 'ARDAHAN', '75', '478'),
@mahammad
mahammad / how-to-install-mcrypt.sh
Created December 3, 2021 06:28
Mcrypt installation process
yum install epel-release
yum install libmcrypt libmcrypt-devel
for version in $(ls /opt/cpanel|grep ea-php); do /opt/cpanel/${version}/root/usr/bin/pecl channel-update pecl.php.net; done
export LC_ALL="C"
export LANG="C"
/opt/cpanel/ea-php72/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.1
/opt/cpanel/ea-php73/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.2
/opt/cpanel/ea-php74/root/usr/bin/pecl install channel://pecl.php.net/mcrypt-1.0.3
@mahammad
mahammad / README.md
Created December 3, 2021 18:50
Laravel Kod Örneklerim

Model Örneği

<?php

namespace App\Models;

use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Laravel\Sanctum\HasApiTokens;
@mahammad
mahammad / Replace.php
Created January 6, 2022 05:51
Email Template Content Replace
<?php
if (!function_exists('staticMailTemplateReplace')) {
function staticMailTemplateReplace($scope, object $data = NULL)
{
$templates = Cache::get('templates', function () {
return (new Template())->on('mysql_license')->get();
});
$template_options = Cache::get('template_options', function () {