I want to make an instance of my model in my controller and use it every where i need 

I use this code:

```php
public $test = new Access();

```

but the is this error that i cant figure it out why i kept getting this error:

> 
> expression is not allowed as field default value
> 
> 
> 

and this is my controller code down here:

```php
<?php
namespace App\Http\Controllers;
 use App\Models\Access;
use Illuminate\Http\Request;
classAccessController extends Controller{
private $table = 'accesses';
public $test = new Access();
/**
 * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
 */
public function index()
{
    $table = $this->table;
    $accesses = (new  Access())->index($table);
    return view('index', compact('accesses'));
}

/**
 * @param Request $request
 * @return \Illuminate\Http\RedirectResponse
 */
public function store(Request $request)
{

    $access = new Access();
    $request->validate([
        'can_select' => 'required|boolean',
        'can_delete' => 'required|boolean',
        'can_edit' => 'required|boolean',
        'can_insert' => 'required|boolean',
        'role_id' => 'required|integer|max:2',
        'module_id' => 'required|integer|max:3',
    ]);

    $access->can_select = $request->get('can_select');
    $access->can_delete = $request->get('can_delete');
    $access->can_edit = $request->get('can_edit');
    $access->can_insert = $request->get('can_insert');
    $access->role_id = $request->get('role_id');
    $access->module_id = $request->get('module_id');

    $attributes = array('can_select', 'can_delete', 'can_edit', 'can_insert', 'role_id', 'module_id');
    $options = array($access->can_select, $access->can_delete, $access->can_edit, $access->can_insert, $access->role_id, $access->module_id);
    $table = $this->table;
    (new Access())->store($table, $attributes, $options);
    return redirect('accesses')->with('success', 'Information has been  inserted');
}

/**
 * @param $id
 * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
 */
public function edit($id)
{
    $access = Access::find($id);
    return view('update', compact('access', 'id'));
}

/**
 * @param Request $request
 * @param $id
 * @return \Illuminate\Http\RedirectResponse
 */
public function update(Request $request, $id)
{
    $access = Access::find($id);
    $request->validate([
        'can_select' => 'required|boolean',
        'can_delete' => 'required|boolean',
        'can_edit' => 'required|boolean',
        'can_insert' => 'required|boolean',
        'role_id' => 'required|integer|max:2',
        'module_id' => 'required|integer|max:3',
    ]);
    $access->can_select = $request->get('can_select');
    $access->can_delete = $request->get('can_delete');
    $access->can_edit = $request->get('can_edit');
    $access->can_insert = $request->get('can_insert');
    $access->role_id = $request->get('role_id');
    $access->module_id = $request->get('module_id');

    $attributes = array('can_select', 'can_delete', 'can_edit', 'can_insert', 'role_id', 'module_id');
    $options = array($access->can_select, $access->can_delete, $access->can_edit, $access->can_insert, $access->role_id, $access->module_id);
    $object = $access;
    $table = $this->table;
    (new  Access())->updates($table, $object, $attributes, $options);
    return redirect('accesses')->with('success', 'Information has been updated successfully!!');
}

/**
 * @param $id
 * @return \Illuminate\Http\RedirectResponse
 */
public function destroy($id)
{
    $access = Access::find($id);
    $object = $access;
    $table = $this->table;
    (new Access())->erase($table, $object);
    return redirect('accesses')->with('success', 'Information has been  deleted');
}

}

```

i first thought it is the security problem but in my idea it is irrelevent in my idea