This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.
maxDubovsky
I need to perform some actions on model's afterFetch method, but only in FrontEnd as in BackEnd these actions are useless. What is the common way how to check what enviroment I'm on ?
maxDubovsky
Maybe , I did not checked yet , but here is what I find if (App::runningInBackend()) { return; }
paulgrafx
Works perfectly thanks for your help maxDubovsky :)
use App;
public function afterFetch() {
if (!App::runningInBackground()) {
// Output Frontend
}
else {
// Output Backend
}
}
Last updated
1-5 of 5