Skip to content

Commit d3c12da

Browse files
committed
fix folders and add requests
1 parent 8afd401 commit d3c12da

8 files changed

Lines changed: 971 additions & 10 deletions

File tree

README.md

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,14 @@ Run [Composer](https://getcomposer.org/) to install all dependencies.
4949
composer install --prefer-dist
5050
```
5151

52-
Ensure the folder ./storage are with all rights to save log and cache (alread set in composer install, but ...)
52+
Ensure the composer install create the cache folders and give then permissions in ./storage, if don't you'll have to create and give permitions yourself:
5353
```sh
54-
chmod -R 777 ./storage
54+
mkdir storage/framework \
55+
&& mkdir storage/framework/cache \
56+
&& mkdir storage/framework/cache/data \
57+
&& mkdir storage/framework/sessions \
58+
&& mkdir storage/framework/views \
59+
&& chmod -R 777 ./storage
5560
```
5661

5762
To check the build for this project look at ./ops/docker/dev folder.
@@ -76,12 +81,6 @@ Now you can access the health-check [http://localhost:8101](http://localhost:810
7681
}
7782
```
7883

79-
### Requests samples
80-
81-
You can find a sample of requests you can do in the file `requests.http` (for the [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client) extension on VSCode) or using curl commands listed in the file `requests.curl`.
82-
83-
Not all requests are documented yet (Work in progress)
84-
8584
### Creating your automatic crud domain
8685

8786
For create your brand new domain with a complete crud use the command:
@@ -111,6 +110,38 @@ This command will create a folder in `app/Domains`, new files in `routes`, `data
111110
php artisan migration
112111
```
113112

113+
### Requests samples
114+
115+
Within the `/ops/requests` folder, you'll discover a collection of sample requests showcasing.
116+
117+
Requests have been meticulously documented in three different formats for your convenience:
118+
119+
1. Postman Collections
120+
121+
Files: `postman_collection.json` and `postman_environments.json`
122+
123+
Tool: Postman
124+
125+
These collections provide a comprehensive overview of the available API requests. Import them into Postman to explore and execute requests seamlessly.
126+
127+
128+
2. Visual Studio Code (VSCode) REST Client Extension:
129+
130+
File: `requests.http`
131+
132+
Extension: [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)
133+
134+
With the extension installed in VSCode open the `requests.http` file. This extension allows you to send HTTP requests directly from your code editor, making it easy to interact with the API.
135+
136+
137+
3. CURL Commands:
138+
139+
File: `requests.curl`
140+
141+
For those who prefer the command line, CURL commands are provided in the `requests.curl` file. Execute these commands in your terminal to interact with the API using the widely-used CURL tool.
142+
143+
Choose the documentation format that aligns with your preferred workflow and start seamlessly interacting with the API.
144+
114145
### Ulid
115146

116147
For primary key value, this project using [Ulid](https://github.com/not-empty/ulid-php-lib) value, but you can pass other pattern in insert route if you prefer.

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
},
3636
"scripts": {
3737
"post-install-cmd": [
38-
"chmod -R 777 storage"
38+
"./ops/folders.sh"
3939
],
4040
"checkall" : [
4141
"@lint",

ops/docker/prod/php-fpm/Dockerfile

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ RUN tar -xvf /usr/src/newrelic-php5-9.21.0.311-linux.tar.gz -C /usr/src && \
2424

2525
COPY . /var/www/html
2626

27-
2827
WORKDIR /var/www/html
2928

3029
EXPOSE 9000

ops/folders.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
#!/bin/sh
2+
3+
DIR1="storage/framework"
4+
DIR2="storage/framework/cache"
5+
DIR3="storage/framework/cache/data"
6+
DIR4="storage/framework/sessions"
7+
DIR5="storage/framework/views"
8+
9+
10+
if [ ! -d "$DIR1" ]; then
11+
mkdir "$DIR1"
12+
echo "folder $DIR1 created"
13+
fi
14+
if [ ! -d "$DIR2" ]; then
15+
mkdir "$DIR2"
16+
echo "folder $DIR2 created"
17+
fi
18+
if [ ! -d "$DIR3" ]; then
19+
mkdir "$DIR3"
20+
echo "folder $DIR3 created"
21+
fi
22+
if [ ! -d "$DIR4" ]; then
23+
mkdir "$DIR4"
24+
echo "folder $DIR4 created"
25+
fi
26+
if [ ! -d "$DIR5" ]; then
27+
mkdir "$DIR5"
28+
echo "folder $DIR5 created"
29+
fi
30+
31+
chmod -R 777 storage
32+
echo "permissions set on storage"

0 commit comments

Comments
 (0)