GithubHelp home page GithubHelp logo

lucidarch / demo-workflow Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 1.0 223 KB

Contains the code based on the recommended Lucid workflow in steps as per the docs: https://lucid-architecture.gitbook.io/docs/workflow

Home Page: https://lucid-architecture.gitbook.io/docs

License: MIT License

PHP 94.90% JavaScript 1.31% Vue 0.49% HTML 3.29%
laravel lucid lucid-architecture php productivity software-architecture-and-design testing workflow

demo-workflow's People

Contributors

dependabot[bot] avatar mulkave avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

Forkers

m4tlch

demo-workflow's Issues

[Question] Feature consumed by both API and Web

Hello,
Thank you for this well explained demo of Lucid.

I have a question regarding RespondWithJsonJob and RespondWithViewJob.

If my feature should serve both API and Web Controllers. They have exactly the same logic except for the last line which returns either JSON or a view.

What is your recommended solution here?

I am thinking about creating a Middleware where I inject into the Request object a value (e.g. source [WEB, API]) which determines whether the request is an API or Web.
And then inside the feature, I have two options:

  1. Create an Operation e.g. RespondOperation, that takes the source variable, and based on that, it will run either RespondWithJsonJob or RespondWithViewJob.
  2. Add if; else inside the feature to determine which response job based on the source.

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.