Skip to content

thrbr84/godot_laravel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

34 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Godot + Laravel

Explanation (PT_BR)

Video explanation

Running with Docker

  • Install docker
  • Install docker-compose
  • Execute: docker-compose up
  • After run the docker: http://localhost
  • Change the endpoint in Godot/Scripts/HttpLayer.gd:
    var endpoint_api = "http://localhost/api/"

Running without Docker

  • Dependencies

  • Clone this repository

  • cd godot_laravel/laravel

  • Execute:

    • composer install
    • chmod -R 0755 storage
    • chmod -R 0755 bootstrap/cache
    • cp .env.model .env
    • php artisan key:generate
    • create mysql database godot_laravel
    • config the .env file with your parameters
    • php artisan passport:keys
    • php artisan migrate --seed

    Optimize

    • php artisan optimize:clear

    local serve

      - php artisan serve
      - Access: [http://127.0.0.1:8000](http://127.0.0.1:8000)
    

Config local Apache

  • sudo nano /etc/hosts
    # add this line
    127.0.0.1   godotlaravel.local
  • cd /etc/apache2/sites-available
  • sudo nano api-godotlaravel.conf
    <VirtualHost *:80>
        ServerName godotlaravel.local
        ServerAlias godotlaravel.local
    
        ServerAdmin webmaster@localhost
        DocumentRoot "/home/SEU_USUARIO/Godot_Laravel/laravel/public"
    
        <Directory "/home/SEU_USUARIO/Godot_Laravel/laravel/public">
                AllowOverride all
                Require all granted
        </Directory>
    </VirtualHost>
  • sudo a2ensite api-godotlaravel.conf
  • sudo systemctl restart apache2
  • Test: http://godotlaravel.local

Deploy production server

  • Edit .env file
    APP_ENV=production
    APP_DEBUG=false
  • composer install --optimize-autoload --no-dev

Config cache

  • php artisan config:cache
  • php artisan route:cache