Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
howtomakeaturn committed Apr 21, 2018
2 parents 4d7be6e + f353266 commit c230547
Show file tree
Hide file tree
Showing 210 changed files with 2,413 additions and 1,318 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?php

namespace App;
namespace Modules\NomadiCore;

class ApproveEditing
{

function handle()
{
$editing = \App\Editing::whereStatus(\App\Editing::CREATED_STATUS)
$editing = \Modules\NomadiCore\Editing::whereStatus(\Modules\NomadiCore\Editing::CREATED_STATUS)
->orderBy('created_at', 'asc')->first();

if ($editing && $editing->user->profile->score >= 10) $editing->approve();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;
use Carbon\Carbon;
Expand Down
4 changes: 2 additions & 2 deletions app/City.php → Modules/NomadiCore/City.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Config;
use DB;
Expand Down Expand Up @@ -182,7 +182,7 @@ static function getMapCenter($city)
}

// otherwise, let's calculate for it
$entities = Cafe::whereStatus(Cafe::APPROVED_STATUS)->whereCity($city)->get();
$entities = Entity::whereStatus(Entity::APPROVED_STATUS)->whereCity($city)->get();

$latArr = [];
$lngArr = [];
Expand Down
6 changes: 3 additions & 3 deletions app/Comment.php → Modules/NomadiCore/Comment.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;

Expand All @@ -9,12 +9,12 @@ class Comment extends Model

public function user()
{
return $this->belongsTo('App\User');
return $this->belongsTo('Modules\NomadiCore\User');
}

function entity()
{
return $this->belongsTo('App\Entity');
return $this->belongsTo('Modules\NomadiCore\Entity');
}

}
File renamed without changes.
5 changes: 5 additions & 0 deletions Modules/NomadiCore/Config/config.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

return [
'name' => 'NomadiCore'
];
Empty file.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;
use DB;
Expand Down
Empty file.
Empty file.
21 changes: 21 additions & 0 deletions Modules/NomadiCore/Database/Seeders/NomadiCoreDatabaseSeeder.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<?php

namespace Modules\NomadiCore\Database\Seeders;

use Illuminate\Database\Seeder;
use Illuminate\Database\Eloquent\Model;

class NomadiCoreDatabaseSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
Model::unguard();

// $this->call("OthersTableSeeder");
}
}
Empty file.
27 changes: 27 additions & 0 deletions Modules/NomadiCore/Discussion.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;

class Discussion extends Model
{

public $timestamps = false;

function posts()
{
return $this->hasMany('Modules\NomadiCore\Post');
}

function presentBlock()
{
return view('nomadicore::partial/_post-item', ['discussion' => $this]);
}

function presentBlockSimple()
{
return view('nomadicore::partial/_post-item-simple', ['discussion' => $this]);
}

}
12 changes: 8 additions & 4 deletions app/Editing.php → Modules/NomadiCore/Editing.php
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;
use App\Editing\Presenter;
use Modules\NomadiCore\Editing\Presenter;

class Editing extends Model
{
Expand Down Expand Up @@ -36,12 +36,12 @@ public function present()

function entity()
{
return $this->belongsTo('App\Entity');
return $this->belongsTo('Modules\NomadiCore\Entity');
}

function user()
{
return $this->belongsTo('App\User');
return $this->belongsTo('Modules\NomadiCore\User');
}

function isChanged($field)
Expand Down Expand Up @@ -108,6 +108,10 @@ function approve()

$this->entity->info_fields = json_encode($arr);

$this->entity->address = $this->address;

setupEntityCoordinate($this->entity);

$this->entity->save();
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php

namespace App\Editing;
namespace Modules\NomadiCore\Editing;

use Config;
use App\Editing;
use Modules\NomadiCore\Editing;

class Presenter
{
Expand Down
Empty file.
32 changes: 16 additions & 16 deletions app/Entity.php → Modules/NomadiCore/Entity.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;
use Illuminate\Database\Eloquent\Collection;
use Config;
use App\Cafe\Presenter;
use App\Cafe\Api;
use App\Facebook\FanPage;
use App\BusinessHour;
use Modules\NomadiCore\Cafe\Presenter;
use Modules\NomadiCore\Cafe\Api;
use Modules\NomadiCore\Facebook\FanPage;
use Modules\NomadiCore\BusinessHour;
use Laravel\Scout\Searchable;

class Entity extends Model
Expand Down Expand Up @@ -123,52 +123,52 @@ function presentCity()

function fan_page()
{
return $this->hasOne('App\Facebook\FanPage');
return $this->hasOne('Modules\NomadiCore\Facebook\FanPage');
}

function place_detail()
{
return $this->hasOne('App\GooglePlaceDetail');
return $this->hasOne('Modules\NomadiCore\GooglePlaceDetail');
}

function recommendations()
{
return $this->hasMany('App\Recommendation');
return $this->hasMany('Modules\NomadiCore\Recommendation');
}

function reviews()
{
return $this->hasMany('App\Review');
return $this->hasMany('Modules\NomadiCore\Review');
}

function comments()
{
return $this->hasMany('App\Comment');
return $this->hasMany('Modules\NomadiCore\Comment');
}

function wishes()
{
return $this->hasMany('App\Wish');
return $this->hasMany('Modules\NomadiCore\Wish');
}

function photos()
{
return $this->hasMany('App\Photo');
return $this->hasMany('Modules\NomadiCore\Photo');
}

public function tags()
{
return $this->belongsToMany('App\Tag');
return $this->belongsToMany('Modules\NomadiCore\Tag');
}

function business_hours()
{
return $this->hasMany('App\BusinessHour');
return $this->hasMany('Modules\NomadiCore\BusinessHour');
}

function donations()
{
return $this->hasMany('App\Donation');
return $this->hasMany('Modules\NomadiCore\Donation');
}

function uniqueTags()
Expand Down Expand Up @@ -404,7 +404,7 @@ function importFromFb($hours)
$close_time = null;
}

\App\BusinessHour::where('cafe_id', $this->id)->where('day', $businessHour->day)->update([
\Modules\NomadiCore\BusinessHour::where('cafe_id', $this->id)->where('day', $businessHour->day)->update([
'open_time' => $open_time,
'close_time' => $close_time
]);
Expand Down
8 changes: 4 additions & 4 deletions app/EntityTag.php → Modules/NomadiCore/EntityTag.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;

Expand All @@ -17,17 +17,17 @@ class EntityTag extends Model

function tag()
{
return $this->belongsTo('App\Tag');
return $this->belongsTo('Modules\NomadiCore\Tag');
}

function user()
{
return $this->belongsTo('App\User');
return $this->belongsTo('Modules\NomadiCore\User');
}

function cafe()
{
return $this->belongsTo('App\Cafe');
return $this->belongsTo('Modules\NomadiCore\Cafe');
}

}
2 changes: 1 addition & 1 deletion app/Event.php → Modules/NomadiCore/Event.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace App;
namespace Modules\NomadiCore;

use Illuminate\Database\Eloquent\Model;

Expand Down
Empty file.
Loading

0 comments on commit c230547

Please sign in to comment.