020 555 1111
  • Old fashion, modular, procedural PHP plus some scaffolding techniques to allow it to mimic MVC simplicity.
  • A quick reference to help you find in PHP maze what needs to be done and how to do it.
  • Learn a PHP Object Oriented Programming by building a live discussion forum application.
  • MVC - Model View Controller - real life, easy reference and application.
This product has options, take a look at them and select ones you like the most.
Options are displayed under image section.

step 2: Laravel Configuration / Maintenance
[Frameworks]

Laravel Configuration

Pretty much everything is clearly explained at the end of a link above.

 


CONFIGURATION

Here are a few pointers, that should be visible at a first glance:

  1. all config files are stored in /config dir
  2. accessing config value anywhere within Laravel powered app:
    $value = config('app.timezone');
    where:
    'app' is a config file name, and 
    'timezone' in config value
  3. setting config values at runtime (not in config file, but ad hoc):
    config(['app.timezone' => 'America/Chicago'])
  4. .env:  startup configuration values (envitonment configuration)
    • all .env values are loaded to PHP superglobal $_ENV
    • env helper function is used to load to $_ENV, e.g. see config files
    • env helper is used with default value, in case .env file does not have one, e.g.: 
      env('APP_DEBUG', false)
      value in .env file overrides helper function default file (false in given example)
    • do not push to remository .env file, as your local devel configuration on .env may not suit online project
  5. configuration files catching:
    • should be done for production ready version
    • should NOT be used during development routine
    • code (in terminal):
      php artisan config:cache

 

 


MAINTENANCE

If you want to put your site in a stand-by, use this code:

php artisan down

If you want it live again, use this code:

php artisan up

 

 


SET DOCROOT TO LARAVEL'S /PUBLIC DIRECTORY

It is necessary to point main www address to Laravel's /public folder, taking all the rest of Laravel framework files out of realm of web access.

 

DirectAdmin

You must have access to: Custom HTTPD Configurations
Once inside, click on: domain you have Laravel on.
 
option 1:
use available tokens
DOCROOT=/home/admin/domains/domain.com/public_html
 
option 2:
you can try to add custom <Virtualhost> ... something like:
<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "/home/user/domains/your-www-page.com/public_html/public"
    ServerName your-www-page.com
    ErrorLog "/home/user/domains/your-www-page.com/_logs/your-www-page-error.log"
    CustomLog "/home/user/domains/your-www-page.com/_logs/your-www-page-access.log" common
</VirtualHost>
... and add also similar code for SSL
<VirtualHost *:443>
    ServerAdmin webmaster@example.com
    DocumentRoot "/home/user/domains/your-www-page.com/public_html/public"
    ServerName b10:443
    ErrorLog "/home/user/domains/your-www-page.com/_logs/b10-error.log"
    CustomLog "/home/user/domains/your-www-page.com/_logs/b10-access.log" common
    
    SSLEngine on
    SSLCertificateFile "/home/user/apache/bin/server.crt"
    SSLCertificateKeyFile "/home/user/apache/bin/server.key"
</VirtualHost>
 
option 3:
 
If you have access to server (Apache) itself, just go to 
\apache\conf\extra\httpd-vhosts.conf
... and add code from option 2 directly to httpd-vhosts.conf file.
 

 

cPanel

option 1:
If you are on your own server and have access to httpd.conf file inside of /apache/conf/extra directory, you can change DocumentRoot in httpd.conf
Read some more here.
 
option 2:
If you cannot follow option 1, then do it differently, using cPanel interface.
 
You would need 2 domains: 
  • your main domain, you want your web page to show under
  • some simple domain you dock cPanel on - it will be your main domain (as it is called in cPanel) - in reality, it will not.
Now, follow these steps:
  1. setup your cPanel with that docking domain as main.
  2. go to addon domains and create addon domain using your main domain (not docking one)
  3. when creating docking domain, set Document Root to something like:You may go to: Redirects and point your "docking" domain to Laravel Document Root
    /home/user/domains/your-www-page.com/public_html/public
    note: 
    At the end, there is a "public" folder.
    This is the same folder, you have all your public Laravel documents stored in.
    This is the ONLY folder, you should expose to web access.
    It is assumed, you install your Laravel to:
    /home/user/domains/your-www-page.com/public_html
    Of course, if you intend to use your server for other domains, you may install Laravel to:
    /home/user/domains/your-www-page.com/public_html/my_laravel_site
    Then, you should setup Document Root to:
    /home/user/domains/your-www-page.com/public_html/my_laravel_site/public
  4. Some say, you should also redirect your Laravel domain to its http url in cPanel Redirects manager.
 
option 3:
 
If you have access to server (Apache) itself, just go to 
\apache\conf\extra\httpd-vhosts.conf

... and add code from option 2 directly to httpd-vhosts.conf file.

 

 

Webmin/Virtualmin

option 1: (probably the easiest)

  1. Select Virtualmin section.
  2. Go to: Server Configuration / Website Options.
  3. Chance setting in: Website documents sub-directory  to  public_html/public
option 2:
 
If you have access to server (Apache) itself, just go to 
\apache\conf\extra\httpd-vhosts.conf

... and add code from option 2 directly to httpd-vhosts.conf file.

 

 

Localhost: XAMPP/WAMP

step 1
 
Look for: 
\apache\conf\extra\httpd-vhosts.conf
Then, add code something like this code.
<VirtualHost *:80>
    ServerAdmin webmaster@example.com
    DocumentRoot "u:/www/b10/public"
    ServerName b10
    ErrorLog "u:/www/_logs/b10-error.log"
    CustomLog "u:/www/_logs/b10-access.log" common
</VirtualHost>
<VirtualHost *:443>
    ServerAdmin webmaster@example.com
    DocumentRoot "u:/www/b10/public"
    ServerName b10:443
    ErrorLog "u:/www/_logs/b10-error.log"
    CustomLog "u:/www/_logs/b10-access.log" common
    
    SSLEngine on
    SSLCertificateFile "C:/xampp/apache/bin/server.crt"
    SSLCertificateKeyFile "C:/xampp/apache/bin/server.key"
</VirtualHost>

step 2

Then you should restart your WAMP/XAMPP.