File tree Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Expand file tree Collapse file tree 3 files changed +24
-2
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ public static function routes()
2121 }
2222
2323 if ($ format == 'csv ' ) {
24- $ filename = date ('Ymd ' ).self ::filename ($ format );
24+ $ filename = date ('Ymd ' ).' - ' . self ::filename ($ format );
2525
2626 return response ($ content , 200 , [
2727 'Content-Type ' => 'text/csv ' ,
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ public function getContents()
3030 $ output [] = PHP_EOL ;
3131 }
3232
33- $ schema = implode ('' , $ output );
33+ $ schema = implode (PHP_EOL , $ output );
3434 $ stub = $ this ->getStub ();
3535 $ database_config = config ('database.connections. ' .$ this ->connection );
3636 $ host = isset ($ database_config ['host ' ]) ? $ database_config ['host ' ] : null ;
@@ -46,4 +46,13 @@ public function getContents()
4646 $ schema ,
4747 ], $ stub );
4848 }
49+
50+ public function getStub ()
51+ {
52+ $ path = file_exists (
53+ base_path ('stubs/db-doc-csv.stub ' )
54+ ) ? base_path ('stubs/db-doc-csv.stub ' ) : __DIR__ .'/../../stubs/db-doc-csv.stub ' ;
55+
56+ return file_get_contents ($ path );
57+ }
4958}
Original file line number Diff line number Diff line change 1+ APP_NAME Database Schema
2+
3+ Database Details
4+
5+ Type,Value
6+ Connection,DB_CONNECTION
7+ Host,DB_HOST
8+ Port,DB_PORT
9+ Database,DB_DATABASE
10+
11+ DB_DATABASE Schema
12+
13+ SCHEMA_CONTENT
You can’t perform that action at this time.
0 commit comments