Darren_Ter

Darren_Ter

Member Since 1 Week Ago

Experience Points
60
Total
Experience

4,940 experience to go until the next level!

In case you were wondering, you earn Laracasts experience when you:

  • Complete a lesson — 100pts
  • Create a forum thread — 50pts
  • Reply to a thread — 10pts
  • Leave a reply that is liked — 50pts
  • Receive a "Best Reply" award — 500pts
Lessons Completed
0
Lessons
Completed
Best Reply Awards
0
Best Reply
Awards
  • start your engines Created with Sketch.

    Start Your Engines

    Earned once you have completed your first Laracasts lesson.

  • first-thousand Created with Sketch.

    First Thousand

    Earned once you have earned your first 1000 experience points.

  • 1-year Created with Sketch.

    One Year Member

    Earned when you have been with Laracasts for 1 year.

  • 2-years Created with Sketch.

    Two Year Member

    Earned when you have been with Laracasts for 2 years.

  • 3-years Created with Sketch.

    Three Year Member

    Earned when you have been with Laracasts for 3 years.

  • 4-years Created with Sketch.

    Four Year Member

    Earned when you have been with Laracasts for 4 years.

  • 5-years Created with Sketch.

    Five Year Member

    Earned when you have been with Laracasts for 5 years.

  • school-in-session Created with Sketch.

    School In Session

    Earned when at least one Laracasts series has been fully completed.

  • welcome-newcomer Created with Sketch.

    Welcome To The Community

    Earned after your first post on the Laracasts forum.

  • full-time-student Created with Sketch.

    Full Time Learner

    Earned once 100 Laracasts lessons have been completed.

  • pay-it-forward Created with Sketch.

    Pay It Forward

    Earned once you receive your first "Best Reply" award on the Laracasts forum.

  • subscriber Created with Sketch.

    Subscriber

    Earned if you are a paying Laracasts subscriber.

  • lifer Created with Sketch.

    Lifer

    Earned if you have a lifetime subscription to Laracasts.

  • evangelist Created with Sketch.

    Laracasts Evangelist

    Earned if you share a link to Laracasts on social media. Please email [email protected] with your username and post URL to be awarded this badge.

  • chatty-cathy Created with Sketch.

    Chatty Cathy

    Earned once you have achieved 500 forum replies.

  • lara-veteran Created with Sketch.

    Laracasts Veteran

    Earned once your experience points passes 100,000.

  • 10k-strong Created with Sketch.

    Ten Thousand Strong

    Earned once your experience points hits 10,000.

  • lara-master Created with Sketch.

    Laracasts Master

    Earned once 1000 Laracasts lessons have been completed.

  • laracasts-tutor Created with Sketch.

    Laracasts Tutor

    Earned once your "Best Reply" award count is 100 or more.

  • laracasts-sensei Created with Sketch.

    Laracasts Sensei

    Earned once your experience points passes 1 million.

  • top-50 Created with Sketch.

    Top 50

    Earned once your experience points ranks in the top 50 of all Laracasts users.

Level 1
60 XP
Mar
26
1 week ago
Activity icon

Awarded Best Reply on Laravel Custom Domain : DNS, Nginx, And Routing

Okay, I solve it by myself already ^_^

  1. Since I am using Cloudflare free plan, to solve the cnamecross-user banned, I have to upgrade my plan to at least Pro plan ( $20 per month ).
  2. My Nginx work already. But it is not a good practice to accept all incoming requests, instead, I should have a whitelist of accepted requests, and a blacklist those suspicious domain names.
  3. Again, my route actually works. Just change the return to dd() and instead of $customDomain, display the custom domain using Request::getHost().
  4. Ya, this is considered multi-tenancy system. But since we are rush of time, we do a simple one, which each user will store their shared data in one database, rather than each user has their dedicated databases.
  5. Seems like after I have upgraded to Pro plan, I need to contact the customer supports for setup. I will update the answer here after this.
Activity icon

Replied to Laravel Custom Domain : DNS, Nginx, And Routing

Okay, I solve it by myself already ^_^

  1. Since I am using Cloudflare free plan, to solve the cnamecross-user banned, I have to upgrade my plan to at least Pro plan ( $20 per month ).
  2. My Nginx work already. But it is not a good practice to accept all incoming requests, instead, I should have a whitelist of accepted requests, and a blacklist those suspicious domain names.
  3. Again, my route actually works. Just change the return to dd() and instead of $customDomain, display the custom domain using Request::getHost().
  4. Ya, this is considered multi-tenancy system. But since we are rush of time, we do a simple one, which each user will store their shared data in one database, rather than each user has their dedicated databases.
  5. Seems like after I have upgraded to Pro plan, I need to contact the customer supports for setup. I will update the answer here after this.
Mar
25
1 week ago
Activity icon

Started a new Conversation Laravel Custom Domain : DNS, Nginx, And Routing

I am currently working for a CRM with domain name ( Exp: abc.com ). Each registered user will be assigned a subdomain ( Exp: 123.abc.com ), for them to design a landing page, and publish their landing page using that subdomain name.

The subdomain is worked well now. But now I want to step one level further, which each user can buy their own domain name ( Exp: apple.com ), and point their domain name to our server, and serve the exact same content as 123.abc.com.

After doing some research online, this is what I have now.

In my web.php :

Route::group(['domain' => '{customDomain}'], function () {
    Route::get('/',function($customDomain){
        return $customDomain;
    });
});

In my RouteServiceProvider :

To allow non-alphanumeric characters in custom domain :

public function boot()
{
    \Route::pattern('domain', '[a-z0-9.\-]+');
    parent::boot();
}

In my Nginx web server ( /etc/nginx/sites-available/abc.com ) :

To accept all incoming requests to my server :

server_name ~.;

That's all is what I done in Laravel.

In user's DNS provider ( Cloudflare ) :

I ask them to point their custom domain name to our website :

CNAME      apple.com       abc.com       DNS only 

Although all the things have been set up, but once the user type apple.com, it shows up this error :

enter image description here

Even the user have change the dns record to point to our server instead :

A      apple.com        123.123.123.123         DNS only

It does successfully show up our website, but my route for custom domain doesn't work. It show up the login page instead of return $customDomain.

Here I have a few questions :

  1. Do I need to ask the user to point to our website using CNAME record? But how to solve the cnamecross-user banned ?
  2. Is it correct to set my Nginx web server to accept all request like this : server_name ~.;
  3. Is there any errors on my custom domain route? I place it at the very top of route list.
  4. Is this feature consider a multi-tenancy system? We do ask a senior before, he said we need to almost rebuild our website for this feature, because it will change the infrastructure of our website. But we don't design to be each user will have their own database, all users will share a database.
  5. Do we need to do anything in cloudflare for such feature? Currently, we have the wildcard dns record ( A * 123.123.123.123 DNS only ) that accepts all requests already.