921 questions
0
votes
1
answer
104
views
Laravel Observer With Octane: slug is generated in creating event, but not saved in DB
I'm using a creating Eloquent model observer to automatically generate a slug before inserting a new product into the database.
Here’s the code from my ProductObserver:
public function creating(...
1
vote
1
answer
72
views
Model Observer issue in nested transaction update of model
class ExampleUserService
{
public function approve($user, $data)
{
$approvedUser = DB::transaction(function () use ($user, $data) {
if ($data['approve_by_admin'] == 1) {
...
1
vote
0
answers
106
views
Catching reload events to show custom modal
Sorry for the lengthy post but this needs some context.
Context
I'm building an app for academic papers publishing. The stack is Laravel + vanilla JS and I use Etherpad to edit the papers. It is ...
0
votes
0
answers
71
views
Laravel observer
This is my observer class (Laravel 11) to create logs actions
namespace App\Observers;
use App\Models\Log as LogModel;
use Illuminate\Support\Facades\Auth;
class UserActionObserver
{
public function ...
0
votes
0
answers
111
views
Windows Task Scheduler: run .py script without window opening
I have been asked to run a python script from the Windows Task Scheduler.
In my python script I will substantially use watchdog library in order to instanciate and run an Observer that will monitor ...
0
votes
0
answers
148
views
Issue in observing multiple divs with singleton ResizeObserver instance
I was working on a problem where I have 20 divs(div-0, div-1, etc.) and a ResizeObserver on the application level. Using a single instance of this ResizeObserver, I am observing on all the 20 divs. ...
1
vote
1
answer
707
views
How to debug Laravel eloquent event listeners
I'm using Laravel and something is modifying a property before it's saved to the database.
In Database/Eloquent/Model.php I can modify the save() method like so:
dd($this->my_property);
if ($this-&...
0
votes
1
answer
278
views
Showing the product in category and search with Magento 2 Observer
I have defined an attribute in Magento 2. When I say Dont Show in Category in this attribute, I do not want the product to be shown in Category and Search. But I don't want to completely remove the ...
0
votes
0
answers
554
views
NavigatorObserver methods do not get called by Navigator
I'm trying to implement a NavigatorObserver in order to execute a method each time a new entry is pushed/popped on the Navigation stack.
First of all, here is my Observer:
class ...
0
votes
1
answer
55
views
Observe property changes inside the drum rack/chains
Is it possible to monitor property changes of all devices within a drum rack/chains?
Properties such as: samples, chain name, file path, drum pad names...
The problem is that in my case I only get a ...
0
votes
1
answer
86
views
How to watch for a trigger event and apply a condition in R Shiny without using an observer?
In running the below R Shiny code, the user changing the sliderInput() (object input$periods) resets all of the variable user input tables called "X/Y child tables" as shown in the code with ...
0
votes
0
answers
342
views
Laravel 10 Observer attribute not working
I have a ProductPrice Model which I register an observer attribute with ObservedBy on as follows
#[ObservedBy([ProductPriceObserver::class])]
class ProductPrice extends Model
{
use HasFactory, ...
0
votes
0
answers
200
views
iOS - Posting notification called twice
I add an observer in a function which I call on the start. It is only initiated once(I thoroughly checked). On the safer side, I also remove observers before I add observers. below is the function
...
0
votes
0
answers
110
views
Laravel. The observer adds a table to the pivot and immediately deletes the same rows
I have two models User and Role many to many relationship through a pivot table.
User:
public static function boot(): void
{
parent::boot();
self::observe(new UserObserver());
}
public ...
0
votes
1
answer
169
views
How to observe change of API request status in Swift?
I am working on a project and I am sending a GET Request to an API URL in my project. (As follows)
Actually everything here works for me. But the problem is; When I first send the request, the "...
0
votes
1
answer
84
views
Flutter ScrollController AssertionError: '_positions.isNotEmpty': ScrollController not attached to any scroll views when closing route
I'm encountering an error in my Flutter application related to a ScrollController. I have a QuestionDetailsScreen where I'm using a ScrollController to monitor the scroll position. I want to trigger a ...
1
vote
1
answer
115
views
Laravel (5.8) observer deleted is not working
I am using Laravel (5.8) and I need to delete a record from table A and then also table B.
So I tried Observers, but it never fired the observer's deleted method.
I already used other methods like ...
0
votes
1
answer
78
views
LiveData Observer not triggered in Main Activity when data is changed in Fragment
The observer in my MainActivity is not being triggered when the string data is being changed
Here is my
MainActivity:
package com.example.translator
import androidx.appcompat.app.AppCompatActivity
...
1
vote
1
answer
209
views
r shiny how to use lapply with moduleServer that returns a reactive that I want to observe
I'm trying to simplify my code. Rather than copy/pasting similar elements, I want to define a list that describes them and then lapply to get them. I need two/way communication with a global setting.
...
0
votes
0
answers
145
views
Perfect Way Of Making Http Calls In Angular
In the context of the discussion at https://stackoverflow.com/a/35043309/19365092, it is advisable to avoid using the subscribe method for HTTP calls. The reason is that while it is true that ...
0
votes
0
answers
283
views
How to avoid that IntersectionObserver cause a flickering behavior
I am adding a sticky nav in my website using IntersectionObserver, when the isIntersecting has passed from true to false, the website and nav starts flickering, in the background. The isIntersecting ...
3
votes
0
answers
77
views
How to arrange the flow of reactive values in R Shiny in a manner that avoids circular dependencies?
The R Shiny code posted at the bottom allows the user to add columns to a rhandsontable table, allows manual inputs into the first row of the table, and automatically populates the non-editable second ...
1
vote
0
answers
83
views
Realm observe notifications - time sensitive
I need to observe for realm objects that fall into specific time range, and cannot figure out if it is possible to create a dynamic date as a predicate for the query.
For example, I want to observe ...
1
vote
0
answers
141
views
How to find objects which are accessing a map
Context
I am writing a dashboard builder application. Users create visualizations in the dashboard which access variables defined in the dashboard to generate queries.
Here is an example.
Dashboard:
...
0
votes
0
answers
88
views
Is it possible to have LIVEDATA observer that trigger only when specific columns changes?
Thanks in advance for any advice. I have a query from a roomdatabase, only some columns are exposed by the interface to the user (~ 3 out of 7). The query does not include favorite columns.
So, there ...
1
vote
0
answers
54
views
Create observer (LiveData or Flow) without having (Lifecycle Owner and UI)
I have the following code for simple room and Dao function.
I am trying to create observer to observe Customers entity table.
I do not have a lifecycle or UI so how to create the observer?
data class ...
0
votes
1
answer
529
views
Android -How to Remove ViewTreeObserver GlobalLayoutListener with .removeOnGlobalFocusChangeListener
How do I remove a viewTreeObserver? There are 3 different removeOnGlobalFocusChangeListener callbacks
class MyFragment: Fragment() {
override fun onViewCreated(view: View, savedInstanceState: ...
1
vote
1
answer
585
views
Laravel observer in pivot table not triggering
I created a observer for my pivot table CreatorListing and I dont know why it wont trigger the created event. I even tried others like creating, saving, and saved but they wont go through.
Here is in ...
1
vote
0
answers
28
views
In Angular is there a way to add values to an object after querying it?
I have a class Message, that contains an array of Addresses. Opening the page immediately querys all the pending messages. I need the Adresses to be queryed once the user opens the tab inside the ...
1
vote
1
answer
49
views
Equivalent observers in Shiny apps but different behaviors
The difference between the two Shiny apps is that the first one includes
observeEvent(
input$alert,
{
flag(TRUE)
}
)
while this code is replaced with the following code in the ...
0
votes
1
answer
52
views
RecyclerView only shows the items when the screen is "refreshed"
I'm doing an APP and I have to show the itens from contacts in a RecyclerView.
But, when I enter in the APP the items don't show. But, if I go to another Fragment then back the RecyclerView is working ...
0
votes
1
answer
409
views
How to use an Observer() function instead of a loop
I am requesting help as no matter how many tutorials I watch, I cannot seem to figure out how use the Observer() function to get it to replace a link with another only if that link appears.
Am I ...
0
votes
1
answer
709
views
Angular14: variable assigned inside subscribe is empty outside subscribe.. why? And what have i missed?
I have a variable that i have instantiated in the top of my typescript class like this:
UserTimeRegistration: TimeRegistration[];
I have a method calling an api like this:
getUserInfo(UserID: string):...
0
votes
1
answer
643
views
Angular 15 create observable function referencing local variables
The observable function is NOT http; the function must be local, but it needs to be subscribed. This is the best I could do based on online example:
export class AppComponent implements OnInit {
...
1
vote
1
answer
2k
views
Flutter GoRouter Dynamically Change PageTransition Type with NavigatorObserver
I would like to dynamically change the transition used to navigate between pages.
To do so I created an enum that gives two different transition names TransitionType.fade and TransitionType.slide for ...
0
votes
1
answer
1k
views
Use intersection observer in react
I need to change elementA when elementB is out from viewport. I have html elements
<header id="header">
<div id="banner">
and js:
const banner = document....
1
vote
1
answer
1k
views
Laravel mute Observer event in chaining relationship create method
I have a question on how to mute the observer's method based on the parameters I pass. I have a parameter of link_social and if it is set to false I wanted the observer to not trigger the created() ...
0
votes
1
answer
2k
views
Autoplay blocking on Safari
I have this snippet of code that starts the video as soon as the video enters the screen. the problem is that it doesn't work on safari, leaving the video completely black and giving me this error: &...
0
votes
0
answers
104
views
Ember Observers getting broken
We have a complex app and we do write test cases for testing.
While writing an acceptance test case for my changes, I have encountered one issue. The issue was my test case was running perfectly fine ...
0
votes
1
answer
1k
views
"NullInjectorError: No provider for Subscription! Why I get this error in the console?
Here is what I'm doing in a componemt:
import { Component, OnDestroy, OnInit } from '@angular/core';
import { interval, Subscription } from 'rxjs';
@Component({
selector: 'app-home',
templateUrl:...
0
votes
0
answers
508
views
Laravel observer property not being called on update
I am looking into observers and I found out that instead of calling an observer during the boot() method of the App\Providers\EventServiceProvider laravel can call it using the property protected $...
-1
votes
1
answer
403
views
Laravel - Passing a variable from controller to model or accessing a variable in the controller from the model
I want to pass a variable in the controller to the model in laravel.
In Controller,
$withoutUser = True;
$post->update([
'status' => 'inactive'
]);
In model,
protected static function boot(...
0
votes
1
answer
629
views
NotificationCenter is observing multiple times
I'm having a problem in my implementation using observers in Swift, The problem is I'm having the same observer multiple times so I make one function more than once.
How can I validate if I'm ...
1
vote
1
answer
329
views
LiveData observer is not removed
I am trying to get LiveData updates in a ViewModel, and make sure that the observer is not leaking, but it is leaking. The typical problem is that the observer is not stored in a variable, but that is ...
0
votes
0
answers
216
views
What does input[[...]] do in a shiny observe event?
In the below code, I'm trying to understand what the input[[...]] in the two commented observeEvent() functions do. Could someone please explain?
I'm trying to adapt this code so the function of the ...
0
votes
1
answer
61
views
How to consolidate action buttons for individual objects into a single selectInput() in R shiny?
The code posted below allows the user via clicks of action buttons to add/delete individual rhandsontable tables for data input. For deletion each table has its own action button underneath. Any ideas ...
2
votes
1
answer
87
views
How to pass reactive values between observers?
In the code posted at the bottom, I'm trying to cap the value of the second reactive object (y) at the value of the first reactive object (x) using two observeEvents() as action button click counters, ...
2
votes
0
answers
164
views
removeObserver doesn't remove an observer attached to an AVPlayer.currentItem object
Essentially I have a scrolling list of videos (think TikTok). I want each video to play while it's on the screen. The functionality is all there, but when you swipe to the next video, I want to remove ...
0
votes
1
answer
361
views
Using model data in the deleted() function of a Laravel observer
I am currently developing a script to synchronize the data stored in my database with an external API. That is to say that all the records created/deleted must also be created/deleted on the external ...
0
votes
1
answer
65
views
Async function in service file Angular 2
I have built an Angular(14) app where I need to store some data in a DB.
So I have a component with a button, I want to press this button and do stuff in three different components, when they are all ...