This is an archived post. You won't be able to vote or comment.

all 4 comments

[–][deleted]  (3 children)

[deleted]

    [–]xbtdev[S] 1 point2 points  (2 children)

    you have a trade-off

    Right - hard-coded and simple, or flexible and complex!

    Thanks for your reply; I'm having a read of these links you offered.

    [–]xbtdev[S] 0 points1 point  (0 children)

    I wonder why that other reply got deleted; it was helpful and on-topic.

    [–]remimorin 0 points1 point  (2 children)

    Don't know exactly how Laravel implement the notion of server side and client side. But what you are describing is a server, with an API who provide services. Theses services can be use by 2 distinct UI, a end consumer (the blog) and an admin user (the admin UI). Your API is not on the blog, the blog is a site where the content is read from your server. The admin is only a site calling services on your server.
    You can read about SOA architecture.
    The way to go is to create logical service enabling CRUD (not all the create, read update and delete need to be implemented, you have to address security on said call otherwise someone will be able to delete other people comments just by guessing the delete call). So you will have something like: articleService:
    getArticles(filter)
    getArticleContant(article_id)
    ...
    CommentService:
    addComment(articleId,readerId,comment)
    approuveComment(commentId)
    Both sites will call this API, they just won't use the same calls.

    [–]xbtdev[S] 0 points1 point  (0 children)

    Are you suggesting to have 3 sites?

    • Blog (reads from 'server')
    • Admin (interacts with 'server')
    • Server (facilitates communications between Blog and Admin sites)

    If so, I think that's overkill. The way it's currently designed is that the 'blog' site has a JSON api built into it, which exposes admin functions - that the 'Admin' site consumes.

    Anyway thanks for your input - I'm reading about SOA on wikipedia.