This repository was archived by the owner on Feb 18, 2023. It is now read-only.
  
  
  
  
    
    
    
      
    
  
  
    
File tree Expand file tree Collapse file tree 6 files changed +63
-9
lines changed Expand file tree Collapse file tree 6 files changed +63
-9
lines changed Original file line number Diff line number Diff line change @@ -16,7 +16,7 @@ COPY composer.json ./
1616
1717COPY  composer.lock ./
1818
19- RUN  composer install --no-dev --no- scripts --no-autoloader
19+ RUN  composer install --no-scripts --no-autoloader
2020
2121COPY  . /var/www/html/
2222
Original file line number Diff line number Diff line change 22
33namespace  App \Console \Commands ;
44
5- use  App \Services \Installation \AppInstallationService ;
65use  Illuminate \Console \Command ;
6+ use  App \Services \Installation \AppInstallationService ;
77
88class  InstallApp extends  Command
99{
Original file line number Diff line number Diff line change 1+ <?php 
2+ 
3+ namespace  App \Console \Commands ;
4+ 
5+ use  Illuminate \Console \Command ;
6+ use  App \Services \Installation \AppInstallationService ;
7+ 
8+ /** 
9+  * Class ResetDemoApp 
10+  * @package App\Console\Commands 
11+  */ 
12+ class  ResetDemoApp extends  Command
13+ {
14+ 
15+     /** 
16+      * @var string 
17+      */ 
18+     protected  $ signature  = 'demo:reset ' ;
19+ 
20+ 
21+     /** 
22+      * @var string 
23+      */ 
24+     protected  $ description  = 'Reset the application state for the demo site. ' ;
25+ 
26+ 
27+     /** 
28+      * ResetDemoApp constructor. 
29+      */ 
30+     public  function  __construct ()
31+     {
32+         parent ::__construct ();
33+     }
34+ 
35+ 
36+     /** 
37+      * 
38+      */ 
39+     public  function  handle ()
40+     {
41+         $ service  = app (AppInstallationService::class);
42+         $ this  ->info ('cleaning up ' );
43+         $ this  ->call ('migrate:refresh ' );
44+         $ this  ->info ('Installing the app ' );
45+         $ service ->installApp ([
46+             'name '  => 'Api Demo Admin ' ,
47+ 48+             'password '  => 'secret123456789 ' ,
49+             'password_confirmation '  => 'secret123456789 ' 
50+         ]);
51+         $ this  ->info ('Seed the database ' );
52+         $ this  ->call ('db:seed ' );
53+         $ this  ->info ('Done ' );
54+     }
55+ }
Original file line number Diff line number Diff line change 33namespace  App \Console ;
44
55use  App \Console \Commands \InstallApp ;
6+ use  App \Console \Commands \ResetDemoApp ;
67use  Illuminate \Console \Scheduling \Schedule ;
78use  Illuminate \Foundation \Console \Kernel  as  ConsoleKernel ;
89
@@ -14,7 +15,9 @@ class Kernel extends ConsoleKernel
1415     * @var array 
1516     */ 
1617    protected  $ commands  = [
17-         InstallApp::class
18+         InstallApp::class,
19+         // this is just for the demo, you can remove this on your application 
20+         ResetDemoApp::class
1821    ];
1922
2023    /** 
Original file line number Diff line number Diff line change 1919        'name '  => $ faker ->name ,
2020        'uuid '  => $ faker ->uuid ,
2121        'email '  => $ faker ->unique ()->safeEmail ,
22-         'password '  => $ password  ?: $ password  = 'secret ' ,
22+         'password '  => $ password  ?: $ password  = bcrypt ( 'secret ' ) ,
2323        'remember_token '  => str_random (10 ),
2424    ];
2525});
Original file line number Diff line number Diff line change @@ -70,11 +70,7 @@ Then run `php artisan passport:install`
7070
7171Run ` php artisan app:install `  and fill out the information of the admin user.
7272
73- Run ` yarn install `  to install node dependencies
74- 
75- Run ` yarn dev `  to compile the CSS and JS
76- 
77- You should be done with the basic configuration.
73+ You should be done with the basic installation and configuration.
7874
7975## Tests  
8076
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments