Archive | GNU/Linux

Create and Use Dynamic Laravel Subdomain Routing

Many websites give their users a custom subdomain for their profiles or pages, so instead of accessing the user’s profile at http://website.com/users/50, the user can access his profile page at http://username.website.com which is much better. In this post, we will see how to make dynamic Laravel subdomain routing easily. First you need to configure DNS. For this, You must have access to DNS server settings and apache web server settings. First, you need to add an A record with an asterisk for the subdomain like this:
* IN A 192.168.1.5

Continue Reading →

You should replace the IP address with your IP address.

Configure Web server

Open apache web server configuration file httpd.conf and add a VirtualHost like this:

Let’s assume that we have the users with the name field which will contain the user’s name.

Now we will create our route.

Route::get('/', function () {
$url = parse_url(URL::all());
$domain = explode('.', $url['host']);
$subdomain = $domain[0];
$name = DB::table('users')->where('name', $subdomain)->get();
dd($name);
// write the rest of your code.
});

First, we explode the URL and extract the host from it, then we get the subdomain part.

Then we search for a username in the users table that matches the extracted subdomain.

You can check if no user found, redirect to another page or give him an error message or whatever.

Now if you try to visit any user subdomain like http://likegeeks.website.com, you should see the user’s name without problems.

Keep in mind that the user that you are visiting his subdomain MUST be present in the database.

Any user added to the database will have his subdomain automatically without a headache.

If you don’t have access to your web server configuration like using shared hosting or so, you can’t achieve the same functionality using htaccess redirection.

Multiple Routes in Subdomain

In the above example, we use a single route to deal with the subdomain, but you can use many routes with a subdomain.

You can use routes groups to achieve this:

Route::group(array('domain' => '{subdomain}.website.com'), function () {
Route::get('/', function ($subdomain) {
$name = DB::table('users')->where('name', $subdomain)->get();
dd($name);
});
});

As you see, Laravel subdomain routing is very easy to implement.

I hope you find the post useful. Keep coming back.

Thank you.

0

Lubuntu 18.10 Cosmic Cuttlefish ömrünün sonuna geldi

Kod adı “Cosmic Cuttlefish” olan ve 18 Ekim 2018‘de duyurulan Lubuntu 18.10, ömrünün sonuna geldi. Lubuntu 18.10, 18 Temmuz 2019 tarihi itibariyle ömrünün sonuna ulaşmış oluyor, bu nedenle, bundan böyle güvenlik veya yazılım güncelleştirmeleri alamayacak. Şu an için Lubuntu’nun  desteklenen sürümlerinin LXDE ile 18.04 ve LXQt ile 19.04 olduğu belirtiliyor. Lubuntu 18.10 kullanıcılarının sistemlerini LXDE ile 18.04 ve LXQt ile 19.04 sürümlerine yükseltmesinin önemli olduğu vurgulanıyor.  LXDE ile 18.04 ve LXQt ile 19.04 edinmek için buradan yararlanabilirsiniz. Yükseltme işleminden önce, sisteminizdeki tüm güncellemelerin uyguladığından emin olmanız gerektiği vurgulanıyor. 

Continue Reading →

Lubuntu 18.10 Cosmic Cuttlefish’in ömrünün sonuna geldi ömrünün sonuna geldiğine ilişkin resmi duyuruyu burada bulabilirsiniz.
0

Curitiba’da DebConf19 sona ererken, DebConf20’nin tarihi açıklandı

DebConf19, 27 Temmuz 2019 Cumartesi günü sona erdi. 50’den fazla ülkeden 380’den fazla katılımcıya ev sahipliği yapan DebConf19; 145 etkinlik görüşmesi ve tartışma oturumuyla başarılı bir biçimde sona erdi. Konferans, 14 Temmuz – 19 Temmuz tarihleri arasında gerçekleşen yıllık DebCamp ile gerçekleştirildi. DebConf19’da ayrıca 20 Temmuz’da düzenlenen ve 250’den fazla katılımcının katıldığı Open Day, daha geniş kitlelere sunumlar ve atölye çalışmaları, çeşitli DebConf19 sponsorlarının standlarından oluşan bir iş fuarı ve bir Debian kurulum festivali düzenledi. Asıl Debian Geliştiricileri Konferansı 21 Temmuz 2019 Pazar günü başladı. Gelecek yılki DebConf’un İsrail’in Hayfa kentinde yapılması konusu dışında, Debian 10 buster’ın son sürümüyle ilgili birkaç oturum, yeni projeler, altyapı ve topluluk ekipleri ile birlikte Debian ve özgür yazılım ile ilgili diğer birçok konu görüşüldü.. DebConf19 web sitesi arşiv amaçlı olarak aktif olmayı sürdürecek, sunumlar ve etkinlik sunumları ve videolar yayınlanmaya devam edilecek Gelecek yıl DebConf20, 23 Ağustos – 29 Ağustos 2020 tarihleri ​​arasında İsrail’in Hayfa kentinde düzenlenecek.

Continue Reading →

Debian, başta Platinum Sponsorlar olmak üzere DebConf19’u destekleyecek Infomaniak, Google ve Lenovo gibi çok sayıda sponsorun taahhüdüne teşekkür ediyor. DebConf19 hakkında ayrıntılı bilgiyi debian.org sayfalarında bulabilirsiniz.

0