-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66dfb94
commit 89ede06
Showing
10 changed files
with
270 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
APP_NAME="Laravel Boilerplate" | ||
APP_ENV=local | ||
APP_KEY=base64:fce65WkUOHQ9gGAmlpXgn1nY0dnZ3NVpJnELe93Lc6g= | ||
APP_DEBUG=true | ||
APP_URL=http://localhost | ||
|
||
SEED_ADMIN_EMAIL=[email protected] | ||
SEED_ADMIN_PASSWORD=admin_user | ||
|
||
SEED_USER_EMAIL=[email protected] | ||
SEED_USER_PASSWORD=regular_user | ||
|
||
# Misc | ||
APP_READ_ONLY=false | ||
APP_READ_ONLY_LOGIN=true | ||
DEBUGBAR_ENABLED=false | ||
LOG_CHANNEL=daily | ||
LOG_LEVEL=debug | ||
|
||
# Drivers | ||
DB_CONNECTION=mysql | ||
BROADCAST_DRIVER=log | ||
CACHE_DRIVER=file | ||
FILESYSTEM_DRIVER=local | ||
QUEUE_CONNECTION=sync | ||
SESSION_DRIVER=file | ||
SESSION_LIFETIME=120 | ||
|
||
# Database | ||
DB_HOST=127.0.0.1 | ||
DB_PORT=3306 | ||
DB_DATABASE=laravel | ||
DB_USERNAME=root | ||
DB_PASSWORD= | ||
|
||
# Cache | ||
MEMCACHED_HOST=127.0.0.1 | ||
|
||
# Queue | ||
REDIS_HOST=127.0.0.1 | ||
REDIS_PASSWORD=null | ||
REDIS_PORT=6379 | ||
|
||
MAIL_MAILER=smtp | ||
MAIL_HOST=smtp.mailtrap.io | ||
MAIL_PORT=2525 | ||
MAIL_USERNAME=null | ||
MAIL_PASSWORD=null | ||
MAIL_ENCRYPTION=null | ||
MAIL_FROM_ADDRESS=null | ||
MAIL_FROM_NAME="${APP_NAME}" | ||
|
||
# AWS | ||
AWS_ACCESS_KEY_ID= | ||
AWS_SECRET_ACCESS_KEY= | ||
AWS_DEFAULT_REGION=us-east-1 | ||
AWS_BUCKET= | ||
AWS_USE_PATH_STYLE_ENDPOINT=false | ||
|
||
# Pusher | ||
PUSHER_APP_ID= | ||
PUSHER_APP_KEY= | ||
PUSHER_APP_SECRET= | ||
PUSHER_APP_CLUSTER=mt1 | ||
|
||
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}" | ||
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}" | ||
|
||
# Application | ||
|
||
# Access | ||
ADMIN_REQUIRES_2FA=false | ||
CHANGE_EMAIL=false | ||
ENABLE_REGISTRATION=false | ||
PASSWORD_HISTORY=3 | ||
SINGLE_LOGIN=false | ||
PASSWORD_EXPIRES_DAYS=180 | ||
|
||
# Captcha | ||
# Get your credentials at: https://www.google.com/recaptcha/admin | ||
LOGIN_CAPTCHA_STATUS=false | ||
REGISTRATION_CAPTCHA_STATUS=false | ||
INVISIBLE_RECAPTCHA_SITEKEY= | ||
INVISIBLE_RECAPTCHA_SECRETKEY= | ||
|
||
# Socialite Providers | ||
FACEBOOK_ACTIVE=false | ||
BITBUCKET_ACTIVE=false | ||
GITHUB_ACTIVE=false | ||
GOOGLE_ACTIVE=false | ||
LINKEDIN_ACTIVE=false | ||
TWITTER_ACTIVE=false | ||
|
||
#FACEBOOK_CLIENT_ID= | ||
#FACEBOOK_CLIENT_SECRET= | ||
#FACEBOOK_REDIRECT=${APP_URL}/login/facebook/callback | ||
|
||
#BITBUCKET_CLIENT_ID= | ||
#BITBUCKET_CLIENT_SECRET= | ||
#BITBUCKET_REDIRECT=${APP_URL}/login/bitbucket/callback | ||
|
||
#GITHUB_CLIENT_ID= | ||
#GITHUB_CLIENT_SECRET= | ||
#GITHUB_REDIRECT=${APP_URL}/login/github/callback | ||
|
||
#GOOGLE_CLIENT_ID= | ||
#GOOGLE_CLIENT_SECRET= | ||
#GOOGLE_REDIRECT=${APP_URL}/login/google/callback | ||
|
||
#LINKEDIN_CLIENT_ID= | ||
#LINKEDIN_CLIENT_SECRET= | ||
#LINKEDIN_REDIRECT=${APP_URL}/login/linkedin/callback | ||
|
||
#TWITTER_CLIENT_ID= | ||
#TWITTER_CLIENT_SECRET= | ||
#TWITTER_REDIRECT=${APP_URL}/login/twitter/callback |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<?php | ||
|
||
namespace App\Http\Controllers\Backend; | ||
|
||
use App\Http\Controllers\Controller; | ||
use App\Domains\EventItem\Models\EventItem; | ||
use Illuminate\Http\Request; | ||
use App\Http\Resources\EventItemResource; | ||
use App\Http\Resources\EventCollectionResource; | ||
|
||
class EventApiController extends Controller | ||
{ | ||
/** | ||
* Display a listing of the resource. | ||
* | ||
* @return \Illuminate\Http\Resources\Json\AnonymousResourceCollection | ||
*/ | ||
public function index() | ||
{ | ||
return EventCollectionResource::collection(EventItem::all()); | ||
} | ||
|
||
|
||
/** | ||
* Display the specified resource. | ||
* | ||
* @param \App\Domains\EventItem\Models\EventItem $eventItem | ||
* @return \Illuminate\Http\JsonResponse | ||
*/ | ||
public function show(String $id) | ||
{ | ||
return new EventItemResource(EventItem::findOrFail($id)); | ||
|
||
} | ||
|
||
|
||
|
||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Http\Resources; | ||
|
||
use Illuminate\Http\Resources\Json\JsonResource; | ||
|
||
class EventCollectionResource extends JsonResource | ||
{ | ||
/** | ||
* Transform the resource into an array. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable | ||
*/ | ||
public function toArray($request) | ||
{ | ||
return [ | ||
'id' => $this->id, | ||
'title' => $this->title, | ||
'description' => $this->description, | ||
'enabled' => $this->enabled, | ||
'link_url' => $this->link_url, | ||
'link_caption' => $this->link_caption, | ||
'image' => $this->image, | ||
'created_at' => $this->created_at, | ||
'updated_at' => $this->updated_at, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
<?php | ||
|
||
namespace App\Http\Resources; | ||
|
||
use Illuminate\Http\Resources\Json\JsonResource; | ||
|
||
class EventItemResource extends JsonResource | ||
{ | ||
/** | ||
* Transform the resource into an array. | ||
* | ||
* @param \Illuminate\Http\Request $request | ||
* @return array|\Illuminate\Contracts\Support\Arrayable|\JsonSerializable | ||
*/ | ||
public function toArray($request):array | ||
{ | ||
return [ | ||
'id' => $this->id, | ||
'title' => $this->title, | ||
'description' => $this->description, | ||
//'enabled' => $this->enabled, | ||
'link_url' => $this->link_url, | ||
'link_caption' => $this->link_caption, | ||
'image' => $this->image, | ||
'created_at' => $this->created_at, | ||
'updated_at' => $this->updated_at, | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?php | ||
|
||
namespace Database\Factories; | ||
|
||
use App\Domains\EventItem\Models\EventItem; | ||
use Illuminate\Database\Eloquent\Factories\Factory; | ||
|
||
class EventItemFactory extends Factory | ||
{ | ||
protected $model = EventItem::class; | ||
|
||
public function definition() | ||
{ | ||
return [ | ||
'title' => $this->faker->sentence, | ||
'description' => $this->faker->paragraph, | ||
'enabled' => $this->faker->boolean, | ||
'link_url' => $this->faker->url, | ||
'link_caption' => $this->faker->words(3, true), | ||
'image' => 'EventImages/' . $this->faker->image('public/storage/EventImages', 640, 480, null, false), | ||
]; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,3 +36,5 @@ public function down() | |
Schema::dropIfExists('event_items'); | ||
} | ||
} | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<?php | ||
|
||
namespace Database\Seeders; | ||
|
||
use Illuminate\Database\Seeder; | ||
use App\Domains\EventItem\Models\EventItem; | ||
|
||
class EventSeeder extends Seeder | ||
{ | ||
/** | ||
* Run the database seeds. | ||
* | ||
* @return void | ||
*/ | ||
public function run() | ||
{ | ||
// Create 10 event items using the factory | ||
EventItem::factory()->count(10)->create(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters