Example #1
0
 public function vueComponentRelativePathTo(Table $table, $restMode, $forceName = null)
 {
     //on est sur $this
     // if ($restMode == 'HoldingList') {
     //     $table->vueComponentPath($restMode);
     // }
     $path = $table->vueComponentPath($restMode);
     $pieces = explode('/', $path);
     $toSpace = _Namespace::where('name', $pieces[2])->first();
     $toTable = $toSpace->tables->where('model', $pieces[3])->first();
     // dd($toSpace,$toTable);
     // if ($toTable->name == $this->name) {
     //
     //     return str_replace('./spaces/'.$this->the_namespace->name.'/'.$this->model,'.', $path);
     // }
     if ($toSpace->name == $this->the_namespace->name) {
         return '.' . str_replace('./spaces/' . $this->the_namespace->name, '.', $path) . '.vue';
     } else {
         return '..' . str_replace('./spaces', '.', $path) . '.vue';
     }
 }