Наследование: extends Illuminate\Database\Eloquent\Model, use trait Illuminate\Database\Eloquent\SoftDeletes, use trait REBELinBLUE\Deployer\Traits\BroadcastChanges
Пример #1
0
 public function run()
 {
     DB::table('shared_files')->delete();
     SharedFile::create(['name' => 'Storage', 'file' => 'storage/', 'project_id' => 1]);
     SharedFile::create(['name' => 'Uploads', 'file' => '/public/upload/', 'project_id' => 1]);
     SharedFile::create(['name' => 'README', 'file' => 'README.md', 'project_id' => 1]);
     SharedFile::create(['name' => 'LICENSE', 'file' => '/LICENSE.md', 'project_id' => 1]);
 }
Пример #2
0
 /**
  * Execute the command.
  *
  * @return void
  */
 public function handle()
 {
     $template = Project::findOrFail($this->template_id);
     foreach ($template->commands as $command) {
         $data = $command->toArray();
         $data['project_id'] = $this->project->id;
         Command::create($data);
     }
     foreach ($template->sharedFiles as $file) {
         $data = $file->toArray();
         $data['project_id'] = $this->project->id;
         SharedFile::create($data);
     }
     foreach ($template->projectFiles as $file) {
         $data = $file->toArray();
         $data['project_id'] = $this->project->id;
         ProjectFile::create($data);
     }
 }