Windows Guide
Silkroad-Laravel Manual Install
Requirements
- Laragon Full (Git, MySQL, Apache, Ngnix, PHP, Composer, NodeJS, SSL emulator, virtual hosts, etc)
- PHP v7.4+ The minimum required for project
Thead Safe
(TS) if you plan to use ApacheNon Thread Safe
(NTS) if you plan to use Ngnix- SQL Drivers for PHP (5.8)
- SQL Server Database from Silkroad already installed
Shortcut Links
Installation
Enviroment Setup
-
Install Laragon Full and make sure to add the option about "Add console to Windows context"
-
Extract the PHP compressed file to the Laragon php folder, will be probably this:
C:\Laragon\bin\php
- Install the SQL Drivers for PHP on
ext
folder inside the last php folder extracted like:
C:\Laragon\bin\php\php7.4xxxxxxxxxxxx\ext
-
Execute Laragon, go to MENU and change the PHP version to use v7.4+
-
From same MENU, activate the SQL Drivers for PHP extensions referencing your server system choosen and OS system (TS or NTS, x64 or x86):
php_pdo_sqlsrv_74_ts_x64.dll
-
php_sqlsrv_74_ts_x64.dll
-
Check Laragon Preferences and activate virtual hosts
-
press DATABASE from Laragon and create an empty web database (MySQL
utf8mb4_unicode_ci
) named asDB_SILKROAD
to match our .env.example file -
Press TERMINAL button from Laragon and make sure the php version is v7.4+
php -version
If is not correct, then try to add the PATH to your System Enviroment Variables from the php v7.4+ folder.
- From same TERMINAL, Create a folder
silkroad-laravel
for your project
mkdir silkroad-laravel
- Change directory from console to start all the project commands and stuffs from there
cd silkroad-laravel
Project Setup
- Clonate/download the project to the current directory console
git clone https://github.com/Devsome/silkroad-laravel.git
-
Make a copy of
.env.example
file and name it as.env
, fill it with both database credentials, also make sure APP_URL points to your virtual host (https://silkroad-laravel.test at this case) -
Execute the next query on
SRO_VT_SHARD
ALTER TABLE dbo._Char ADD ItemPoints int NOT NULL DEFAULT 0;
ALTER TABLE dbo._Guild ADD ItemPoints int NOT NULL DEFAULT 0;
-
You need to create a new Silkroad Database called
SRO_WEB_LARAVEL
-
Modify the procedure on
SRO_VT_LOG
._AddLogChar
adding the following like so:
CREATE procedure [dbo].[_AddLogChar]
@CharID int,
@EventID tinyint,
@Data1 int,
@Data2 int,
@strPos varchar(64),
@Desc varchar(128)
as
EXEC SRO_WEB_LARAVEL.dbo._WebProcess @CharID = @CharID,@EventID = @EventID,@DESC = @Desc,@strPos = @strPos
Important is to add this EXEC SRO_WEB_LARAVEL.dbo._WebProcess @CharID = @CharID,@EventID = @EventID,@DESC = @Desc,@strPos = @strPos
right after the as
.
Now modify the _AddLogSiegeFortress
procedure and add the following at the end:
DECLARE @FWStatus VARCHAR(10) = (CASE WHEN @EventID = 1 THEN 'Running' WHEN @EventID = 2 THEN 'Stopped' ELSE 'Unknown' END)
IF (@EventID IN(1,2))
BEGIN
IF NOT EXISTS(SELECT * FROM SRO_WEB_LARAVEL.dbo._FortressStatus WHERE Status LIKE 'Running' OR Status LIKE 'Stopped')
BEGIN
TRUNCATE TABLE SRO_WEB_LARAVEL.dbo._FortressStatus
INSERT INTO SRO_WEB_LARAVEL.dbo._FortressStatus (Status,Date) VALUES (@FWStatus,GETDATE())
END
ELSE
UPDATE SRO_WEB_LARAVEL.dbo._FortressStatus SET Status = @FWStatus, Date = GETDATE()
END
- Install php dependencies with composer
composer install
- Laravel commands for generating the storage path, unique key and table migrations to databases.
php artisan storage:link && php artisan key:generate && php artisan migrate --seed
- If you want to add your existing Silkroad accounts to the web database, execute:
php artisan import:silkroad-accounts
- Add manually and backend role, insert on
model_has_roles
table from MySQL database:
role_id : 3
model_type : App\User
model_id : Your account ID on `users` table
Notes
- Clearing the cache is a good idea for development stuffs.
php artisan cache:clear && php artisan config:cache
Thanks to @JellyBitz