LogicCube

u/LogicCube


r/laravel•

I recently setup Laravel Echo and Broadcasting, first with pusher and then switched it to laravel-websockets. It is working very well and I can join channels, show online status, broadcadt messages from the backend etc. The only "problem" i have is that when a user reloads a page or changes a route, the user will be shown offline for a second or two because the connection is closed (leave) and then reconnected upon page load. It's not a big deal, but in the past I used a combination of socket.io (client) and nodejs/socket io and there was an option to enforce the usage of a single socket and it had the option to delay the leave/reconnect so there was no short "online/offline/online".

So m

01

r/reactjs•

Hey, I am in the process of learning React and working on a rebuild of a webapp with React. It is a simple webapp that calls an Api to get the data to be displayed. I do this via Axios and it works as required.

However, I have a question on how to differentiate between the components that use the fetched data. Here is an example scenario to work with:

In one of the sections of the app I have a "view" of a task. The view has multiple components like the general info, a box for uploads, comments, time entries and so on.

My question is: should separate components fetch the needed data in separate calls to the Api or should the "main" (e.g. wrapper) component fetch all needed data in one sho

54

r/webdev•

Hey, I'm in the process of a draft for a webapp where certain fields shall be saved encrypted into a MySQL database. The webapp is PHP (CakePHP 3.6) and for the sake of this post, I will outline the process and the (possible) requirements and I would like to know what the best practices are for this use case.

Scenario: We have a backend with user accounts, each user can create a certain "widget" which then can be hooked into any webpage via a script-tag. The user-account has only email/password as login for now.

On the widget (think of it as a public frontend), people can enter some information which will be saved into the database, where a relational connection to the user-account will

011

r/reactjs•

Hey, first of all, sorry if my question sounds dumb, I have little experience with react.

I'm a fullstack web-dev and I build webapps with laravel, cakephp etc so I mostly have template engines that combine php from the controllers and render the html alongside. This is fine and serves all needed data in one shot. On top of that, I develop widgets like user-selection modals, file explorer like widgets, activity-feeds etc in JS (mostly vanilla, sometimes with the help of jQuery).

As certain apps got bigger and the JS functions to manage the dynamic parts of the UI grew, I now see that I need to have some structure for this "layer" of my app. Currently the code is scattered in several file

23

r/docker•

Hey guys, I'm new to docker but I could get all things to run that I needed. Now I come across a bit of a problem with my actual php-webapp.

Scenario: A compose file with service nginx, and a service php-fpm. It's all working fine, I can scale the php-fpm containers and the webcode (cakephp) is working just fine. But currently I link in my webapp-code via host volume to a path /code into nginx service AND also into the php-fpm containers. If I remove the volume link from any service it will fail with either 404 not found (nginx) or file not (php-fpm).

So my problem in one line: when I build my images for production, I don't want to copy my code in both images. Which of the services should

36

You've reached the end of this feed.