值不在类的公共字段中赋值

I have a class DashboardController as

class DashBoardController extends Controller
{
    public $str;

    public function __construct($str)
    {
        $this->str = $str;
        echo $this->str;
    }

    public function dashboard(Request $request)
    {
        $obj = new DashBoardController("hello");
        die;
    }
}

it gives me Exception as

Unresolvable dependency resolving [Parameter #0 [ $str ]] in class App\Modules\User\Controllers\DashBoardController

What is the error here?

You need to pass default value if there is no dependency injected at the time of load.

class DashBoardController extends Controller
{
    public $str;

    public function __construct($str='')
    {
        $this->str = $str;
        echo $this->str;
    }

    public function dashboard(Request $request)
    {
        $obj = new DashBoardController("hello");
        die;
    }
}