Error (syntax) with VSCode when using Laravel to define an new accessor - visual-studio-code

I tried to use new laravel syntax (which is available on laravel 9) to create a new accessor on "Post" model called "createdAtHuman":
enter image description here
I could say that everything works fine but VSCode keep saying that there is something wrong with my code (in fact there is no problem).
I think it's just because of the IDE config but i don't know how to fix. Would really appreciate if there is any idea.
<3

Related

Getting started with a custom function with Excel Add-Ins

I followed this guide: https://learn.microsoft.com/en-us/office/dev/add-ins/quickstarts/excel-custom-functions-quickstart?tabs=excel-windows
So far everything went fine. I can use the =CONTOSO.CLOCK and other example functions.
If I add a function to the functions.ts file, it rebuilds... but I can't use the custom function on the web in any way.
Somehow I'm missing how I can register this function and run it in Excel...
Other question is: How can I change the name of the namespace from CONTOSO in something else?
Regards, Peter
Okay, a valid JSDoc was needed to work. After running a new build it worked out. https://learn.microsoft.com/en-us/office/dev/add-ins/excel/custom-functions-json-autogeneration

Getting error message using EXT:recaptcha and EXT:form in Typo3 8.7.9 in a custom template

im using the new EXT:form extension from Typo3 8. I put it in my own extension folder so i made a custom template for it. This works fine until the point i want to integrate Google recaptcha into it.
I want to use the EXT:recaptcha for this:
https://docs.typo3.org/typo3cms/extensions/recaptcha/Index.html
In the sample EXT:form layout the recaptcha works without problems. But when im switching back to my layout i get the following error message:
Oops, an error occurred! The validator preset identified by
"Recaptcha" could not be found, or the implementationClassName was not
specified.
What i have to do? Anyone has an idea?
I know this question is quite old, you probably found the solution already.
I'm quite sure you did not include the static template. After adding the recaptcha template to my root template the validator was available.

Call to a member function getDateFormat() on null, laravel/passport install

I am getting a
[Symfony\Component\Debug\Exception\FatalThrowableError] Call to a member function getDateFormat() on null
when running "php artisan passport:install" on a laravel/mongodb api project. I have tried changing "use Illuminate\Database\Eloquent\Model;" to "use Jenssegers\Mongodb\Eloquent\Model as Model;" in my user and client.php but it still throws the exception.
any ideas??
I also encountered this problem while developing a same type of project. This occurs because Laravel Passport doesn't support Jenssegres\laravel-mongodb. It uses the Illuminate\Database\Eloquent\Model by default.
Now there are two solutions to this.
You can go on changing every Illuminate\Database\Eloquent\Model to Jenssegres\Mongodb\Eloquent\Model in the Laravel Passport's vendor folder(there are about 6 files you will have to change), but this is not recommended, as when you will try you push this project on the production server, the vendor folder is ignored, and you will have to do all the changes again. Also if they change something and you update it, all the changes will be lost.
Another way of doing this, which I would recommend is, using designmynight/laravel-mongodb-passport package. This package will do the above-stated things and will do it efficiently. Installation is also pretty simple. You can go through the documentation here and you can have it up and running in no time.
Hope this can solve your problem.
Documentation link: https://github.com/designmynight/laravel-mongodb-passport

MagnificPopup won´t work with Typo3

I would like to use magnific popup for a site which is still in development, but unfortunately nothing happens after the installation and adding the static content in my template.
No matter what i try no popup comes up.
If someone would like to help me i will provide access to the site.
Thanks a lot!
First thing to do:
look at your source code: does the 'link' show any sign of 'magnific popup' code?
Added classes? id?
Second: do you see any extra javascript and/or stylesheet that is added by the extension?
If you answer negative to 1 of these, the extension does not output anything. Sounds logic, but it is the first step. Is it a solution? Nope, it means your live just got a bit more worse, but hang in there !
If it does show any code from the ext: look at your console, are there any js errors occurred ? (if you don't know what console is, or (even worse) you work with IE) please read about chrome console of at least install Firefox with firebug.
My best beth would be a JS error...
Can it be possible that the ext itself does not work?
Does your php error logs tell you that the extension is behaving badly?
Do you see errors in the typoscript analyser (or whatever it's called to analyse the css_styled_content and other TS spaghetti )
If not, then no, it is not the ext.
Again, i'm betting my wive, three horses and a barrel of beer on JS erros.
Good luck mate !
ps: IF i'm wrong, i'm not sending you my wife by postal service. Loads of trouble last time. Nor the horses, same shizzle ..

symfony/zend integration - blank screen

I need to use ZendAMF on a symfony project and I'm currently working on integrating the two.
I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function:
// load symfony autoloading first
parent::initialize();
// Integrate Zend Framework
require_once('[MY PATH TO ZEND]\Loader.php');
spl_autoload_register(array('Zend_Loader', 'autoload'));
The executeIndex function my the gateway actions.class.php looks like this
// No Layout
$this->setLayout(false);
// Set MIME Type
$this->getResponse()->setContentType('application/x-amf; charset='.sfConfig::get('sf_charset'));
// Disable cause this is a non-html page
sfConfig::set('sf_web_debug', false);
// Create AMF Server
$server = new Zend_Amf_Server();
$server->setClass('MYCLASS');
echo $server->handle();
return sfView::NONE;
Now when I try to visit the url for the gateway module, or even the other module which was working perfectly fine until this attempt, I only see a blank screen, with not even the symfony dev bar loaded. Oddly enough, my symfony logs are not being updated as well, which suggests that Synfony is not even being 'reached'.
So presumably the error has something to do with Zend, but I have no idea how to figure out what the error could be. One thing I do know for sure is that this is not a file path error, because if I change the path in the following line (a part of frontendConfiguration as shown above), I get a Zend_Amf_Server not found error. So the path must be correct. Also if I comment out this very same line, the second module resumes to normality, and my gateway broadcasts a blank x-amf stream.
spl_autoload_register(array('Zend_Loader', 'autoload'));
Does anyone have any tips on how I could attach this problem?
Thanks
P.S. I'm currently running an older version of Zend, which is why I am using Zend_Loader instead of Zend_autoLoader (I think). But I've tried switching to the new lib, but the error still remains. So it's not a version problem as well.
got it...
I was not using
set_include_path()
while loading Zend. It's still odd that it would give such a cryptic error, but this was the missing piece indeed.