Skip to content

Commit 5f05b13

Browse files
committed
Updated class paths
1 parent 2b6acf9 commit 5f05b13

23 files changed

+91
-74
lines changed

README.md

Lines changed: 49 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -6,60 +6,60 @@
66
[![Total Downloads](https://img.shields.io/packagist/dt/chrisjk123/laravel-blogger.svg?style=flat-square)](https://packagist.org/packages/chrisjk123/laravel-blogger)
77

88

9-
This package is a blogging database with maxed out models, migrations and seeders to help get you setup. After the package is installed the only thing you have to do is add the `Chrisjk123\Blogger\Traits\User\HasPosts` trait to an Eloquent model to associate the users.
9+
This package is a blogging database with maxed out models, migrations and seeders to help get you setup. After the package is installed the only thing you have to do is add the `HasPosts` trait to an Eloquent model to associate the users.
1010

1111
Here are some code examples:
1212

1313
```php
1414
// Search by the short whereCategories method OR use whereCategory() and specify the field
15-
$results = Chrisjk123\Blogger\Post::whereCategories($categories = null)->get();
16-
$results = Chrisjk123\Blogger\Post::whereCategory($field, $operator, $value)->get();
15+
$results = Post::whereCategories($categories = null)->get();
16+
$results = Post::whereCategory($field, $operator, $value)->get();
1717

1818
// Search by Category ID OR IDs
19-
$results = Chrisjk123\Blogger\Post::whereCategories(1)->get();
20-
$results = Chrisjk123\Blogger\Post::whereCategory('id', 1)->get();
19+
$results = Post::whereCategories(1)->get();
20+
$results = Post::whereCategory('id', 1)->get();
2121
----------
22-
$results = Chrisjk123\Blogger\Post::whereCategories([3, 6, 7])->get();
23-
$results = Chrisjk123\Blogger\Post::whereCategory('id', [3, 6, 7])->get();
22+
$results = Post::whereCategories([3, 6, 7])->get();
23+
$results = Post::whereCategory('id', [3, 6, 7])->get();
2424

2525
// Search by Category name OR names
26-
$results = Chrisjk123\Blogger\Post::whereCategories('Izabella Bins II')->get();
27-
$results = Chrisjk123\Blogger\Post::whereCategory('name', 'Izabella Bins II')->get();
26+
$results = Post::whereCategories('Izabella Bins II')->get();
27+
$results = Post::whereCategory('name', 'Izabella Bins II')->get();
2828
----------
29-
$results = Chrisjk123\Blogger\Post::whereCategories(['Izabella Bins II', 'Osborne Fay'])->get();
30-
$results = Chrisjk123\Blogger\Post::whereCategory('name', ['Izabella Bins II', 'Osborne Fay'])->get();
29+
$results = Post::whereCategories(['Izabella Bins II', 'Osborne Fay'])->get();
30+
$results = Post::whereCategory('name', ['Izabella Bins II', 'Osborne Fay'])->get();
3131

3232
// Search by Category model or a Category Collection
33-
$category = Chrisjk123\Blogger\Category::where('id', 7)->first();
34-
$results = Chrisjk123\Blogger\Post::whereCategories($category)->get();
33+
$category = Category::where('id', 7)->first();
34+
$results = Post::whereCategories($category)->get();
3535
----------
36-
$categories = Chrisjk123\Blogger\Category::whereIn('id', [3, 6, 7])->get();
37-
$results = Chrisjk123\Blogger\Post::whereCategories($categories)->get();
36+
$categories = Category::whereIn('id', [3, 6, 7])->get();
37+
$results = Post::whereCategories($categories)->get();
3838

3939
// Search by related Post (tags or category)
40-
$post = Chrisjk123\Blogger\Post::find(8);
41-
$results = Chrisjk123\Blogger\Post::relatedByPostTags($post)->get();
40+
$post = Post::find(8);
41+
$results = Post::relatedByPostTags($post)->get();
4242
----------
43-
$results = Chrisjk123\Blogger\Post::relatedByPostCategory($post)->get();
43+
$results = Post::relatedByPostCategory($post)->get();
4444

4545
// Search by published Posts only
46-
Chrisjk123\Blogger\Post::published()->get();
46+
Post::published()->get();
4747
----------
48-
Chrisjk123\Blogger\Post::publishedLastMonth()->get();
48+
Post::publishedLastMonth()->get();
4949
----------
50-
Chrisjk123\Blogger\Post::publishedLastWeek()->get();
50+
Post::publishedLastWeek()->get();
5151

5252
// Search by unpublished Posts only
53-
Chrisjk123\Blogger\Post::notPublished()->get();
53+
Post::notPublished()->get();
5454

5555
// Search by scheduled Posts only
56-
Chrisjk123\Blogger\Post::scheduled()->get();
56+
Post::scheduled()->get();
5757

5858
// Search by drafted Posts only
59-
Chrisjk123\Blogger\Post::draft()->get();
59+
Post::draft()->get();
6060

6161
// Order by latest published
62-
Chrisjk123\Blogger\Post::orderByLatest()->get();
62+
Post::orderByLatest()->get();
6363
```
6464

6565
## Requirements
@@ -77,7 +77,7 @@ composer require chrisjk123/laravel-blogger
7777
You can publish the migrations with:
7878

7979
```bash
80-
php artisan vendor:publish --provider="Chrisjk123\Blogger\BloggerServiceProvider" --tag="migrations"
80+
php artisan vendor:publish --provider="Chriscreate\Blog\BloggerServiceProvider" --tag="migrations"
8181
```
8282

8383
Publish the migrations:
@@ -86,16 +86,36 @@ Publish the migrations:
8686
php artisan migrate
8787
```
8888

89+
You can optionally publish the config file with:
90+
91+
```bash
92+
php artisan vendor:publish --provider="Chriscreate\Blog\BloggerServiceProvider" --tag="config"
93+
```
94+
95+
This is the contents of the published config file, if your `User` class is
96+
within a different directory, you can change it here as well as the User primary key:
97+
98+
```php
99+
return [
100+
/*
101+
* The default path to the User model in Laravel
102+
*/
103+
'user_class' => \App\User::class,
104+
'user_key_name' => 'id',
105+
];
106+
107+
```
108+
89109
You can publish the factories with:
90110

91111
```bash
92-
php artisan vendor:publish --provider="Chrisjk123\Blogger\BloggerServiceProvider" --tag="factories"
112+
php artisan vendor:publish --provider="Chriscreate\Blog\BloggerServiceProvider" --tag="factories"
93113
```
94114

95115
You can publish the seeder with:
96116

97117
```bash
98-
php artisan vendor:publish --provider="Chrisjk123\Blogger\BloggerServiceProvider" --tag="seeders"
118+
php artisan vendor:publish --provider="Chriscreate\Blog\BloggerServiceProvider" --tag="seeders"
99119
```
100120

101121
## Documentation
@@ -105,7 +125,7 @@ All you have to do is add the `HasPosts` to your User model to get started.
105125
``` php
106126
namespace App;
107127

108-
use Chrisjk123\Blogger\Traits\User\HasPosts;
128+
use Chriscreate\Blog\Traits\User\HasPosts;
109129
use Illuminate\Foundation\Auth\User as Authenticatable;
110130
use Illuminate\Notifications\Notifiable;
111131

composer.json

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
{
22
"name": "chrisjk123/laravel-blogger",
3-
"description": "Blog package",
3+
"description": "blog package",
44
"keywords": [
55
"chrisjk123",
66
"laravel",
77
"laravel-blogger",
88
"blog",
99
"blogger"
1010
],
11-
"homepage": "https://github.com/Chrisjk123/laravel-blogger",
11+
"homepage": "https://github.com/chrisjk123/laravel-blogger",
1212
"license": "MIT",
1313
"type": "library",
1414
"authors": [
@@ -28,12 +28,12 @@
2828
},
2929
"autoload": {
3030
"psr-4": {
31-
"Chrisjk123\\Blogger\\": "src"
31+
"Chriscreates\\Blog\\": "src"
3232
}
3333
},
3434
"autoload-dev": {
3535
"psr-4": {
36-
"Chrisjk123\\Blogger\\Tests\\": "tests"
36+
"Chriscreates\\Blog\\Tests\\": "tests"
3737
}
3838
},
3939
"scripts": {
@@ -47,11 +47,8 @@
4747
"extra": {
4848
"laravel": {
4949
"providers": [
50-
"Chrisjk123\\Blogger\\BloggerServiceProvider"
51-
],
52-
"aliases": {
53-
"Blogger": "Chrisjk123\\Blogger\\BloggerFacade"
54-
}
50+
"Chriscreates\\Blog\\BlogServiceProvider"
51+
]
5552
}
5653
}
5754
}

database/factories/CategoryFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Chrisjk123\Blogger\Category;
3+
use Chriscreate\Blog\Category;
44
use Faker\Generator as Faker;
55
use Illuminate\Support\Str;
66

database/factories/CommentFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Chrisjk123\Blogger\Comment;
3+
use Chriscreate\Blog\Comment;
44
use Faker\Generator as Faker;
55

66
$factory->define(Comment::class, function (Faker $faker) {

database/factories/PostFactory.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?php
22

3-
use Chrisjk123\Blogger\Category;
4-
use Chrisjk123\Blogger\Post;
3+
use Chriscreate\Blog\Category;
4+
use Chriscreate\Blog\Post;
55
use Faker\Generator as Faker;
66
use Illuminate\Support\Str;
77

database/factories/TagFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
use Chrisjk123\Blogger\Tag;
3+
use Chriscreate\Blog\Tag;
44
use Faker\Generator as Faker;
55

66
$factory->define(Tag::class, function (Faker $faker) {

database/seeds/PostsTableSeeder.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Chrisjk123\Blogger\Comment;
4-
use Chrisjk123\Blogger\Post;
5-
use Chrisjk123\Blogger\Tag;
3+
use Chriscreate\Blog\Comment;
4+
use Chriscreate\Blog\Post;
5+
use Chriscreate\Blog\Tag;
66
use Illuminate\Database\Seeder;
77

88
class PostsTableSeeder extends Seeder

src/BloggerServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Chrisjk123\Blogger;
3+
namespace Chriscreate\Blog;
44

55
use Illuminate\Support\ServiceProvider;
66

src/Category.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?php
22

3-
namespace Chrisjk123\Blogger;
3+
namespace Chriscreate\Blog;
44

55
use Illuminate\Database\Eloquent\Model;
66

src/Comment.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<?php
22

3-
namespace Chrisjk123\Blogger;
3+
namespace Chriscreate\Blog;
44

5-
use Chrisjk123\Blogger\Traits\Comment\CommentApproval;
6-
use Chrisjk123\Blogger\Traits\Comment\CommentScopes;
7-
use Chrisjk123\Blogger\Traits\IsAuthorable;
5+
use Chriscreate\Blog\Traits\Comment\CommentApproval;
6+
use Chriscreate\Blog\Traits\Comment\CommentScopes;
7+
use Chriscreate\Blog\Traits\IsAuthorable;
88
use Illuminate\Database\Eloquent\Model;
99

1010
class Comment extends Model

0 commit comments

Comments
 (0)