Comments (5)
Hi @anderson-flores,
I've just spent a bit of time looking into this.
It seems like classes used in service providers don't reload changes properly on re()
.
I'm guessing this has something to do with class autoloading and where these classes are first defined in an application's running order relative to Tinx's reload functionality… but I'm not sure.
For example, if your ObserverProvider
has use
statements referencing your model and observer classes, they probably won't reload class changes on re()
. But if you pulled those classes out of that provider and instead called App\[Model]::observe(App\Observers\[Model]Observer::class)
from somewhere else in your application (outside of the server provider stack), your changes will probably reload correctly on re()
.
I'm not sure how to fix the issue, but am documenting my findings here in case it prompts any ideas or suggestions from any other users.
Cheers.
from tinx.
Are you on version 2.1.6? Where is your observer class located and is it autoloaded? I have noted the following in my current application:
- changes in User.php are reloaded with re()
- changes in app\Helpers.php are NOT reloaded with re()
Even though my Helper class is autoloaded
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
},
"files": [
"app/Helpers.php"
]
},
Feels like it might be the same error we are experiencing? Can you confirm by adding a static to User.php and modify it between re()-calls?
public static function sayHi()
{
return "change_number_123";
}
from tinx.
Yes, I'm in version 2.1.6.
I tested what you asked for and it worked with re();
My observer is in App/Observers it is called by ObserverProvider, this provider is in the default App/Providers folder and it is registered in config/app.php along with the other providers.
from tinx.
I have this problem with my [email protected].
After I updated php version to 7.2,
re()
is working now
from tinx.
from tinx.
Related Issues (20)
- Contact details HOT 1
- Tinx does not remember command history HOT 4
- Reload does not reload files HOT 4
- Cursor Navigation in prompt HOT 1
- Shortcut gets 'undefined variable in Psy Shell' HOT 2
- PDO::prepare(): send of 40 bytes failed with errno=32 Broken pipe HOT 1
- re() doesn't reload changes in models located at app folder HOT 3
- Permission Denied HOT 9
- Lumen 5.3 "Class Illuminate\Foundation\Bootstrap\LoadConfiguration does not exist" HOT 1
- Running php artisan tinx prints the banner and exits. HOT 1
- re() doesn't reload route changes HOT 1
- Is it safe to use Tinx in production environments? HOT 2
- Flare config is not loaded HOT 5
- Conflict with Facade/Ignition HOT 1
- Method get does not exist HOT 2
- Class 'Arr' not found on start up HOT 2
- Faker not being loaded. HOT 1
- Support use of Thinker V2.0.0 HOT 1
- Call to undefined function Ajthinking/Tinx/Console/str_plural() HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinx.