Skip to content

Run Laravel Use PhpWebStudy

Creating a Laravel Project

If you want to use an existing project. You can skip this step. See Create Site

You can create a Laravel project using Composer

shell
composer create-project laravel/laravel example-app

Of course, PhpWebStudy also provides a way to quickly create laravel projects.

  1. In the Hosts panel. Click 'New Project'
  1. Choose project save path, project used PHP version, and Laravel version. Click 'OK' button.
  1. After the project is created, you can proceed to the next step. Create a site

Create Site

Click the 'Add' button in the Hosts panel. Or click 'Create Host' button on pre step. Enter the add site interface

Field descriptions can be found in this reference Hosts

  1. Select site root directory. For Laravel projects, select the public directory. If it comes in from the previous step, it will be automatically selected.
  1. Set url rewrite
  • Nginx

Select laravel in the 'Nginx Url Rewrite' block. If it comes from the previous step, it will be automatically selected.

Or use this

sh
location / {
	try_files $uri $uri/ /index.php$is_args$query_string;
}
  • Apache

When the project is created, the .htaccess file has been automatically created. Or use this to create it manually

sh
<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>

    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Send Requests To Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]
</IfModule>
  • Caddy

No additional setup required

Up and Running

  • Start PHP / Apache / Nginx / Caddy. Click the link in the Hosts panel. Open in browser

  • View site log here