/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $datasets = Dataset::all();
     $datasources = Datasource::all();
     $variables = Variable::all();
     $categories = DatasetCategory::all();
     $subcategories = DatasetSubcategory::all();
     $varTypes = VariableType::all();
     $sourceTemplate = Setting::where('meta_name', 'sourceTemplate')->first();
     $data = ['datasets' => $datasets, 'datasources' => $datasources, 'variables' => $variables, 'categories' => $categories, 'subcategories' => $subcategories, 'varTypes' => $varTypes, 'sourceTemplate' => $sourceTemplate];
     $response = view('import.index')->with('data', $data);
     return $response;
 }
 /**
  * Run the migrations.
  *
  * @return void
  */
 public function up()
 {
     DB::transaction(function () {
         Schema::table('variables', function ($table) {
             $table->string('uploaded_by')->nullable();
             $table->foreign('uploaded_by')->references('name')->on('users');
             $table->timestamp('uploaded_at');
         });
         foreach (Variable::all() as $var) {
             $var->uploaded_at = $var->created_at;
             $var->save();
         }
     });
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     /*$variable = Variable::find( 1 );
     		$data = [
     			new DataValue( [ 'value' => 'fads', 'description' => 'Description 1', 'fk_input_files_id' => 1 ] ),
     			new DataValue( [ 'value' => 'adsf', 'description' => 'Description 2', 'fk_input_files_id' => 1 ] ) 
     		];
     		$variable->saveData( $data );*/
     $datasets = Dataset::all();
     $datasources = Datasource::all();
     $variables = Variable::all();
     $categories = DatasetCategory::all();
     $subcategories = DatasetSubcategory::all();
     $varTypes = VariableType::all();
     $data = ['datasets' => $datasets, 'datasources' => $datasources, 'variables' => $variables, 'categories' => $categories, 'subcategories' => $subcategories, 'varTypes' => $varTypes];
     return view('import.index')->with('data', $data);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $variables = Variable::all();
     return view('variables.index', compact('variables'));
 }