Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove git submodule for adminlte #98

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

11 changes: 2 additions & 9 deletions app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,8 @@

namespace App\Models;

use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
use WebAppId\User\Models\User as BaseUser;

class User extends Authenticatable
class User extends BaseUser
{
use Notifiable;

protected $fillable = ['id', 'status_id', 'name', 'email', 'password'];

protected $hidden = ['password', 'remember_token', 'created_at', 'updated_at'];

}
63 changes: 36 additions & 27 deletions app/Repositories/PlaceRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
use WebAppId\Content\Repositories\ContentCategoryRepository;
use WebAppId\Content\Repositories\ContentRepository;
use WebAppId\Content\Repositories\TimeZoneRepository;
use WebAppId\Content\Services\Params\AddContentCategoryParam;
use WebAppId\Content\Services\Params\AddContentParam;

/**
* Class PlaceRepository
Expand All @@ -25,7 +27,6 @@ class PlaceRepository extends ContentRepository

public function __construct()
{

$this->contentCategoryRepository = new ContentCategoryRepository();
$this->contentRepository = new ContentRepository();
$this->timezoneRepository = new TimeZoneRepository();
Expand All @@ -41,32 +42,42 @@ public function __construct()
*/
private function createContentCategory($contentId, $categoryId, $userId)
{
$objContentCategory = new \StdClass;
$objContentCategory->content_id = $contentId;
$objContentCategory->categories_id = $categoryId;
$objContentCategory->user_id = $userId;
$objContentCategory = new AddContentCategoryParam();
$objContentCategory->setContentId($contentId);
$objContentCategory->setCategoryId($categoryId);
$objContentCategory->setUserId($userId);
return $this->contentCategoryRepository->addContentCategory($objContentCategory, new ContentCategory());
}

/**
* @param $placeProperties
* @param $code
* @param $keyword
* @param $listPlace
* @param $timezone
* @param $owner_id
* @param $user_id
* @return \WebAppId\Content\Models\Content|null
*/
public function addPlace($placeProperties, $code, $keyword, $listPlace, $timezone, $owner_id, $user_id)
{
$objContent = new \StdClass;
$objContent->title = $placeProperties['Name'];
$objContent->code = $code;
$objContent->description = $placeProperties['Name'];
$objContent->keyword = $keyword;
$objContent->og_title = $placeProperties['Name'];
$objContent->og_description = $placeProperties['Name'];
$objContent->default_image = '1';
$objContent->status_id = '2';
$objContent->language_id = '1';
$objContent->publish_date = Carbon::now('UTC');
$objContent->additional_info = $listPlace;
$objContent->content = $placeProperties['description'] == null ? '' : $placeProperties['description'];
$objContent->time_zone_id = $timezone->id;
$objContent->creator_id = $user_id;
$objContent->owner_id = $owner_id;
$objContent->user_id = $user_id;
$objContent = new AddContentParam();
$objContent->setTitle($placeProperties['Name']);
$objContent->setCode($code);
$objContent->setDescription($placeProperties['Name']);
$objContent->setKeyword($keyword);
$objContent->setOgTitle($placeProperties['Name']);
$objContent->setOgDescription($placeProperties['Name']);
$objContent->setDefaultImage(1);
$objContent->setStatusId(2);
$objContent->setLanguageId(1);
$objContent->setPublishDate(Carbon::now('UTC'));
$objContent->setAdditionalInfo($listPlace);
$objContent->setContent($placeProperties['description'] == null ? '' : $placeProperties['description']);
$objContent->setTimeZoneId($timezone->id);
$objContent->setCreatorId($user_id);
$objContent->setOwnerId($owner_id);
$objContent->setUserId($user_id);

$result = $this->addContent($objContent, new Place());

Expand Down Expand Up @@ -132,11 +143,11 @@ public function getPlaceById($id)
}

/**
* @return \WebAppId\Content\Models\Content
* @return object|null
*/
public function getAllPlace()
{
return $this->contentRepository->getAll(new Place());
return $this->contentRepository->getAll(new Place(), '2');
}

/**
Expand All @@ -158,7 +169,7 @@ public function getList($type = null, $paginate = null)
->orWhere('categories.name', 'shelter')
->paginate($paginate);
} else {
$place->select(
return $place->select(
'contents.*',
'categories.name as type'
)
Expand All @@ -167,8 +178,6 @@ public function getList($type = null, $paginate = null)
->where('categories.name', $type)
->paginate($paginate);
}


}

/**
Expand Down
54 changes: 0 additions & 54 deletions app/Repositories/RoleRepository.php

This file was deleted.

76 changes: 0 additions & 76 deletions app/Repositories/UserRepository.php

This file was deleted.

3 changes: 2 additions & 1 deletion app/Services/PlaceService.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
use App\Repositories\ContentGeometryCoordinateRepository;
use App\Repositories\ContentGeometryRepository;
use App\Repositories\PlaceRepository;
use Illuminate\Database\Eloquent\Collection;
use Illuminate\Support\Facades\Auth;
use WebAppId\Content\Models\TimeZone;
use WebAppId\Content\Repositories\TimeZoneRepository;
Expand Down Expand Up @@ -49,7 +50,7 @@ public function getListPosko($search)
}

/**
* @return \WebAppId\Content\Models\Content
* @return object|Collection
*/
public function getAllPosko()
{
Expand Down
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"license": "MIT",
"type": "project",
"require": {
"php": ">=7.0.0",
"php": ">=7.2.0",
"ext-json": "*",
"cornford/googlmapper": "2.*",
"doctrine/dbal": "^2.7",
Expand All @@ -20,7 +20,8 @@
"laravolt/indonesia": "^0.8.0",
"sentry/sentry-laravel": "^0.9.0",
"webappid/content": "^2.0",
"webappid/laravel-smartnotify": "^1.0"
"webappid/laravel-smartnotify": "^1.0",
"webappid/laravel-user": "^1.4"
},
"require-dev": {
"filp/whoops": "~2.0",
Expand Down
Loading