ash-jc-allen / short-url

A Laravel package for creating shortened URLs for your web apps.
MIT License
1.27k stars 162 forks source link

DataBase Connectivity #126

Closed ankitjain091997 closed 2 years ago

ankitjain091997 commented 2 years ago

i want to set database name for migration file but i don't see any option for set database name.so i tried like this

i changed file config/short-url.php like this :

/* -------------------------------------------------------------------------- Connection
Here you may configure the connection information for each server that
is used by your application. A default configuration has been added
for each back-end shipped with Laravel. You are free to add more.
 */
'connection' => env('SHORT_URL_CONNECTION', null),

/*

and also changes - vendor/AshAllenDesign\ShortURL\Models\ShortURL.php AND vendor/AshAllenDesign\ShortURL\Models\ShortURLVisit.php

i added this line in both file

<?php class ShortURL extends Model {

protected $connected;

public function construct() { parent::construct(...func_get_args()); $this->connection = config('short-url.connection'); } }

?>

ash-jc-allen commented 2 years ago

Hey! If you make a PR for this, I'd be willing to review it. I'm not sure how often other developers need to use different database connections, but if it's something that a lot of people need to do, I'd be willing to consider merging it 😄

ankitjain091997 commented 2 years ago

yes, I did create PR and that is title "Database connectivity" , so please see my PR