Skip to content

Commit 944c883

Browse files
committed
add readme file
1 parent 3017ed0 commit 944c883

File tree

10 files changed

+51
-39
lines changed

10 files changed

+51
-39
lines changed

.vitepress/config.mts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export default defineConfig({
1111
siteTitle: 'LaraGram',
1212
logo: '/assets/LaraGram.svg',
1313
outline: 'deep',
14+
1415
head: [
1516
['link', {rel: 'icon', href: '/assets/favicon.ico'}]
1617
],

src/deployment.md

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The LaraGram framework has a few system requirements. You should ensure that you
1212

1313
<div class="content-list" markdown="1">
1414

15-
- PHP >= 8.2
15+
- PHP >=` 8.2`
1616
- Ctype PHP Extension
1717
- cURL PHP Extension
1818
- Fileinfo PHP Extension
@@ -41,34 +41,36 @@ server {
4141
listen 80;
4242
listen [::]:80;
4343
server_name example.com;
44+
4445
root /srv/example.com/public;
45-
46-
add_header X-Frame-Options "SAMEORIGIN";
47-
add_header X-Content-Type-Options "nosniff";
48-
4946
index index.php;
50-
5147
charset utf-8;
48+
49+
add_header X-Content-Type-Options "nosniff";
50+
add_header X-Frame-Options "DENY";
51+
add_header X-Robots-Tag "noindex, nofollow";
5252
5353
location / {
54-
try_files $uri $uri/ /index.php?$query_string;
54+
try_files $uri /index.php$is_args$args;
5555
}
56-
57-
location = /favicon.ico { access_log off; log_not_found off; }
58-
location = /robots.txt { access_log off; log_not_found off; }
59-
60-
error_page 404 /index.php;
61-
56+
6257
location ~ ^/index\.php(/|$) {
6358
fastcgi_pass unix:/var/run/php/php8.2-fpm.sock;
64-
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
59+
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
6560
include fastcgi_params;
6661
fastcgi_hide_header X-Powered-By;
6762
}
68-
63+
64+
location ~ \.php$ {
65+
return 404;
66+
}
67+
6968
location ~ /\.(?!well-known).* {
7069
deny all;
7170
}
71+
72+
location = /favicon.ico { access_log off; log_not_found off; }
73+
location = /robots.txt { return 403; }
7274
}
7375
```
7476

src/facades.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -168,22 +168,22 @@ Injecting a publisher implementation into the method allows us to easily test th
168168

169169
namespace App\Models;
170170

171-
use App\Contracts\Publisher; // [tl! remove]
172-
use Facades\App\Contracts\Publisher; // [tl! add]
171+
use App\Contracts\Publisher; // [!code --]
172+
use Facades\App\Contracts\Publisher; // [!code ++]
173173
use LaraGram\Database\Eloquent\Model;
174174

175175
class Podcast extends Model
176176
{
177177
/**
178178
* Publish the podcast.
179179
*/
180-
public function publish(Publisher $publisher): void // [tl! remove]
181-
public function publish(): void // [tl! add]
180+
public function publish(Publisher $publisher): void // [!code --]
181+
public function publish(): void // [!code ++]
182182
{
183183
$this->update(['publishing' => now()]);
184184

185-
$publisher->publish($this); // [tl! remove]
186-
Publisher::publish($this); // [tl! add]
185+
$publisher->publish($this); // [!code --]
186+
Publisher::publish($this); // [!code ++]
187187
}
188188
}
189189
```

src/installation.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,21 @@ Before creating your first LaraGram application, make sure that your local machi
3737

3838
If you don't have PHP and Composer installed on your local machine, the following commands will install PHP, Composer, and the LaraGram installer on macOS, Windows, or Linux:
3939

40-
```shell tab=macOS
40+
::: code-group
41+
42+
```shell [macOS]
4143
/bin/bash -c "$(curl -fsSL https://php.new/install/mac/8.4)"
4244
```
4345

44-
```shell tab=Windows PowerShell
46+
```shell [Windows PowerShell]
4547
# Run as administrator...
4648
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://php.new/install/windows/8.4'))
4749
```
4850

49-
```shell tab=Linux
51+
```shell [Linux]
5052
/bin/bash -c "$(curl -fsSL https://php.new/install/linux/8.4)"
5153
```
54+
:::
5255

5356
After running one of the commands above, you should restart your terminal session. To update PHP, Composer, and the LaraGram installer after installing them via `php.new`, you can re-run the command in your terminal.
5457

src/listening.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -777,7 +777,7 @@ use LaraGram\Support\Facades\RateLimiter;
777777
protected function boot(): void
778778
{
779779
RateLimiter::for('bot', function (Request $request) {
780-
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
780+
return Limit::perMinute(60)->by($request->user()?->id ?: user()->id);
781781
});
782782
}
783783
```

src/logging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ As mentioned previously, the `stack` driver allows you to combine multiple chann
122122
'channels' => [
123123
'stack' => [
124124
'driver' => 'stack',
125-
'channels' => ['syslog', 'slack'], // [tl! add]
125+
'channels' => ['syslog', 'slack'], // [!code ++]
126126
'ignore_exceptions' => false,
127127
],
128128

src/middleware.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ LaraGram includes predefined `bot` middleware groups that contain common middlew
228228

229229
<div class="overflow-auto">
230230

231-
| The `bot` Middleware Group |
232-
|----------------------------------------------------|
233-
| `LaraGram\Listening\Middleware\SubstituteBindings` |
231+
| The `bot` Middleware Group |
232+
|-----------------------------------------------------------|
233+
| `LaraGram\Listening\Middleware\Reply` |
234+
| `LaraGram\Listening\Middleware\Scope` |
235+
| `LaraGram\Listening\Middleware\Step` |
236+
| `LaraGram\Listening\Middleware\SubstituteBindings` |
237+
| `LaraGram\Listening\Middleware\ThrottleRequests` |
238+
| `LaraGram\Listening\Middleware\ThrottleRequestsWithRedis` |
234239

235240
</div>
236241

src/providers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ When you invoke the `make:provider` Commander command, LaraGram will automatical
163163

164164
return [
165165
App\Providers\AppServiceProvider::class,
166-
App\Providers\ComposerServiceProvider::class, // [tl! add]
166+
App\Providers\ComposerServiceProvider::class, // [!code ++]
167167
];
168168
```
169169

src/queries.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1563,20 +1563,20 @@ use LaraGram\Database\Query\Builder;
15631563
use LaraGram\Support\Facades\DB;
15641564

15651565
DB::table('flights')
1566-
->when($destination, function (Builder $query, string $destination) { // [tl! remove]
1567-
$query->where('destination', $destination); // [tl! remove]
1568-
}) // [tl! remove]
1569-
->tap(new DestinationFilter($destination)) // [tl! add]
1566+
->when($destination, function (Builder $query, string $destination) { // [!code --]
1567+
$query->where('destination', $destination); // [!code --]
1568+
}) // [!code --]
1569+
->tap(new DestinationFilter($destination)) // [!code ++]
15701570
->orderByDesc('price')
15711571
->get();
15721572

15731573
// ...
15741574

15751575
DB::table('flights')
1576-
->when($destination, function (Builder $query, string $destination) { // [tl! remove]
1577-
$query->where('destination', $destination); // [tl! remove]
1578-
}) // [tl! remove]
1579-
->tap(new DestinationFilter($destination)) // [tl! add]
1576+
->when($destination, function (Builder $query, string $destination) { // [!code --]
1577+
$query->where('destination', $destination); // [!code --]
1578+
}) // [!code --]
1579+
->tap(new DestinationFilter($destination)) // [!code ++]
15801580
->where('user', $request->user()->id)
15811581
->orderBy('destination')
15821582
->get();

src/requests.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ Through the Request class, you have access to all Telegram methods according to
166166
$request->sendMessage();
167167
$request->sendAnimation();
168168
$request->deleteMessage();
169+
// ...
169170
```
170171

171172
<a name="request-mode"></a>
@@ -192,7 +193,7 @@ $request->mode(64)->sendMessage();
192193

193194
| Enum Value | Int |
194195
|--------------------------|------|
195-
| `Mode::CURL` | `32` |
196+
| `Mode::CURL` (default) | `32` |
196197
| `Mode::NO_RESPONSE_CURL` | `64` |
197198

198199
<a name="multi-connections"></a>

0 commit comments

Comments
 (0)