I have a laravel project that I finished done in Windows (wampserver) using Laravel 5.2 in php 5.5.12 working perfectly.
I would like to know how to copy it to the server that is in CentOS 7. What is PHP 7. If I install Laravel on it it will get Laravel 5.5.
I tried to copy the project to the server and separate the public folder from the rest of the project, but it only finds the main route, which in the case is my login
My Route is like this:
app \ routes.php
Route::get('/', function () {
return view('login');
});
Route::post('/logar', 'UsuarioController@logar');
When I try to log in, it gives the error 404
The requested URL / myproject / login was not found on this server.
It already has the permissions
My login form looks like this:
login.blade.php
<form action="{{ action('UsuarioController@logar') }}" method="post">
<input type="hidden" name="_token" value="{{ csrf_token() }}">
<div class="form-group has-feedback">
<input type="text" class="form-control" placeholder="Usuário" name="login">
<span class="glyphicon glyphicon-envelope form-control-feedback"></span>
</div>
<div class="form-group has-feedback">
<input type="password" class="form-control" placeholder="Senha" name="senha">
<span class="glyphicon glyphicon-lock form-control-feedback"></span>
</div>
<div class="row">
<div class="col-xs-8">
</div>
<!-- /.col -->
<div class="col-xs-4">
<button type="submit" class="btn btn-primary btn-block btn-flat">Logar</button>
</div>
<!-- /.col -->
</div>
</form>
My controller looks like this:
UserController.php
public function logar(){
echo "Principal";
}
public function login(){
return view('login');
}
public function sair(){
Session::flush();
return redirect( )->action( 'UsuarioController@login' );
}
Detail:
If I create a Laravel project in CentOS itself, it works perfectly.
I just needed to add the block in httpd.conf
<Directory "/var/www/html/portal/myproject">
Options Indexes FollowSymLinks
AllowOverride all
Require all granted
</Directory>
I certainly screwed up on something, but where?