DataTree

  1. Accessories
    1. Cables
  2. Laptops
    1. PC Laptops
    2. Macbooks (Air/Pro)
  3. Desktops
  4. Monitors
  5. Cell Phones



class DemoController extends Controller

....

    public function 
anyDatatree()
    {
        if (!
class_exists('\Baum\Node')) {
            die(
"You need to install Baum\\Baum and repopulate the database to use the DataTree");
        }

        
// for demo purposes only, ensure the root exists
        
$root Menu::firstOrNew(['id' => 1]);
        
$root->save();

        
// load the root model
        
$root Menu::find(1) or App::abort(404);

        
$tree = \DataTree::source($root);
        
$tree->add('title');
        
$tree->edit("/rapyd-demo/menuedit"'Edit''modify|delete');
        
$tree->submit('Save the order');

        return 
view('rapyd::demo.tree'compact('tree'));
    }




class DemoController extends Controller

....

    public function 
anyMenuedit()
    {
        if (\
Input::get('do_delete') == 1) return "not the first";

        
$edit = \DataEdit::source(new Menu());
        
$edit->link("rapyd-demo/datatree","Menu""TR")->back();
        
$edit->label('Edit Menu Item');
        
$edit->add('title','Title''text');
        return 
$edit->view('rapyd::demo.edit'compact('edit'));
    }



@extends('rapyd::demo.demo')

@section('title','DataTree')

@section('body')

    <h1>DataTree</h1>
        {!! $tree !!}
    <p>

        
        
        
    </p>
@stop