Giter Club home page Giter Club logo

Comments (7)

nmfirdausw avatar nmfirdausw commented on May 14, 2024 1

Awesome!! Thanks @nunomaduro

from folio.

njames avatar njames commented on May 14, 2024

I was just coming to suggest this idea.

After watching the launch on YouTube and seeing that folio could be used along side normal routing, I was wondering if the folio routing could be restricted to a domain or subdomain just like the OP is asking.

eg. I have my SuperGreatSaaS at SGSS.com which is a normal Laravel 10 app and I want docs.SGSS.com to be routed by folio.

Is there a setting that I could use to map the subdomain to folio and the rest of the site to the normal routing?

I think this is what @nmfirdausw is asking. (It is certainly what I am asking)

from folio.

nmfirdausw avatar nmfirdausw commented on May 14, 2024

@njames
Right now I'm just used it like this,
last if is for generating folio with artisan command and view folio:list

        if (str_starts_with(url(''), 'http://admin.')) {
            Folio::route(resource_path('views/pages/admin'), middleware: [
                '*' => [
                    'subdomain.admin',
                ],
            ]);
        }

        if (str_starts_with(url(''), 'http://partner.')) {
            Folio::route(resource_path('views/pages/partner'), middleware: [
                '*' => [
                    'subdomain.partner',
                ],
            ]);
        }

        if (config('app.env') === 'local' && url('') === config('app.url')) {
            Folio::route(resource_path('views/pages'), middleware: [
                '*' => [
                    //
                ],
            ]);
        }

from folio.

nmfirdausw avatar nmfirdausw commented on May 14, 2024

@nunomaduro

I did test #62 feat/domains branch, It seems not working like I expected,
Or maybe I'm not use that properly, hope you can guide through,
My Issue is,

I add this two line in FolioServiceProvider,

    public function boot(): void
    {
        Folio::path(resource_path('views/pages/admin'))->domain('admin.mydomain.test');
        Folio::path(resource_path('views/pages/partner'))->domain('partner.mydomain.test');
    }

When I access to admin.mydomain.test/login, It return 404,
But for partner.mydomain.test/login, It Success

It seems only second config is registered.

from folio.

nunomaduro avatar nunomaduro commented on May 14, 2024

That's a different issue - that already existed on Folio@beta2. Can you create a new issue please?

from folio.

nunomaduro avatar nunomaduro commented on May 14, 2024

@nmfirdausw This will address your issue: #67.

from folio.

nmfirdausw avatar nmfirdausw commented on May 14, 2024

Thanks @nunomaduro Now Folio is perfect for me.

from folio.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.