我刚刚安装Laravel 5.8,我想将应用程序名称从 更改Laravel为CodeTube。我已将其写入.env文件中APP_NAME=CudeTube,但名称没有更改。
我为我的网站生气了。但我不如何更换hostname,username,password和database。与来自输入字段的值。这是config/database.php文件中的代码。
$db['default'] = array(
'dsn' => '',
'hostname' => 'db_host',
'username' => 'db_user',
'password' => 'db_pass',
'database' => 'db_name',
'dbdriver' => 'mysqli',
'dbprefix' => '',
'pconnect' => FALSE,
'db_debug' => (ENVIRONMENT !== 'production'),
'cache_on' => FALSE,
'cachedir' => '',
'char_set' => 'utf8',
'dbcollat' => 'utf8_general_ci',
'swap_pre' => '',
'encrypt' => FALSE,
'compress' => FALSE,
'stricton' => FALSE,
'failover' => array(),
'save_queries' => TRUE
);
Run Code Online (Sandbox Code Playgroud)
但是这段代码给了我这个错误。
和中的此代码controller。
function configure_database() …Run Code Online (Sandbox Code Playgroud) 我已经安装了最新的laravel。我做了这个简单的表格。我想创建,post但是当我提交时,它转到了localhost/post 错误的地方URL。实际URL是http://localhost/laravel_practice/'
形式
<form method="post" action="/post">
<div class="form-group">
<label>Title</label>
<input type="text" name="title" class="form-control" placeholder="Enter Title Here">
</div>
<div class="form-group">
<label>Body</label>
<textarea name="body" class="form-control" placeholder="Enter the body"></textarea>
</div>
<div class="form-group">
<input type="submit" name="sumit" class="btn btn-primary" value="Publish">
</div>
Run Code Online (Sandbox Code Playgroud)
我的路线
Route::get('/' ,'PostController@index');
Route::get('/posts/create', 'PostController@create');
Route::post('/post','PostController@store');
Run Code Online (Sandbox Code Playgroud)