Password Reset in Lumen 5.3 - laravel-5.3

I'm trying to create a PasswordReset API in Lumen 5.3.
I've the same setup from a default Laravel 5.3 app.
$app->post('/password/email', 'PasswordController#postEmail');
$app->post('/password/reset/{token}', 'PasswordController#postReset');
and in the user Model I've overridden the method as follows:
public function sendPasswordResetNotification($token)
{
$this->notify(new ResetPasswordNotification($token));
}
I've manually pulled in the Notification package for Lumen 5.3
But, I'm getting the following error:
BindingResolutionException in Container.php line 763:
Target [Illuminate\Contracts\Mail\Mailer] is not instantiable while building [Illuminate\Notifications\Channels\MailChannel].
What am I missing here?

Add the following line in your bootstrap/app.php
$app->alias('mailer', \Illuminate\Contracts\Mail\Mailer::class);

Related

"Deprecated" error migrating blog from blogger to wordpress

I've migrated my old blog from Blogger to Wordpress. It's worked but I've received the following error:
"Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP; Blogger_Importer has a deprecated constructor in /home/melsiepa/public_html/wp-content/plugins/blogger-importer/blogger-importer.php on line 44"
I'm new to web so I have NO CLUE what to do / change!
This is line 44: class Blogger_Importer extends WP_Importer {
Here is the code in context:
/**
* Blogger Importer class for managing the import process of a XML
file
*
*/
if ( !class_exists( 'Blogger_Importer' ) ) {
class Blogger_Importer extends WP_Importer {
const IMPORT_IMG = true; // Should we import the images (boolean)
const LARGE_IMAGE_SIZE = '1024'; //
Please help!!
In this case you should not change anything(code-wise), the warning that you have received is informing you that the coding of that certain file is using coding for a lower php version. To not see it I would suggest to try lowering the php version that your Wordpress site is currently using and once you are done using the 'blogger-importer' plugin to disable it and change the php version to a higher one.
Would suggest to try lowering to 5.6 then to 5.4 or even 5.2 if you still see the warning*
If you encounter any issues performing the necessary steps write back and we will try to assist you.

Hot to get UserInfo in DNN7 - GetCurrentUserInfo is deprecated

I have been using GetCurrentUserInfo up until now but my company is moving to DNN 7.3 and some of our modules use this method to get the userInfo for the current user.
Dim userInfo As DotNetNuke.Entities.Users.UserInfo = DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()
When building for DNN 7.3 we are now getting a warning:
Warning BC40000 'Public Shared Overloads Function GetCurrentUserInfo() As UserInfo' is obsolete: 'Deprecated in DNN 7.3. Replaced by UserController.Instance.GetCurrentUserInfo()'.
What is the correct current way to get the same UserInfo? I have tried following the warning's advice but I still get the same warning : "GetCurrentUserInfo() As UserInfo' is obsolete..."
Change all entries from
DotNetNuke.Entities.Users.UserController.GetCurrentUserInfo()
to
DotNetNuke.Entities.Users.UserController.Instance.GetCurrentUserInfo()

Change default flash messages in Sonata admin

I need to change default success message when we get after creating an item into my own success message. After few digging I found out how to create new flash messages but change existing messages is still a mystery to me.
This is my config.yml file
#app/config/config.yml
sonata_core:
flashmessage:
success:
types:
- { type: mytodo_success, domain: AdminBundle}
Admin class,
public function postPersist($object) {
$this->getRequest()->getSession()->getFlashBag()->add("mytodo_success", "My To-Do custom success message");
}
It would be great if someone can help me on this. I need to change default success message witch gives 'flash_create_success' to my own message.
You can create your own "translation" file .. and put it in your local resources... here's the original
https://github.com/sonata-project/SonataAdminBundle/blob/master/Resources/translations/SonataAdminBundle.en.xliff
the success message lives there ... just change the English "translation" to whatever you need... if you are using <= symfony 2.8 you can put the file in
app/Resources/SonataAdminBundle/translations/SonataAdminBundle.en.xliff
after clearing your cache.. you should be able to see new message without doing anything more...

Breeze and the EdmBuilder for OData v4

I was able to create an OData (v3) service with WebApiOdata and EntityFramework at server side and Breeze at client side thanks to this document.
Now I'd like to do the same with the version 4 of OData spec. but there is a problem. The EdmBuilder class provided by Breeze depends on the 'Microsoft.Data.Edm' which is related to the version 3.
In the EdmBuilder these 2 lines prevent the project from building:
using Microsoft.Data.Edm.Csdl;
using Microsoft.Data.Edm.Validation;
which is normal, because my project has a reference to 'Microsoft.OData.Edm'(for v4) instead of 'Microsoft.Data.Edm'(for v3).
So I replaced the 2 using statements, by this:
using Microsoft.OData.Edm;
using Microsoft.OData.Edm.Csdl;
using Microsoft.OData.Edm.Validation;
Now the project can build, but at runtime it throws this exception
"Encountered the following errors when parsing the EDMX document:
UnexpectedXmlElement : The element 'Edmx' was unexpected for the root
element. The root element should be Edmx. : (1, 40)"
from the EdmBuilder class at this point:
using (var reader = XmlReader.Create(stream))
{
return EdmxReader.Parse(reader);
}
Is there any way to solve this problem ??? like a new EdmBuilder class that I can download somewhere?
P.S.: I'm using code first migration and this code to configure OData route in the 'WebApiConfig' :
config.MapODataServiceRoute(
routeName: "ODataRoute",
routePrefix: "OData",
model: EdmBuilder.GetEdm<MyDbContext>(),
batchHandler: new DefaultODataBatchHandler(GlobalConfiguration.DefaultServer));
We are currently working on a breeze release that works with OData v 4.0. I will post back here when it is released, which should be in the fairly near future.

Set default style in Java 8

In JavaFX 8 application I'm using setUserAgentStylesheet(STYLESHEET_CASPIAN); to set the default skin style. But in Netbeans I get error:
cannot find symbol
symbol: variable STYLESHEET_CASPIAN
location: class MainApp
----
(Alt-Enter shows hints)
In order to remove the warning in Netbeans I tried tried this:
String STYLESHEET_CASPIAN = null;
setUserAgentStylesheet(STYLESHEET_CASPIAN);
But it's not correct. How I can remove the warning message?
STYLESHEET_CASPIAN was introduced in FX8 (jdk8). If you intent to use FX2.x you don't need to change user agent stylesheet (caspian is only and default).
If your project compiles, but NB shows warning it's NetBeans issue. Most probably you had FX2.x in you project previously and NB remembered it. Try to change platform in project options back and forth to reset NB cache.

Resources