Skip to content

Commit 63a4774

Browse files
committed
Moved .idea templates + githooks + init to laravel-base-dev + updated docer-compose.yml + added packages dir for easy local package development + fix laravel PSR-12 violations
1 parent 5535153 commit 63a4774

File tree

27 files changed

+76
-261
lines changed

27 files changed

+76
-261
lines changed

.idea/dataSources.local.xml

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

.idea/dataSources.xml

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

.idea/php.xml

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

.idea/workspace.xml

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

README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,16 @@ An opinionated base laravel install.
88
composer create-project thisisdevelopment/laravel-base <dir>
99
```
1010

11+
Or alternatively if you don't have composer installed locally:
12+
13+
```
14+
dir=<dir>
15+
git clone https://github.com/thisisdevelopment/laravel-base $dir
16+
cd $dir
17+
rm -rf .git
18+
./bin/dev init
19+
```
20+
1121
## Folder structure
1222

1323
This is modeled after the domain oriented structure proposed by sticher.io: https://stitcher.io/blog/laravel-beyond-crud-01-domain-oriented-laravel
@@ -20,6 +30,7 @@ The complete structure is
2030
- `app/Domain/<domain>` <= domain specific code
2131
- `app/Domain/vendor/<domain>` <= generic domain code (managed by composer, for packages with type=laravel-domain)
2232
- `app/Module/<module>` <= module code (managed by composer, for packages with type=laravel-module)
33+
- `packages/<package>/` <= composer wil automatically pickup any packages in this directory. This allows to develop packages alongside your application (see [packages/README.md](packages/README.md))
2334

2435
It uses `oomphinc/composer-installers-extender` to install packages of type laravel-module/laravel-domain to the `app/Module` and `app/Domain/vendor` folders.
2536

app/App/Console/Kernel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ protected function schedule(Schedule $schedule)
3434
*/
3535
protected function commands()
3636
{
37-
$this->load(__DIR__.'/Commands');
37+
$this->load(__DIR__ . '/Commands');
3838

3939
require base_path('routes/console.php');
4040
}

app/App/Http/Controllers/Controller.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99

1010
class Controller extends BaseController
1111
{
12-
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
12+
use AuthorizesRequests;
13+
use DispatchesJobs;
14+
use ValidatesRequests;
1315
}

app/App/Providers/RouteServiceProvider.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ public function map()
5959
protected function mapWebRoutes()
6060
{
6161
Route::middleware('web')
62-
->namespace($this->namespace)
63-
->group(base_path('routes/web.php'));
62+
->namespace($this->namespace)
63+
->group(base_path('routes/web.php'));
6464
}
6565

6666
/**
@@ -73,8 +73,8 @@ protected function mapWebRoutes()
7373
protected function mapApiRoutes()
7474
{
7575
Route::prefix('api')
76-
->middleware('api')
77-
->namespace($this->namespace)
78-
->group(base_path('routes/api.php'));
76+
->middleware('api')
77+
->namespace($this->namespace)
78+
->group(base_path('routes/api.php'));
7979
}
8080
}

bin/build

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
cd "$(dirname "$0")/../"
44

55
composer install
6+
npm install

bin/dev

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1-
#!/bin/bash -e
1+
#!/bin/bash
2+
3+
set -eu
24

35
cd $(dirname "$0")/../
6+
7+
if [ ! -d vendor/ ] || [ ! -f vendor/bin/dev ]; then
8+
docker-compose run --no-deps app composer install
9+
fi
10+
411
if [ -f vendor/bin/dev ]; then
512
exec vendor/bin/dev $@
613
else

0 commit comments

Comments
 (0)