AdminCrmController.php 810 Bytes
Newer Older
Angel MAS committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
<?php

namespace Onestartup\Crm;

use Illuminate\Http\Request;
use App\Http\Requests;
use App\Http\Controllers\Controller;
use Yajra\Datatables\Datatables;
use App\Interested;

class AdminCrmController extends Controller
{

    public function list()
    {
    	return view('crm::list')->with('var', 'varx');
    }

    public function datatable()
    {
    	$interesteds = Interested::select(['id','name','email', 'phone','landing','origin','created_at'])->orderBy('id', 'desc');

        return Datatables::of($interesteds)
        ->addColumn('details_url', function ($interested) {
            return "<a href='".route('crm.show',$interested->id)."'>Ver Detalle</a>";
        })
        ->rawColumns(['details_url'])
        ->make();
    }

    public function show($id)
    {

    	return "asd";
    }
}