Skip to content

Commit 0483737

Browse files
author
root
committed
added comprehensive readme
1 parent 038cb91 commit 0483737

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+7672
-71059
lines changed

.env.docker

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,18 @@ APP_LOG_LEVEL=debug
66
APP_URL=http://laravel.dev
77
APP_DOMAIN=laravel.dev
88

9-
API_DOMAIN=api.laravel.dev
10-
API_DEBUG=true
11-
API_STANDARDS_TREE=vnd
12-
API_SUBTYPE=apisubtype
9+
JWT_SECRET=d4ss58MG60wUGVeSRDg8vTRovXyFX0YO
10+
API_STANDARDS_TREE=x
11+
API_SUBTYPE=starterpack
12+
API_DOMAIN=api.fb.dev
1313
API_VERSION=v1
14-
API_NAME="Laravel Dev Api"
14+
API_NAME="Fb Api"
15+
API_STRICT=false
16+
API_DEFAULT_FORMAT=json
17+
API_DEBUG=true
18+
1519
SIGN_UP_RELEASE_TOKEN=true
1620
PASSWORD_RESET_RELEASE_TOKEN=true
17-
JWT_SECRET=aYLINRYJugcmNYoZ8xDVJUh2EcibPduu
1821

1922
DB_CONNECTION=mysql
2023
DB_HOST=mysql
@@ -42,3 +45,8 @@ MAIL_PORT=2525
4245
MAIL_USERNAME=ccbcdcb6f224ce
4346
MAIL_PASSWORD=7ad210d0196bb5
4447

48+
FB_APP_ID=1291841020933336
49+
FB_APP_SECRET=ab2676e1ec89bae6a6dfa21bca286f29
50+
FB_GRAPH_VERSION=v2.9
51+
FB_REDIRECT_URL=http://api.fb.dev/fb/callback
52+

.env.example

Lines changed: 0 additions & 32 deletions
This file was deleted.

.env.simple

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
APP_ENV=local
2+
APP_KEY=base64:S3UF3QcIp+3nzPKsfkQ9Zr5/rOVvLUsxOA8JuN7zs50=
3+
APP_DEBUG=true
4+
APP_LOG_LEVEL=debug
5+
APP_URL=http://localhost
6+
APP_DOMAIN=fb.dev
7+
APP_NAME="Laravel Api"
8+
9+
DB_CONNECTION=sqlite
10+
11+
BROADCAST_DRIVER=log
12+
CACHE_DRIVER=file
13+
SESSION_DRIVER=file
14+
QUEUE_DRIVER=sync
15+
16+
REDIS_HOST=127.0.0.1
17+
REDIS_PASSWORD=null
18+
REDIS_PORT=6379
19+
20+
MAIL_DRIVER=smtp
21+
MAIL_HOST=mailtrap.io
22+
MAIL_PORT=2525
23+
MAIL_USERNAME=AddYourUsernameHere
24+
MAIL_PASSWORD=AddYourPasswordHere
25+
MAIL_ENCRYPTION=null
26+
27+
FB_APP_ID=AddYourAppIDHere
28+
FB_APP_SECRET=AddYourSecretHere
29+
FB_GRAPH_VERSION=v2.9
30+
FB_REDIRECT_URL=http://api.fb.dev/fb/callback
31+
32+
SIGN_UP_RELEASE_TOKEN=true
33+
PASSWORD_RESET_RELEASE_TOKEN=true
34+
35+
JWT_SECRET=d4ss58MG60wUGVeSRDg8vTRovXyFX0YO
36+
API_STANDARDS_TREE=x
37+
API_SUBTYPE=starterpack
38+
API_DOMAIN=api.fb.dev
39+
API_VERSION=v1
40+
API_NAME="Fb Api"
41+
API_STRICT=false
42+
API_DEFAULT_FORMAT=json
43+
API_DEBUG=true

Docs/API.md

Lines changed: 50 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
### Using Dingo Api
1+
# 1. Using Dingo Api
22

3-
#### using api.domain.com
3+
## 1.1. using api.domain.com
44
if you are using this. you need to uncomment at VerifyCsrfToken.php
55

66
Meaning you set you API_DOMAIN=api.domain.dev at your .env
@@ -10,7 +10,7 @@ protected $except = [
1010
];
1111
```
1212

13-
#### using prefix /api
13+
## 1.2. using prefix /api
1414
if you are using this you need this at VerifyCsrfToken.php
1515

1616
```
@@ -19,51 +19,81 @@ protected $except = [
1919
];
2020
```
2121

22-
#### Using Transformers
22+
## 1.3. Set Your ENV Variable OR Configure Your Config/api.php
2323

24-
#### Configuring Config/api.php
24+
Set Your ENV Variable
25+
[./config/api.php](../config/api.php)
26+
[.env](../.env.docker)
2527

28+
Note: You Cant Access Api End Point In your Browser , Only Via AJAX Request of Postman IF
2629

27-
#### Using Postman
28-
- Open [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en)
30+
```
31+
API_STRICT = true
32+
```
33+
34+
# 2. Testing Endpoint Using Postman
35+
36+
### 2.0.1. Download [Postman](https://chrome.google.com/webstore/detail/postman/fhbjgbiflinjbdggehcddcbncdddomop?hl=en)
37+
38+
39+
## 2.1. Create an Account and Login with your Postman Credentials
40+
41+
## 2.2. Add to Neccessary header
2942

30-
- add to header ,where API_SUBTYPE is define in our .env (Use for Accessing Specific Api Version)
43+
- where API_SUBTYPE is define in our .env (Use for Accessing Specific Api Version)
3144

3245
```
3346
Accept: application/vnd.YOUR_SUBTYPE.v1+json
3447
```
3548

3649

37-
- Make Post Request to login
50+
## 2.3. Make Post Request to login
3851

52+
### 2.3.1. URL to Hit
3953
```
4054
http://api.laravel.dev/auth/login
4155
or
4256
http://laravel.dev/auth/login
4357
```
4458

45-
- Add to Body
59+
### 2.3.2. Add to Body
4660
```
4761
email = admin@laravel.dev
4862
password = password
4963
```
64+
## 2.4. We Get the Access Token (JWT)
65+
5066

51-
- You will see Response something like this
5267
```
5368
{
5469
"status": "ok",
5570
"token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJzdWIiOjEsImlzcyI6Imh0dHA6XC9cL2FwaS5sYXJhdmVsLmRldlwvYXV0aFwvbG9naW4iLCJpYXQiOjE0ODkzMzI1OTcsImV4cCI6MTQ4OTM5NzM5NywibmJmIjoxNDg5MzMyNTk3LCJqdGkiOiJjODMxNTMzZjkzMGFiOTkzMGExMzhkMGNkOTI5NGI3ZCJ9.3v-cGtXA-ySmL67pp4kZ4U4Mf3v7ge_CzUEdWIRKSeM"
5671
}
5772
```
58-
If .env
59-
```
60-
API_STRICT = true
61-
```
62-
Header
6373

64-
Key:
65-
Accept
74+
# 3. Returning a response with cookie
6675

67-
Value:
68-
application/x.apisubtype.v1+json
76+
Note: our ENV
6977

78+
SESSION_DOMAIN=.laravel.dev
79+
80+
You can Do this Inside Your Controller
81+
```
82+
83+
$name = 'samplecookie';
84+
$value = 'my-cookie';
85+
$minutes = 60;
86+
$path = '/';
87+
$domain = 'api.laravel.dev';
88+
$secure = false;
89+
$httpOnly =false;
90+
return response()
91+
->json([
92+
'status' => 'ok',
93+
'token' => $token,
94+
'firstName' => $firstname,
95+
'lastName' => $lastname,
96+
'email' => $email
97+
])->header('Authorization','Bearer ' . $token)
98+
->withCookie($name, $value, $minutes, $path, $domain, $secure, $httpOnly);
99+
```

Docs/BuefyStyling.md

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
#### Compiling Assets
2+
3+
npm run dev - this will compile your app for dev
4+
5+
npm run hot - enable hot reloading
6+
7+
npm run production - compile for production all minification are added here
8+
9+
npm run watch - if you enable browsersync this is command to run
10+
11+
npm run watch poll - if you the app is a bit sluggish you may need to run this instead of watch.
12+
13+
14+
#### Custom Styling
15+
16+
Edit: resources/assets/sass/app.scss
17+
18+
And Add All Your Custom CSS Here
19+
20+
Also Remember to uncomment this on your webpack.mix.js
21+
22+
after your first npm run dev
23+
24+
```
25+
// .sass('resources/assets/sass/app.scss', 'public/css')
26+
```
27+
28+
This File is Empty by Default.
29+
30+
31+
#### Changing Fonts
32+
33+
34+
You May reference or Use Font Awesome...
35+
36+
by defining it in your Buefy Constructor
37+
38+
39+
Path: resources\assets\js\app.js
40+
```
41+
Vue.use(Buefy, {
42+
defaultIconPack: 'fa',
43+
defaultContentElement: '#content',
44+
...
45+
})
46+
47+
```
48+
49+
Note: that The Default Icon is Material Icon
50+
and is reference in our
51+
52+
resources/views/app.blade.php
53+
```
54+
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
55+
```
56+
57+
#### Edit Main Layout template
58+
59+
60+
resources\assets\js\views\Layouts\main.vue
61+
62+
Default :
63+
64+
You Check all [Variables Here](http://bulma.io/documentation/overview/variables/)
65+
66+
```
67+
<style lang="scss">
68+
// Import Bulma's core
69+
@import "~bulma/sass/utilities/_all";
70+
71+
// Set your colors
72+
$primary: #8c67ef;
73+
$primary-invert: findColorInvert($primary);
74+
$twitter: #4099FF;
75+
$twitter-invert: findColorInvert($twitter);
76+
77+
// Setup $colors to use as bulma classes (e.g. 'is-twitter')
78+
$colors: (
79+
"white": ($white, $black),
80+
"black": ($black, $white),
81+
"light": ($light, $light-invert),
82+
"dark": ($dark, $dark-invert),
83+
"primary": ($primary, $primary-invert),
84+
"info": ($info, $info-invert),
85+
"success": ($success, $success-invert),
86+
"warning": ($warning, $warning-invert),
87+
"danger": ($danger, $danger-invert),
88+
"twitter": ($twitter, $twitter-invert)
89+
);
90+
91+
// Links
92+
$link: $primary;
93+
$link-invert: $primary-invert;
94+
$link-focus-border: $primary;
95+
96+
// Import Bulma and Buefy styles
97+
@import "~bulma";
98+
@import "~buefy/src/scss/buefy";
99+
</style>
100+
```
101+
102+
#### For more Info About Buefy Go to this [LINK](https://buefy.github.io/?#/documentation/quick-start)

0 commit comments

Comments
 (0)