Skip to content

Commit 6d70956

Browse files
committed
fix folder and add requests
1 parent c058186 commit 6d70956

File tree

8 files changed

+971
-10
lines changed

8 files changed

+971
-10
lines changed

README.md

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

46-
Ensure the folder ./storage are with all rights to save log and cache (alread set in composer install, but ...)
46+
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:
4747
```sh
48-
chmod -R 777 ./storage
48+
mkdir storage/framework \
49+
&& mkdir storage/framework/cache \
50+
&& mkdir storage/framework/cache/data \
51+
&& mkdir storage/framework/sessions \
52+
&& mkdir storage/framework/views \
53+
&& chmod -R 777 ./storage
4954
```
5055

5156
To check the build for this project look at ./ops/docker/dev folder.
@@ -70,12 +75,6 @@ Now you can access the health-check [http://localhost:8101](http://localhost:810
7075
}
7176
```
7277

73-
### Requests samples
74-
75-
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`.
76-
77-
Not all requests are documented yet (Work in progress)
78-
7978
### Creating your automatic crud domain
8079

8180
For create your brand new domain with a complete crud use the command:
@@ -105,6 +104,38 @@ This command will create a folder in `app/Domains`, new files in `routes`, `data
105104
php artisan migration
106105
```
107106

107+
### Requests samples
108+
109+
Within the `/ops/requests` folder, you'll discover a collection of sample requests showcasing.
110+
111+
Requests have been meticulously documented in three different formats for your convenience:
112+
113+
1. Postman Collections
114+
115+
Files: `postman_collection.json` and `postman_environments.json`
116+
117+
Tool: Postman
118+
119+
These collections provide a comprehensive overview of the available API requests. Import them into Postman to explore and execute requests seamlessly.
120+
121+
122+
2. Visual Studio Code (VSCode) REST Client Extension:
123+
124+
File: `requests.http`
125+
126+
Extension: [REST Client](https://marketplace.visualstudio.com/items?itemName=humao.rest-client)
127+
128+
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.
129+
130+
131+
3. CURL Commands:
132+
133+
File: `requests.curl`
134+
135+
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.
136+
137+
Choose the documentation format that aligns with your preferred workflow and start seamlessly interacting with the API.
138+
108139
### Ulid
109140

110141
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
@@ -34,7 +34,7 @@
3434
},
3535
"scripts": {
3636
"post-install-cmd": [
37-
"chmod -R 777 storage"
37+
"./ops/folders.sh"
3838
],
3939
"checkall" : [
4040
"@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)