datatable.directory codebase https://datatable.directory/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
datatable.directory/app/Http/Controllers/TableController.php

45 lines
1.1 KiB

<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class TableController extends Controller
{
/**
* SHow a form for creating a new table
*
* @return \Illuminate\Http\Response
*/
public function create()
{
$exampleColSpec =
"latin, string, Latin Name\n".
"common, string, Common Name\n".
"lifespan, int, Lifespan (years)";
$exampleData =
"Mercenaria mercenaria, hard clam, 40\n" .
"Magallana gigas, pacific oyster, 30\n" .
"Patella vulgata, common limpet, 20";
return view('table.create',
compact('exampleColSpec', 'exampleData')
);
}
public function storeNew(Request $request)
{
$this->validate($request, [
'table-name' => 'required',
'table-descr' => 'string|nullable',
'license' => 'string|nullable',
'upstream' => 'string|nullable',
'col-spec' => 'required',
'row-data' => 'string|nullable',
]);
return "Ok.";
}
}