How Can I Remove “public/index.php” in the Laravel Url generated? [duplicate]

Option 1: Use .htaccess If it isn’t already there, create an .htaccess file in the Laravel root directory. Create a .htaccess file your Laravel root directory if it does not exists already. (Normally it is under your public_html folder) Edit the .htaccess file so that it contains the following code: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule … Read more

Avoid public folder of laravel and open directly the root in web server

Let’s assume you have this folder structure in your server .cpanel/ public_html/ public_ftp/ .. And the laravel folder structure is app/ bootstrap/ public/ vendor/ composer.json artisan .. You can create a folder name mylaravelsite on your server inline with public_html and public_ftp folder, and copy to it the whole laravel application except the public folder … Read more

Error 405 (Method Not Allowed) Laravel 5

The methodNotAllowed exception indicates that a route doesn’t exist for the HTTP method you are requesting. Your form is set up to make a DELETE request, so your route needs to use Route::delete() to receive this. Route::delete(’empresas/eliminar/{id}’, [ ‘as’ => ‘companiesDelete’, ‘uses’ => ‘CompaniesController@delete’ ]);

How to change public folder to public_html in Laravel

Quite easy to find this with a simple search. See: https://laracasts.com/discuss/channels/general-discussion/where-do-you-set-public-directory-laravel-5 In your index.php add the following 3 lines. /* |————————————————————————– | Turn On The Lights |————————————————————————– | | We need to illuminate PHP development, so let us turn on the lights. | This bootstraps the framework and gets it ready for use, then it … Read more

Laravel 4 : Route to localhost/controller/action

If you are looking for a more automated routing, this would be the Laravel 4 way: Route: Route::controller(‘users’, ‘UsersController’); Controller (in this case UsersController.php): public function getIndex() { // routed from GET request to /users } public function getProfile() { // routed from GET request to /users/profile } public function postProfile() { // routed from … Read more