Psy Shell v0.8.15 (PHP 5.6.27 鈥?cli) by Justin Hileman
>>> namespace App;
>>> $role = new Role;
=> App\Role {#711}
>>> $role->name='admin';
=> "admin"
>>> $role->label='Admin';
=> "Admin"
>>> $role->save();
=> true
>>> $permission = new Permission;
=> App\Permission {#117}
>>> $permission->name='edit_form';
=> "edit_form"
>>> $permission->label='edit the form';
=> "edit the form"
>>> $permission->save();
=> true
>>> $role->givePermission($permission);
PHP Fatal error: Call to a member function save() on null in F:\www\test.dev\app\Role.php on line 19
[Symfony\Component\Debug\Exception\FatalErrorException]
Call to a member function save() on null
我执行$role->givePermission($permission);报错误
Call to a member function save() on null
老师是什么原因