Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
laravel-adminpanel
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
laravel-adminpanel
Commits
64764f9c
Commit
64764f9c
authored
Oct 29, 2018
by
ruchitVC
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update install app command
parent
fc927c9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
17 deletions
+27
-17
InstallAppCommand.php
app/Console/Commands/InstallAppCommand.php
+27
-17
No files found.
app/Console/Commands/InstallAppCommand.php
View file @
64764f9c
...
@@ -168,13 +168,15 @@ class InstallAppCommand extends Command
...
@@ -168,13 +168,15 @@ class InstallAppCommand extends Command
}
}
}
}
$this
->
createDatabase
(
$this
->
database
);
// create database if not exists.
$this
->
createDatabase
(
$this
->
database
);
// create database if not exists.
$this
->
migrateTables
(
$this
->
database
);
// database migration
if
(
$this
->
confirm
(
'You want to dump database sql ?'
))
{
// if ($this->confirm('You want to dump database sql ?')) { // uncomment the code if you want to go ahead with existing database.
$this
->
dumpDB
(
$this
->
database
);
//
$this->dumpDB($this->database);
}
else
{
//
} else {
$this
->
migrateTables
(
$this
->
database
);
//
$this->migrateTables($this->database);
}
//
}
}
}
/**
/**
...
@@ -261,17 +263,25 @@ class InstallAppCommand extends Command
...
@@ -261,17 +263,25 @@ class InstallAppCommand extends Command
*/
*/
protected
function
migrateTables
(
$database
)
protected
function
migrateTables
(
$database
)
{
{
if
(
$this
->
confirm
(
'You want to migrate tables?'
))
{
DB
::
unprepared
(
'USE `'
.
$database
.
'`'
);
// Switch to use {$this->database}
DB
::
unprepared
(
'USE `'
.
$database
.
'`'
);
Artisan
::
call
(
'migrate'
);
// Artisan migration
//DB::connection()->setDatabaseName($this->database);
$this
->
info
(
'Migration successfully done!'
);
Artisan
::
call
(
'migrate'
);
$this
->
info
(
'Migration successfully done!'
);
Artisan
::
call
(
'db:seed'
);
// Artisan seed
$this
->
info
(
'Seeding successfully done!'
);
if
(
$this
->
confirm
(
'You want to seeding your database?'
))
{
Artisan
::
call
(
'db:seed'
);
// if ($this->confirm('You want to migrate tables?')) { //uncomment the code if you want to populate mandatory question to user for migration and seed.
$this
->
info
(
'Seeding successfully done!'
);
// // Switch to use {$this->database}
}
// DB::unprepared('USE `'.$database.'`');
}
// //DB::connection()->setDatabaseName($this->database);
// Artisan::call('migrate'); // Artisan migration
// $this->info('Migration successfully done!');
//
// if ($this->confirm('You want to seeding your database?')) {
// Artisan::call('db:seed'); // Artisan seed
// $this->info('Seeding successfully done!');
// }
// }
}
}
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment