Forwarded from Sobirjonov Sanjarbek
PHP/Javascript va Laravelga oid loyihalarni serverga yuklash va serverni boshqarish kabi siyqasi chiqqan ishlarni amalga oshirishni osonlashtiruvchi forge.laravel.com xizmati bor. Lekin u pulli. Shunga yarasha xatosiz va ishonchli ishlaydi. Lekin forge loyihasiga analog sifatida open-source Vitodeploy loyihasi chiqarilibdi.
Bu loyiha Saeed Vaziry ismli dasturchi tomonidan Laravel freymvorkida ishlab chiqilgan, 2.5 yildan oshiq vaqt sarflagan ekan. Buni qilishning sababi u forge.laravel.com servisiga pul to'lash uchun onlayn to'lovlar ishlamaydigan davlatda yashaganligi bo'lgan. Shu to'siq tufayli u o'zi uchun yechim qilgan. Buni 2023 yil oxirida reliz qilgan. Oldin bu loyihani u pulli servis sifatida sotgan lekin o'ylab qaraganidan so'ng PHP hamjamiyatidan qarzdorligini tushungan va uni open-source qilishga qaror qilgan (ko'plarimiz uchun ibrat olsa bo'ladigan yurish).
Loyihani ishlatib ko'rdim. Ajoyib, forgedan qolishmaydi. Hamma imkoniyatlari mavjud. Lekin bu proyekt o'zingizni serveringizda o'rnatilgani va open-source bo'lgani uchun biror kamchilik chiqib qolishi mumkin, shu tarafi minus demasa, qolgan hammasi zo'r. Nimadir qo'shimcha qo'shish kerak bo'lsa, o'zingiz shu loyihani kodiga qo'shimcha qilib yozishingiz mumkin, chunki laravelda yozilgan 😊
Postga qistirilgan rasmlarda shu loyihani o'z serverimda o'rnatib, ishlatib, ichidan misollar keltirganman.
🔗Github repozitoriy
#forge #vitodeploy
@todaysobirjonov
Please open Telegram to view this post
VIEW IN TELEGRAM
Please open Telegram to view this post
VIEW IN TELEGRAM
🔥3👍2😍1
Yaxshi tushuntirib berilgan ekan php oop yordamida 0 dan sayt yasash:
https://www.youtube.com/watch?v=MwtEjIpqIKQ
Source code:
https://github.com/somecode-pro/kinopoisk-lite
https://www.youtube.com/watch?v=MwtEjIpqIKQ
Source code:
https://github.com/somecode-pro/kinopoisk-lite
YouTube
Создаем сайт на PHP и ООП. Кинопоиск Lite.
Мой Instagram — https://instagram.com/__protasevich
PHP — из блондинки в PRO: https://areaweb.su/1
Laravel — лучшее, что сделал Тейлор: https://areaweb.su/3
Laravel — создание крутого API: https://areaweb.su/2
Composer для блондинок: https://areaweb.su/5…
PHP — из блондинки в PRO: https://areaweb.su/1
Laravel — лучшее, что сделал Тейлор: https://areaweb.su/3
Laravel — создание крутого API: https://areaweb.su/2
Composer для блондинок: https://areaweb.su/5…
1👍6😍2
Forwarded from UzGeeks Community - 10 yoshda🎉
Assalom alaykum!!!
UzGeeksʼda DevOps kuni!
📌 31-may, shanba kuni TATU binosida "UzGeeks May2025 DevOps Day Meetup" boʻlib oʻtadi.
⭐️Meetupʼda quyidagi spikerlar ishtirok etadi:
🔄 Meetup odatiy ravishda bepul boʻlib, soat 14:00 da boshlanadi, unda qatnashish uchun UzGeeks.uz saytida roʻyxatdan oʻtish kerak.
📍Manzil: Amir Temur ko‘chasi, 108 (Toshkent axborot texnologilari universiteti)
🎙Hamkorlar:
➡️ Oʻzbekiston Respublikasi Raqamli texnologiyalar vazirligi;
➡️ Raqamli ta'limni rivojlantirish markazi;
➡️ Thinkland.
➡️ Toshkent axborot texnologilari universiteti
➡️ Floss O'zbekiston.
Sayt | Guruh | Kanal | Facebook | 💫 Donate
UzGeeksʼda DevOps kuni!
📌 31-may, shanba kuni TATU binosida "UzGeeks May2025 DevOps Day Meetup" boʻlib oʻtadi.
⭐️Meetupʼda quyidagi spikerlar ishtirok etadi:
1️⃣“GitOps Beyond Kubernetes: Applying GitOps to VMs, and more”
- Numon Amirov (Owner @ Subinc);
2️⃣“Lets Nix it.”
- Sokhibjon Orzikulov (Head of OSS @ Uzinfocom);
3️⃣“Katta infrastrukturani boshqarishda monitoringning o'rni.”
- Jahongir Yovmuddinov (Yetakchi mutahassis @ Mobiuz);
🔄 Meetup odatiy ravishda bepul boʻlib, soat 14:00 da boshlanadi, unda qatnashish uchun UzGeeks.uz saytida roʻyxatdan oʻtish kerak.
📍Manzil: Amir Temur ko‘chasi, 108 (Toshkent axborot texnologilari universiteti)
🎙Hamkorlar:
➡️ Oʻzbekiston Respublikasi Raqamli texnologiyalar vazirligi;
➡️ Raqamli ta'limni rivojlantirish markazi;
➡️ Thinkland.
➡️ Toshkent axborot texnologilari universiteti
➡️ Floss O'zbekiston.
Sayt | Guruh | Kanal | Facebook | 💫 Donate
😍1
Forwarded from UzGeeks Community - 10 yoshda🎉
Assalom alaykum!!!
UzGeeksʼda PHP kuni!
📌 28-iyun, shanba kuni Toshkent shahri Raqamli texnologiyalar vazirligi binosida "UzGeeks June2025 PHP Day Meetup" boʻlib oʻtadi.
⭐️MeetUpʼda quyidagi spikerlar ishtirok etadi:
🔄 Meetup odatiy ravishda bepul boʻlib, soat 14:00 da boshlanadi, unda qatnashish uchun UzGeeks.uz saytida roʻyxatdan oʻtish kerak.
📍Manzil: Toshkent shahar, Mirzo Ulugʻbek tumani, Muminov koʻchasi, 4A (Raqamli texnologiyalar vazirligi binosida)
🎙Hamkorlar:
➡️Oʻzbekiston Respublikasi Raqamli texnologiyalar vazirligi;
➡️Raqamli ta'limni rivojlantirish markazi;
➡️Thinkland.
Sayt | Guruh | Kanal | Facebook | 💫 Donate
UzGeeksʼda PHP kuni!
📌 28-iyun, shanba kuni Toshkent shahri Raqamli texnologiyalar vazirligi binosida "UzGeeks June2025 PHP Day Meetup" boʻlib oʻtadi.
⭐️MeetUpʼda quyidagi spikerlar ishtirok etadi:
1️⃣“PHPda pul bilan ishlash” - Azizbek Ochilov (Software engineer @ Yandex);
2️⃣“Yii2 Queue” - Ismoil Salikhov (Co-Founder @ CTO);
3️⃣“Ratchet - PHP orqali real-time ilovalar” - Olimjon G'ofurov (Software engineer @ NEW LINE SOLUTIONS);
🔄 Meetup odatiy ravishda bepul boʻlib, soat 14:00 da boshlanadi, unda qatnashish uchun UzGeeks.uz saytida roʻyxatdan oʻtish kerak.
📍Manzil: Toshkent shahar, Mirzo Ulugʻbek tumani, Muminov koʻchasi, 4A (Raqamli texnologiyalar vazirligi binosida)
🎙Hamkorlar:
➡️Oʻzbekiston Respublikasi Raqamli texnologiyalar vazirligi;
➡️Raqamli ta'limni rivojlantirish markazi;
➡️Thinkland.
Sayt | Guruh | Kanal | Facebook | 💫 Donate
👍3😍2
Laravelda morph relationni type boyicha enumga cast qilgan holatda
whereRelation, whereHas orqali filter qilishda chiqadigan muammo uchun yechim:
AppServiceProviderga ushbu macro qoshiladi
Relationda shu macro function uchun bizda muammo berayotgan enumca cast qilingan columnlar qayta cast qilinadI:
whereRelation, whereHas orqali filter qilishda chiqadigan muammo uchun yechim:
AppServiceProviderga ushbu macro qoshiladi
Relation::macro('withoutEnumCasting', function ($casts) {
if ($this instanceof MorphTo) {
$this->getQuery()->getModel()->mergeCasts($casts);
}
return $this;
});
Relationda shu macro function uchun bizda muammo berayotgan enumca cast qilingan columnlar qayta cast qilinadI:
public function order(): MorphTo
{
return $this->morphTo(__FUNCTION__, 'order_type', 'order_id')
->withoutEnumCasting([
'order_type' => 'string'
])
->withTrashed();
}
😍3
Stop writing with() and whereHas() separately!
Laravel's withWhereHas() does both in one line:
✅ Filters relationships
✅ Eager loads filtered data
✅ Reduces code duplication
Perfect for when you need to filter records based on their relationships while loading the related data.
One method, cleaner code!
Source: linkedin
Laravel's withWhereHas() does both in one line:
✅ Filters relationships
✅ Eager loads filtered data
✅ Reduces code duplication
Perfect for when you need to filter records based on their relationships while loading the related data.
One method, cleaner code!
Source: linkedin
🔥7🤩1🌚1😐1
development.php
852 B
Laravelda bir nechta serverlar bilan ishlaganda envlarni avto tanlash uchun kod (local development uchun).
Ushbu kod app/bootstrap papkaga tashlanadi va gitignorega joylanadi (shunda faqat local development uchun ishlaydi)
bootstrap/app.php faylda appdan instance olingan joyidan keyin ushbu kod require qilib qoyiladi:
Va ushbu kod sizga console yoki httpdan kelgan zaprosga qarab env load qilib beradi.
Masalan zapros test.example.test domaindan kelsa .env.test faylni load qiladi, dev.example.test dan kelsa .env.dev ni load qiladi
Consoleda ham shunaqa
php artisan dev command - .env.dev load boladi
php artisan test command - .env.test load boladi
P.s: kod herdga moslandi boshqa applarda ham moslasa boladi domainnni togirlab
Ushbu kod app/bootstrap papkaga tashlanadi va gitignorega joylanadi (shunda faqat local development uchun ishlaydi)
bootstrap/app.php faylda appdan instance olingan joyidan keyin ushbu kod require qilib qoyiladi:
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
if(file_exists(__DIR__ . '/development.php')) {
require __DIR__ . '/development.php';
}
Va ushbu kod sizga console yoki httpdan kelgan zaprosga qarab env load qilib beradi.
Masalan zapros test.example.test domaindan kelsa .env.test faylni load qiladi, dev.example.test dan kelsa .env.dev ni load qiladi
Consoleda ham shunaqa
php artisan dev command - .env.dev load boladi
php artisan test command - .env.test load boladi
P.s: kod herdga moslandi boshqa applarda ham moslasa boladi domainnni togirlab
👍5🔥3
🔥 PHP 8.5 just shipped and the pipe operator |> changes how you write Laravel code forever.
Before PHP 8.5, chaining operations looked like this:
$result = strtoupper(trim(str_replace('-', ' ', $slug)));
With the new pipe operator in PHP 8.5:
$result = $slug
|> trim(...)
|> (fn($s) => str_replace('-', ' ', $s))
|> strtoupper(...);
Clean. Readable. Left-to-right execution — exactly how your brain reads it.
Other PHP 8.5 wins worth knowing:
✅ array_first() and array_last() — finally native
✅ #[\NoDiscard] attribute — catches silent bugs at runtime
✅ Built-in URI/URL extension — no more manual string parsing
✅ OPcache now always compiled in by default
✅ clone with property overrides — immutable workflows just got clean
PHP is not dying. PHP is evolving — and 8.5 is proof.
Are you still on 8.2 or lower? Time to plan that upgrade.
Source: linkedin
Before PHP 8.5, chaining operations looked like this:
$result = strtoupper(trim(str_replace('-', ' ', $slug)));
With the new pipe operator in PHP 8.5:
$result = $slug
|> trim(...)
|> (fn($s) => str_replace('-', ' ', $s))
|> strtoupper(...);
Clean. Readable. Left-to-right execution — exactly how your brain reads it.
Other PHP 8.5 wins worth knowing:
✅ array_first() and array_last() — finally native
✅ #[\NoDiscard] attribute — catches silent bugs at runtime
✅ Built-in URI/URL extension — no more manual string parsing
✅ OPcache now always compiled in by default
✅ clone with property overrides — immutable workflows just got clean
PHP is not dying. PHP is evolving — and 8.5 is proof.
Are you still on 8.2 or lower? Time to plan that upgrade.
Source: linkedin
1🔥1