Skip to content
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
2 changes: 1 addition & 1 deletion config/kurt_modules.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'vimeo' => 'default',

/**
* `0`, `1`, `2`, `3`, `default`, `hqdefault`, `mqdefault`, `sddefault`, `maxresdefault`,
* `0`, `1`, `2`, `3`, `default`, `hqdefault`, `mqdefault`, `sddefault`, `maxresdefault`,
*/
'youtube' => 'default',
],
Expand Down
5 changes: 2 additions & 3 deletions src/Console/Commands/SeedCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class SeedCommand extends Command

/**
* Default configuration for seeding.
*
*
* @var array
*/
protected $settings = [
Expand All @@ -44,8 +44,7 @@ class SeedCommand extends Command
*/
public function handle()
{
if ($this->getUserModel()->count() == 0)
{
if ($this->getUserModel()->count() == 0) {
$this->info("There is no user in the database, cannot seed.");

$createUsers = $this->ask('Do you want to create some users? (y/N)');
Expand Down
5 changes: 3 additions & 2 deletions src/Http/Controllers/BlogController.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

/**
* Class BlogController
*
*
* @package Kurt\Modules\Blog\Http\Controllers
*/
class BlogController extends Controller
Expand All @@ -22,7 +22,8 @@ class BlogController extends Controller
/**
* Ready up blog repositories.
*/
public function __construct() {
public function __construct()
{
$this->blogCategoriesRepository = app(CategoriesRepositoryInterface::class);
$this->blogPostsRepository = app(PostsRepositoryInterface::class);
$this->blogTagsRepository = app(TagsRepositoryInterface::class);
Expand Down
1 change: 0 additions & 1 deletion src/Http/blogRoutes.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,4 @@
Route::get('welcome', function () {
return 'Welcome!';
});

});
10 changes: 5 additions & 5 deletions src/Models/Comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class Comment extends Model

/**
* Casts columns to requested types.
*
*
* @var array
*/
protected $casts = [
Expand All @@ -78,7 +78,7 @@ public static function boot()

/**
* Overwrite parents create to set a default approval state.
*
*
* @param static
*/
public static function create(array $attributes = [])
Expand Down Expand Up @@ -116,7 +116,7 @@ public function user()

/**
* Get is the comment is approved.
*
*
* @return boolean
*/
public function isApproved()
Expand All @@ -126,7 +126,7 @@ public function isApproved()

/**
* Update the comment as approved in the database.
*
*
* @return $this
*/
public function approve($state = true)
Expand All @@ -140,7 +140,7 @@ public function approve($state = true)

/**
* Update the comment as disapproved in the database.
*
*
* @return $this
*/
public function disapprove()
Expand Down
6 changes: 3 additions & 3 deletions src/Models/Model.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

use Illuminate\Database\Eloquent\Model as Eloquent;

class Model extends Eloquent {
class Model extends Eloquent
{

private $defaultModels = [
'category' => Category::class,
Expand All @@ -25,5 +26,4 @@ protected function getModel($modelKey)

return $customModelClass;
}

}
}
38 changes: 19 additions & 19 deletions src/Models/Post.php
Original file line number Diff line number Diff line change
Expand Up @@ -253,10 +253,10 @@ public function getTagsCountAttribute($value)

/**
* Popularity by view count.
*
*
* @param [type] $query [description]
* @param boolean $descending [description]
*
*
* @return [type] [description]
*/
public function scopePopular($query, $descending = true)
Expand All @@ -266,10 +266,10 @@ public function scopePopular($query, $descending = true)

/**
* [scopeInCategory description]
*
*
* @param [type] $query [description]
* @param [type] $categoryId [description]
*
*
* @return [type] [description]
*/
public function scopeInCategory($query, $categoryId)
Expand All @@ -279,11 +279,11 @@ public function scopeInCategory($query, $categoryId)

/**
* [scopeWithTags description]
*
*
* @param [type] $query [description]
* @param array $tagIds Tag id's
* @param boolean $and If `true` posts should have all the given tags
*
*
* @return [type] [description]
*/
public function scopeWithTags($query, $tagIds = [], $and = false)
Expand All @@ -302,9 +302,9 @@ public function scopeWithTags($query, $tagIds = [], $and = false)

/**
* Determine if the posts media type is equal to the given type.
*
*
* @param int $type One of the constants from this class.
*
*
* @return boolean
*/
public function isMediaType($type)
Expand All @@ -313,10 +313,10 @@ public function isMediaType($type)
}

/**
* Get the media value in a better and fitting type.
*
* Get the media value in a better and fitting type.
*
* @param string $value
*
*
* @return mixed
*/
public function getMediaAttribute($value)
Expand All @@ -341,8 +341,8 @@ public function getMediaAttribute($value)
}

/**
* Set the media value in a better and fitting type.
*
* Set the media value in a better and fitting type.
*
* @param mixed $value
*/
public function setMediaAttribute($value)
Expand Down Expand Up @@ -370,7 +370,7 @@ public function setMediaAttribute($value)

/**
* Get the thumbnail image path of the post.
*
*
* @return string|null
*/
public function getThumbnailAttribute()
Expand Down Expand Up @@ -398,7 +398,7 @@ public function getThumbnailAttribute()

/**
* Get the thumbnail of youtube video.
*
*
* @return string|null Thumbnail URL.
*/
public function getVideoTypeAttribute()
Expand All @@ -418,7 +418,7 @@ public function getVideoTypeAttribute()

/**
* Get the video id of the post.
*
*
* @return string
*/
public function getVideoIdAttribute()
Expand All @@ -441,7 +441,7 @@ public function getVideoIdAttribute()

/**
* Get the video thumbnail of the post.
*
*
* @return string
*/
private function getVideoThumbnail()
Expand Down Expand Up @@ -470,7 +470,7 @@ private function getVideoThumbnail()

/**
* Get video location url.
*
*
* @return string Url of the video.
*/
public function getVideoLocationAttribute()
Expand All @@ -493,7 +493,7 @@ public function getVideoLocationAttribute()

/**
* Get the html to embed the video.
*
*
* @return string
*/
public function getVideoEmbedAttribute()
Expand Down
1 change: 0 additions & 1 deletion src/Models/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,5 +124,4 @@ public function latestPost()
{
return $this->posts()->latest()->first();
}

}
8 changes: 4 additions & 4 deletions src/Providers/BlogServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ private function publishVendor()
*/
private function registerRepositories()
{
$this->app->bind(CategoriesRepositoryInterface::class, function() {
$this->app->bind(CategoriesRepositoryInterface::class, function () {
return $this->instantiateCategoriesRepository();
});
$this->app->bind(PostsRepositoryInterface::class, EloquentPostsRepository::class);
Expand Down Expand Up @@ -150,15 +150,15 @@ private function registerFactories()
{
$factory = $this->app->make(Factory::class);

$factory->define(Category::class, function(Faker $faker) {
$factory->define(Category::class, function (Faker $faker) {
$name = $faker->colorName;
return [
'name' => $name,
'slug' => str_slug($name),
];
});

$factory->define(Post::class, function(Faker $faker) {
$factory->define(Post::class, function (Faker $faker) {
$userIds = $this->getUserModel()->lists('id')->toArray();
$categoryIds = Category::lists('id')->toArray();

Expand Down Expand Up @@ -304,6 +304,6 @@ private function routesArePublished($blogRoutesPath)
*/
public function provides()
{
return array('command.ide-helper.generate', 'command.ide-helper.models');
return ['command.ide-helper.generate', 'command.ide-helper.models'];
}
}
1 change: 0 additions & 1 deletion src/Repositories/Contracts/TagsRepositoryInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,4 @@ public function getAllWithPosts();
public function paginateAll($postsPerPage);

public function paginateAllWithPosts($postsPerPage);

}