title: Play 2.5 Dependency Injection for play-slick Database Configuration
body: <p>I am trying to use <code>play-slick</code> plugin to interact with a <code>mySQL</code> database. Everything works as expected other than a <code>[warn]</code> I get everytime I compile the code.   </p>
  
  <p>On this line: <code>val dbConfig = DatabaseConfigProvider.get[JdbcProfile](Play.current)</code></p>
  
  <p>The warning is: <code>method current in object Play is deprecated: This is a static reference to application, use DI instead</code>. </p>
  
  <p>I have tried adding the inject() method with by defining Configuration using dependency injection but it's not working! How do I use the <code>Dependency Injection</code> in the following code so that I don't have to use <code>Play.current</code> which has bee deprecated since <code>Play 2.5</code></p>
  
  <pre><code>import play.api.Play
  import play.api.db.slick.DatabaseConfigProvider
  import scala.concurrent.Future
  import slick.driver.JdbcProfile
  import slick.driver.MySQLDriver.api._
  import scala.concurrent.ExecutionContext.Implicits.global
  
  
  case class User(
      id: Long, 
      firstName: String, 
      lastName: String, 
      mobile: Long, 
      email: String
  )
  
  class UserTableDef(tag: Tag) extends Table[User](tag, "users") {
  
    def id = column[Long]("id", O.PrimaryKey,O.AutoInc)
    def firstName = column[String]("first_name")
    def lastName = column[String]("last_name")
    def mobile = column[Long]("mobile")
    def email = column[String]("email")
  
    override def * =
      (id, firstName, lastName, mobile, email) &lt;&gt;(User.tupled, User.unapply)
  }
  
  object Users {
  
    val dbConfig = DatabaseConfigProvider.get[JdbcProfile](Play.current) //&lt;-- PROBLEM
  
    val users = TableQuery[UserTableDef]
  
    def get(id: Long): Future[Option[User]] = {
      dbConfig.db.run(users.filter(_.id === id).result.headOption)
    }
  
  }
  </code></pre>