Skip to content

Commit cf0427e

Browse files
committed
init
0 parents  commit cf0427e

36 files changed

Lines changed: 9300 additions & 0 deletions

.editorconfig

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
root = true
2+
3+
[*]
4+
charset = utf-8
5+
end_of_line = lf
6+
indent_size = 4
7+
indent_style = space
8+
insert_final_newline = true
9+
trim_trailing_whitespace = true
10+
11+
[*.md]
12+
trim_trailing_whitespace = false
13+
14+
[*.{yml,yaml}]
15+
indent_size = 2
16+
17+
[{compose,docker-compose}.{yml,yaml}]
18+
indent_size = 4

.env.example

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
APP_NAME=Laravel
2+
APP_ENV=local
3+
APP_KEY=
4+
APP_DEBUG=true
5+
APP_URL=http://localhost
6+
7+
APP_LOCALE=en
8+
APP_FALLBACK_LOCALE=en
9+
APP_FAKER_LOCALE=en_US
10+
11+
APP_MAINTENANCE_DRIVER=file
12+
# APP_MAINTENANCE_STORE=database
13+
14+
# PHP_CLI_SERVER_WORKERS=4
15+
16+
BCRYPT_ROUNDS=12
17+
18+
LOG_CHANNEL=stack
19+
LOG_STACK=single
20+
LOG_DEPRECATIONS_CHANNEL=null
21+
LOG_LEVEL=debug
22+
23+
DB_CONNECTION=sqlite
24+
# DB_HOST=127.0.0.1
25+
# DB_PORT=3306
26+
# DB_DATABASE=laravel
27+
# DB_USERNAME=root
28+
# DB_PASSWORD=
29+
30+
SESSION_DRIVER=file
31+
SESSION_LIFETIME=120
32+
SESSION_ENCRYPT=false
33+
SESSION_PATH=/
34+
SESSION_DOMAIN=null
35+
36+
BROADCAST_CONNECTION=log
37+
FILESYSTEM_DISK=local
38+
QUEUE_CONNECTION=sync
39+
40+
CACHE_STORE=file
41+
# CACHE_PREFIX=
42+
43+
MEMCACHED_HOST=127.0.0.1
44+
45+
REDIS_CLIENT=phpredis
46+
REDIS_HOST=127.0.0.1
47+
REDIS_PASSWORD=null
48+
REDIS_PORT=6379
49+
50+
MAIL_MAILER=log
51+
MAIL_SCHEME=null
52+
MAIL_HOST=127.0.0.1
53+
MAIL_PORT=2525
54+
MAIL_USERNAME=null
55+
MAIL_PASSWORD=null
56+
MAIL_FROM_ADDRESS="hello@example.com"
57+
MAIL_FROM_NAME="${APP_NAME}"
58+
59+
AWS_ACCESS_KEY_ID=
60+
AWS_SECRET_ACCESS_KEY=
61+
AWS_DEFAULT_REGION=us-east-1
62+
AWS_BUCKET=
63+
AWS_USE_PATH_STYLE_ENDPOINT=false
64+
65+
VITE_APP_NAME="${APP_NAME}"

.gitattributes

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
* text=auto eol=lf
2+
3+
*.blade.php diff=html
4+
*.css diff=css
5+
*.html diff=html
6+
*.md diff=markdown
7+
*.php diff=php
8+
9+
LICENSE export-ignore
10+
/.github/copilot-instructions.md export-ignore
11+
/.github/workflows/copilot-setup-steps.yml export-ignore
12+
/.github/agents export-ignore
13+
composer.lock export-ignore
14+
/docs export-ignore

.github/workflows/cron.yml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: cron
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *' #UTC
7+
8+
jobs:
9+
cron:
10+
name: cron
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout
15+
uses: actions/checkout@v6
16+
17+
- name: Setup PHP, with composer and extensions
18+
uses: shivammathur/setup-php@v2 #https://github.com/shivammathur/setup-php
19+
with:
20+
php-version: 8.5
21+
coverage: none
22+
23+
- name: Install Composer dependencies
24+
run: composer install --no-dev -q
25+
26+
- name: Copy Environment File
27+
run: cp .env.example .env
28+
29+
- name: Generate Application Key
30+
run: php artisan key:generate
31+
32+
- name: Run Command
33+
run: php artisan inspire

.github/workflows/lint.yml

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
name: linter
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
permissions:
14+
contents: write
15+
16+
jobs:
17+
quality:
18+
runs-on: ubuntu-latest
19+
environment: Testing
20+
steps:
21+
- uses: actions/checkout@v6
22+
23+
- name: Setup PHP
24+
uses: shivammathur/setup-php@v2
25+
with:
26+
php-version: 8.5
27+
28+
- name: Install Dependencies
29+
run: |
30+
composer install -q --no-ansi --no-interaction --no-scripts --no-progress --prefer-dist
31+
32+
- name: Run Pint
33+
run: composer run lint:check
34+
35+
# - name: Commit Changes
36+
# uses: stefanzweifel/git-auto-commit-action@v5
37+
# with:
38+
# commit_message: fix code style
39+
# commit_options: '--no-verify'
40+
# file_pattern: |
41+
# **/*
42+
# !.github/workflows/*

.github/workflows/tests.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: tests
2+
3+
on:
4+
push:
5+
branches:
6+
- develop
7+
- main
8+
pull_request:
9+
branches:
10+
- develop
11+
- main
12+
13+
jobs:
14+
ci:
15+
runs-on: ubuntu-latest
16+
environment: Testing
17+
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v6
21+
22+
- name: Setup PHP
23+
uses: shivammathur/setup-php@v2
24+
with:
25+
php-version: 8.5
26+
coverage: xdebug
27+
28+
- name: Install Dependencies
29+
run: composer install --no-interaction --prefer-dist --optimize-autoloader
30+
31+
- name: Copy Environment File
32+
run: cp .env.example .env
33+
34+
- name: Generate Application Key
35+
run: php artisan key:generate
36+
37+
- name: Run Tests
38+
run: php artisan test

.github/workflows/update.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: update
2+
3+
on:
4+
workflow_dispatch:
5+
schedule:
6+
- cron: '0 0 * * *' #UTC
7+
8+
jobs:
9+
composer:
10+
uses: kawax/composer-workflow/.github/workflows/update.yml@v1
11+
secrets:
12+
token: ${{ secrets.GITHUB_TOKEN }}
13+
with:
14+
php: latest

.gitignore

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
*.log
2+
.DS_Store
3+
.env
4+
.env.backup
5+
.env.production
6+
.phpactor.json
7+
.phpunit.result.cache
8+
/.codex
9+
/.cursor/
10+
/.idea
11+
/.nova
12+
/.phpunit.cache
13+
/.vscode
14+
/.zed
15+
/auth.json
16+
/node_modules
17+
/public/build
18+
/public/hot
19+
/public/storage
20+
/storage/*.key
21+
/storage/pail
22+
/vendor
23+
_ide_helper.php
24+
Homestead.json
25+
Homestead.yaml
26+
Thumbs.db

README.md

Lines changed: 139 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
# Laravel Console Starter
2+
3+
A streamlined Laravel starter kit for building applications with custom artisan commands.
4+
5+
This starter kit accelerates the development of Laravel applications that primarily use artisan commands for their functionality. Instead of building standalone CLI tools, you create powerful Laravel console applications that leverage the full Laravel framework ecosystem - including dependency injection, notifications, scheduling, and testing tools. Perfect for building scheduled tasks, data processing workflows, monitoring scripts, and automated maintenance tools that benefit from Laravel's robust architecture without the web application overhead.
6+
7+
[![Ask DeepWiki](https://deepwiki.com/badge.svg)](https://deepwiki.com/invokable/laravel-console-starter)
8+
9+
> **Note:** If you would like to create a console only project based on the latest official Laravel skeleton, you can also use the [laravel-slim](https://github.com/invokable/laravel-slim) package.
10+
11+
12+
## Key Features
13+
- **Focus on Console Applications:** Streamlined for building Laravel applications with artisan commands, removing web-specific overhead.
14+
- **Artisan Command Ready:** Quickly generate and organize your console commands using `php artisan make:command`.
15+
- **Scheduled Tasks with GitHub Actions:** Includes a pre-configured example (`.github/workflows/cron.yml`) for running your commands on a schedule using GitHub Actions.
16+
- **Laravel Framework Power:** Leverage familiar Laravel features like its robust dependency injection container, event system, configuration management, and application testing tools for your console applications.
17+
18+
## Requirements
19+
- PHP ^8.3
20+
- Laravel Framework ^13.0
21+
- Laravel Installer ^5.24
22+
23+
## Installation
24+
25+
```shell
26+
laravel new --using=revolution/laravel-console-starter --no-interaction my-app
27+
```
28+
29+
## Usage
30+
31+
### Make a new command
32+
33+
```shell
34+
php artisan make:command Hello --command=hello
35+
```
36+
This will create a new command class in `app/Console/Commands/Hello.php`. The `--command=hello` option sets the invokable name of your command, so you can run it later using `php artisan hello`.
37+
38+
### Task Scheduling in GitHub Actions
39+
40+
[cron.yml](./.github/workflows/cron.yml) is an example of how to run the command in GitHub Actions.
41+
This workflow file demonstrates how to set up a cron-like schedule to execute your Artisan commands automatically. You'll need to customize it with the specific commands you want to run and their desired frequency. Remember to configure repository secrets for any sensitive information your commands might need (e.g., API keys, database credentials).
42+
43+
## Notifications
44+
45+
Laravel's built-in notification system provides a convenient way to send notifications from your console commands. This is particularly useful for:
46+
47+
- Alerting you when a long-running task completes.
48+
- Reporting errors or issues encountered during command execution.
49+
- Sending updates or summaries to email, Slack, or other chat platforms.
50+
51+
To use this feature, you'll typically create a notification class (e.g., using `php artisan make:notification TaskCompleted`) and then send it using the `Notification` facade. You will need to configure your desired notification channels (like mail, Slack, etc.) in your Laravel application. When configuring notification channels, especially those relying on external services or specific mail drivers, you may need to publish the relevant configuration files if they don't already exist in your `config` directory. You can do this using the following Artisan commands:
52+
53+
```shell
54+
php artisan config:publish mail
55+
php artisan config:publish services
56+
```
57+
58+
The `config/mail.php` file allows you to configure your mailer settings, while `config/services.php` is used to store credentials and settings for various third-party services that Laravel can integrate with for notifications (e.g., Slack, Vonage). For detailed setup and usage, please refer to the official [Laravel Notification documentation](https://laravel.com/docs/notifications).
59+
60+
## Application Ideas
61+
62+
Here are some ideas for applications that can be built using this starter kit:
63+
64+
### Monitoring and Analytics
65+
- Website uptime monitoring with Slack alerts
66+
- Server resource usage reports via email
67+
- SSL certificate expiration checks and email notifications
68+
- Competitor price change tracking with Discord notifications
69+
- API response time monitoring and alerts
70+
- Website performance score (Lighthouse) periodic checks
71+
72+
### Finance and Business
73+
- Send Google AdSense revenue via email
74+
- Notify AWS costs to Discord
75+
- Daily cryptocurrency portfolio updates to Discord
76+
- Stock price alerts to Slack channels
77+
- Invoice payment deadline reminders
78+
- Monthly expense report generation and delivery
79+
- Subscription renewal alerts
80+
81+
### Data Processing and Reports
82+
- Old log file cleanup and storage space reports
83+
- Data synchronization between different APIs with result reports
84+
- CSV data import and processing result notifications
85+
- Cache cleanup and optimization reports
86+
- Periodic data exports and uploads to cloud storage
87+
88+
### Content and Marketing
89+
- Website broken link checks and reports
90+
- SEO keyword ranking monitoring and change notifications
91+
- Social media follower count change reports
92+
- Blog post performance metrics weekly reports
93+
- Content publication schedule reminders
94+
- RSS feed content aggregation and notifications
95+
- Email marketing campaign result reports
96+
97+
### Development and DevOps
98+
- GitHub repository dependency security alerts
99+
- Codebase static analysis reports
100+
- Test coverage report generation and notifications
101+
- Post-deployment application health checks
102+
- Unused cloud resource detection and notifications
103+
- API documentation change detection and notifications
104+
- Codebase TODO comment aggregation and reminders
105+
106+
### Personal Productivity
107+
- Daily morning weather forecast notifications
108+
- Calendar event daily summaries
109+
- Habit tracking and reminders
110+
- Subscription service renewal date notifications
111+
- Important dates and anniversary reminders
112+
- Regular backup reminders
113+
- Health data aggregation and trend reports
114+
115+
### Additional Ideas
116+
117+
- Building AI agent tools using [laravel-copilot-sdk](https://github.com/invokable/laravel-copilot-sdk) etc.
118+
- Building a local MCP server using the [laravel/mcp](https://github.com/laravel/mcp) package
119+
- Domain expiration monitoring and alerts
120+
- Suspicious access pattern detection from server logs
121+
- Unusual financial transaction detection reports
122+
- Automated OCR processing and results summary
123+
- Google Trends keyword monitoring and notifications
124+
- YouTube channel performance data aggregation
125+
- CI/CD failure trend analysis
126+
- Laravel package update detection alerts
127+
- Personal spending category insights and visual reports
128+
- Daily journal sentiment analysis and summaries
129+
130+
## Documentation
131+
132+
For detailed usage instructions and examples, please refer to our comprehensive tutorials:
133+
134+
- [Tutorial (English)](./docs/tutorial.md)
135+
- [チュートリアル (日本語)](./docs/tutorial_ja.md)
136+
- [Database](./docs/database.md)
137+
138+
## LICENSE
139+
MIT

0 commit comments

Comments
 (0)