Installing Laravel in a domain subfolder can be useful in certain situations, although it is not officially supported by Laravel creators. In this instruction, I will describe how to configure Laravel 10 in a subfolder and additional tools such as Livewire v3.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
server_name site.dev; | |
index index.php; | |
root /Users/balkon_smoke/Sites/site.dev/web; | |
error_log /Users/balkon_smoke/Sites/site.dev/logs/error.log; | |
access_log /Users/balkon_smoke/Sites/site.dev/logs/access.log; | |
location / { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Console\Commands; | |
use Illuminate\Console\Command; | |
use Illuminate\Console\Concerns\CallsCommands; | |
use Illuminate\Support\Facades\Http; | |
use Laravel\Forge\Forge; | |
use Laravel\Forge\Resources\Daemon; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Function to convert the version string | |
convert_version_string() { | |
local input_string=$1 | |
local version_number="${input_string#*/v}" # Remove everything before '/v' | |
local version_parts=($(echo "$version_number" | tr '.' ' ')) # Split version string into parts | |
# Ensure we have at least three parts (major, minor, patch) | |
while (( ${#version_parts[@]} < 3 )) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- 1. Вывести список сотрудников, получающих заработную плату большую чем у непосредственного руководителя | |
SELECT * | |
FROM Employee AS employees, Employee AS chieves | |
WHERE chieves.id = employees.chief_id AND employees.salary > chieves.salary; | |
-- 2. Вывести список сотрудников, получающих максимальную заработную плату в своем отделе | |
SELECT * | |
FROM Employee AS employees | |
WHERE employees.salary = (SELECT MAX(salary) FROM Employee AS max WHERE max.department_id = employees.department_id); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$credentials = "username:password"; | |
// Read the XML to send to the Web Service | |
$request_file = "./SampleRequest.xml"; | |
$fh = fopen($request_file, 'r'); | |
$xml_data = fread($fh, filesize($request_file)); | |
fclose($fh); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function quickSort($array) | |
{ | |
if (count($array) < 2) { | |
return $array; | |
} | |
$pivot = array_shift($array); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author iron-viper | |
*/ | |
$array = [ | |
[ | |
"id" => 1, | |
"name" => "test-1", | |
"parent" => 0, | |
"children" => [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{% macro recursiveCategory(category) %} | |
<li> | |
<h4><a href="{{ path(category.route, category.routeParams) }}">{{ category }}</a></h4> | |
{% if category.children|length %} | |
<ul> | |
{% for child in category.children %} | |
{{ _self.recursiveCategory(child) }} | |
{% endfor %} | |
</ul> |
NewerOlder