├── .gitignore
├── .gitattributes
├── resources
├── assets
│ ├── sitemap.xml
│ ├── sitemap-group.xml
│ └── sitemap-image.xml
└── views
│ ├── forms
│ ├── fields
│ │ ├── page_meta_group.blade.php
│ │ ├── page_meta_others.blade.php
│ │ └── page_fields.blade.php
│ ├── destroy.blade.php
│ ├── page_meta_tag.blade.php
│ ├── page_meta_tag_group.blade.php
│ ├── meta-tag-global.blade.php
│ ├── page.blade.php
│ ├── tag.blade.php
│ ├── image.blade.php
│ └── setting.blade.php
│ ├── pages
│ ├── pages
│ │ ├── create.blade.php
│ │ ├── meta_tags.blade.php
│ │ ├── images.blade.php
│ │ ├── edit.blade.php
│ │ ├── show.blade.php
│ │ ├── index.blade.php
│ │ └── bulk-edit.blade.php
│ ├── sitemap
│ │ └── index.blade.php
│ ├── meta_tags
│ │ ├── index.blade.php
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ └── show.blade.php
│ ├── images
│ │ ├── create.blade.php
│ │ ├── edit.blade.php
│ │ └── index.blade.php
│ ├── settings
│ │ ├── edit.blade.php
│ │ ├── index.blade.php
│ │ └── show.blade.php
│ ├── dashboard
│ │ ├── advanced.blade.php
│ │ ├── social.blade.php
│ │ ├── index.blade.php
│ │ ├── tools.blade.php
│ │ └── sitemap.blade.php
│ └── analysis
│ │ └── index.blade.php
│ ├── tabs
│ ├── page.blade.php
│ ├── robot.blade.php
│ ├── htaccess.blade.php
│ ├── site.blade.php
│ ├── sitemap.blade.php
│ ├── ownership.blade.php
│ ├── social.blade.php
│ └── dashboard.blade.php
│ ├── tables
│ ├── meta_tag.blade.php
│ ├── setting.blade.php
│ └── meta_tag_details.blade.php
│ ├── includes
│ ├── heading-analysis.blade.php
│ ├── site-nav-dropdown.blade.php
│ └── sidebar.blade.php
│ ├── modals
│ └── page_upload.blade.php
│ ├── cards
│ ├── page.blade.php
│ ├── setting.blade.php
│ └── meta_tag.blade.php
│ └── layouts
│ └── app.blade.php
├── src
├── Database
│ ├── Seeders
│ │ ├── LinkTagsTableSeeder.php
│ │ └── SeoTablesSeeder.php
│ └── migrations
│ │ ├── 2018_02_12_123638_add_schema_to_seo_pages_table.php
│ │ ├── 2019_08_21_081423_add_tags_column_to_seo_pages_table.php
│ │ ├── 2018_03_08_123638_add_focus_keyword_to_seo_pages_table.php
│ │ ├── 2017_12_26_123638_add_xml_columns_to_seo_pages_table.php
│ │ ├── 2017_12_11_120139_create_seo_links__tags_table.php
│ │ ├── 2017_12_11_120225_create_seo_settings_table.php
│ │ ├── 2017_12_11_120225_create_seo_page_images_table.php
│ │ ├── 2017_12_11_120055_create_seo_page__meta_tags_table.php
│ │ ├── 2017_12_11_115853_create_seo_pages_table.php
│ │ └── 2017_12_11_115949_create_seo_meta_tags_table.php
├── Services
│ ├── HtaccessFile.php
│ ├── Helper.php
│ ├── RobotTxt.php
│ └── SchemaBuilder.php
├── Contracts
│ └── LinkProvider.php
├── Models
│ ├── LinkTag.php
│ ├── PageMetaTag.php
│ ├── PageImage.php
│ └── Setting.php
├── Console
│ ├── Commands
│ │ ├── Install.php
│ │ └── Uninstall.php
│ └── Kernel.php
├── Http
│ ├── Requests
│ │ ├── LinkTags
│ │ │ ├── Create.php
│ │ │ ├── Edit.php
│ │ │ ├── Index.php
│ │ │ ├── Destroy.php
│ │ │ ├── Store.php
│ │ │ └── Update.php
│ │ ├── Pages
│ │ │ ├── Edit.php
│ │ │ ├── Show.php
│ │ │ ├── Destroy.php
│ │ │ ├── Create.php
│ │ │ ├── Index.php
│ │ │ ├── Download.php
│ │ │ ├── Upload.php
│ │ │ ├── BulkUpdate.php
│ │ │ ├── Store.php
│ │ │ └── Update.php
│ │ ├── Images
│ │ │ ├── Edit.php
│ │ │ ├── Destroy.php
│ │ │ ├── Index.php
│ │ │ ├── Create.php
│ │ │ ├── Update.php
│ │ │ └── Store.php
│ │ ├── MetaTags
│ │ │ ├── Edit.php
│ │ │ ├── Destroy.php
│ │ │ ├── Index.php
│ │ │ ├── Create.php
│ │ │ ├── Store.php
│ │ │ └── Update.php
│ │ ├── Settings
│ │ │ ├── Edit.php
│ │ │ ├── Index.php
│ │ │ ├── Store.php
│ │ │ └── Update.php
│ │ ├── Dashboard
│ │ │ ├── Tool.php
│ │ │ ├── Index.php
│ │ │ ├── Sitemap.php
│ │ │ ├── Social.php
│ │ │ └── Advanced.php
│ │ └── SiteMaps
│ │ │ └── Update.php
│ └── Controllers
│ │ ├── AnalysisController.php
│ │ ├── SiteMapController.php
│ │ ├── DashboardController.php
│ │ ├── LinkTagController.php
│ │ ├── ImageController.php
│ │ ├── SettingController.php
│ │ └── MetaTagController.php
├── Jobs
│ ├── SitemapGeneratorJob.php
│ ├── PageCacheJob.php
│ ├── PageUploadJob.php
│ └── PageGeneratorJob.php
└── SeoServiceProvider.php
├── LICENSE
├── composer.json
├── config
└── seo.php
├── Policies
├── ImagePolicy.php
├── SettingPolicy.php
└── MetaTagPolicy.php
└── routes
└── web.php
/.gitignore:
--------------------------------------------------------------------------------
1 | /vendor
2 | .idea/
3 | composer.lock
4 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | * linguist-vendored
2 | *.php linguist-vendored=false
3 |
--------------------------------------------------------------------------------
/resources/assets/sitemap.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/resources/assets/sitemap-group.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/resources/views/forms/fields/page_meta_group.blade.php:
--------------------------------------------------------------------------------
1 |
2 | @foreach($tags as $tag)
3 | @include('seo::forms.tag')
4 | @endforeach
5 |
--------------------------------------------------------------------------------
/resources/assets/sitemap-image.xml:
--------------------------------------------------------------------------------
1 |
2 |
4 |
--------------------------------------------------------------------------------
/src/Database/Seeders/LinkTagsTableSeeder.php:
--------------------------------------------------------------------------------
1 | $tags)
2 |
3 | {{$group}}
4 |
5 | @foreach($tags as $tag)
6 | @include('seo::forms.tag')
7 | @endforeach
8 |
9 |
10 | @endforeach
--------------------------------------------------------------------------------
/src/Services/HtaccessFile.php:
--------------------------------------------------------------------------------
1 | path = config('seo.htaccess', public_path('.htaccess'));
17 | }
18 |
19 | }
--------------------------------------------------------------------------------
/resources/views/forms/destroy.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/forms/page_meta_tag.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/forms/page_meta_tag_group.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/forms/meta-tag-global.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Database/Seeders/SeoTablesSeeder.php:
--------------------------------------------------------------------------------
1 | call(MetaTagsTableSeeder::class);
17 | $this->call(LinkTagsTableSeeder::class);
18 | $this->call(SettingsTableSeeder::class);
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/resources/views/forms/page.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Contracts/LinkProvider.php:
--------------------------------------------------------------------------------
1 | Unique ID
12 | * object=> Class or Entity Name
13 | * link=>full verified link
14 | * title=>Page title
15 | * description=> Description of page
16 | * images=>[] array of images link
17 | * created_at=>Created_at time of the page
18 | * updated_at=>updated_at time of the page
19 | * ]
20 | *
21 | * @return \Illuminate\Support\Collection
22 | */
23 | public function all();
24 |
25 |
26 | }
--------------------------------------------------------------------------------
/resources/views/pages/pages/create.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | New Page
4 | @endsection
5 | @section('tools')
6 |
7 |
8 | @endsection
9 | @section('content')
10 |
11 |
12 |
13 |
14 | @include('seo::forms.page',['showPageUrl'=>true])
15 |
16 |
17 |
18 |
19 | @endSection
--------------------------------------------------------------------------------
/resources/views/pages/pages/meta_tags.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | {{pathinfo($record->path,PATHINFO_BASENAME)}}
6 | @endsection
7 | @section('tools')
8 |
9 |
10 |
11 | @endsection
12 | @section('content')
13 | @include('seo::includes.page_meta_tags')
14 | @endSection
15 |
16 | @section('scripts')
17 | @endsection
--------------------------------------------------------------------------------
/resources/views/pages/sitemap/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | Create
6 | @endsection
7 | @section('tools')
8 | @endsection
9 | @section('content')
10 |
19 | @endSection
--------------------------------------------------------------------------------
/resources/views/pages/meta_tags/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | Meta Tags
4 | @endsection
5 | @section('tools')
6 |
15 |
16 | @endsection
17 | @section('content')
18 | @include('seo::tables.meta_tag_details')
19 | @endSection
--------------------------------------------------------------------------------
/resources/views/pages/pages/images.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | {{$record->path}}
6 | @endsection
7 | @section('tools')
8 |
9 |
10 |
11 | Visit Page
12 |
13 | @endsection
14 | @section('content')
15 |
16 |
17 |
18 | @endSection
--------------------------------------------------------------------------------
/src/Models/LinkTag.php:
--------------------------------------------------------------------------------
1 | Dashboard
4 | Meta Tags
5 | Create
6 | @endsection
7 | @section('tools')
8 | @endsection
9 | @section('content')
10 |
11 |
12 |
13 |
14 | @include('seo::forms.meta_tag')
15 |
16 |
17 |
18 |
19 | @endSection
--------------------------------------------------------------------------------
/resources/views/tabs/page.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Services/Helper.php:
--------------------------------------------------------------------------------
1 | longText('schema')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('seo_pages', function (Blueprint $table) {
29 | $table->dropColumn(['schema']);
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Database/migrations/2019_08_21_081423_add_tags_column_to_seo_pages_table.php:
--------------------------------------------------------------------------------
1 | text('tags')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('seo_pages', function (Blueprint $table) {
29 | $table->dropColumn('tags');
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/resources/views/pages/pages/edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | {{$record->title}}
4 | @endsection
5 | @section('tools')
6 |
7 | New Page
8 |
9 | @endsection
10 | @section('content')
11 |
12 |
13 |
14 |
15 | @include('seo::forms.page',[
16 | 'showPageUrl' => true,
17 | 'route' => route('seo::pages.update',$record->id),
18 | 'method' => 'PUT'
19 | ])
20 |
21 |
22 |
23 |
24 | @endSection
--------------------------------------------------------------------------------
/src/Database/migrations/2018_03_08_123638_add_focus_keyword_to_seo_pages_table.php:
--------------------------------------------------------------------------------
1 | string('focus_keyword')->nullable();
18 | });
19 | }
20 |
21 | /**
22 | * Reverse the migrations.
23 | *
24 | * @return void
25 | */
26 | public function down()
27 | {
28 | Schema::table('seo_pages', function (Blueprint $table) {
29 | $table->dropColumn(['focus_keyword']);
30 | });
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/src/Console/Commands/Install.php:
--------------------------------------------------------------------------------
1 | user()->can('update', $this->route('page'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Show.php:
--------------------------------------------------------------------------------
1 | user()->can('view', $this->route('page'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Destroy.php:
--------------------------------------------------------------------------------
1 | user()->can('delete', $this->route('page'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_26_123638_add_xml_columns_to_seo_pages_table.php:
--------------------------------------------------------------------------------
1 | string('change_frequency', 20)->default('monthly');
18 | $table->double('priority', 4)->default(0.5);
19 | });
20 | }
21 |
22 | /**
23 | * Reverse the migrations.
24 | *
25 | * @return void
26 | */
27 | public function down()
28 | {
29 | Schema::table('seo_pages', function (Blueprint $table) {
30 | $table->dropColumn(['change_frequency', 'priority']);
31 | });
32 | }
33 | }
34 |
--------------------------------------------------------------------------------
/src/Http/Requests/Images/Edit.php:
--------------------------------------------------------------------------------
1 | user()->can('update',$this->route('pageImage'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/MetaTags/Edit.php:
--------------------------------------------------------------------------------
1 | user()->can('update', $this->route('meta_tag'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/Settings/Edit.php:
--------------------------------------------------------------------------------
1 | user()->can('update', $this->route('setting'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/Images/Destroy.php:
--------------------------------------------------------------------------------
1 | user()->can('delete',$this->route('pageImage'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/MetaTags/Destroy.php:
--------------------------------------------------------------------------------
1 | user()->can('delete', $this->route('meta_tag'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 |
29 | ];
30 | }
31 |
32 | /**
33 | * Get the error messages for the defined validation rules.
34 | *
35 | * @return array
36 | */
37 | public function messages()
38 | {
39 | return [
40 |
41 | ];
42 | }
43 |
44 | }
45 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Create.php:
--------------------------------------------------------------------------------
1 | user()->can('create', Page::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Index.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Page::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/resources/views/pages/meta_tags/edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Meta Tags
5 | {{$model->id}}
6 | @endsection
7 | @section('tools')
8 |
9 | @endsection
10 | @section('content')
11 |
12 |
13 |
14 |
15 | @include('seo::forms.meta_tag',[
16 | 'route'=>route('seo::meta-tags.update',$model->id),
17 | 'method'=>'PUT'
18 | ])
19 |
20 |
21 |
22 |
23 | @endSection
--------------------------------------------------------------------------------
/resources/views/tabs/robot.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Http/Requests/Dashboard/Tool.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Images/Index.php:
--------------------------------------------------------------------------------
1 | user()->can('index', PageImage::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/MetaTags/Index.php:
--------------------------------------------------------------------------------
1 | user()->can('index', MetaTag::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Download.php:
--------------------------------------------------------------------------------
1 | user()->can('download', Page::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Settings/Index.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Dashboard/Index.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Dashboard/Sitemap.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Dashboard/Social.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Images/Create.php:
--------------------------------------------------------------------------------
1 | user()->can('create',PageImage::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/MetaTags/Create.php:
--------------------------------------------------------------------------------
1 | user()->can('create', MetaTag::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Dashboard/Advanced.php:
--------------------------------------------------------------------------------
1 | user()->can('index',Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 |
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/resources/views/tables/meta_tag.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Info
5 | name
6 | property
7 | status
8 |
9 |
10 |
11 |
12 | @foreach($metaTags as $record)
13 |
14 | {{$record->input_info }}
15 | {{$record->name }}
16 | {{$record->property }}
17 | {{$record->status }}
18 |
19 |
20 |
21 |
22 |
23 |
24 | @endforeach
25 |
26 |
27 |
28 |
29 |
30 | {!! $metaTags->render() !!}
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/Http/Requests/Settings/Store.php:
--------------------------------------------------------------------------------
1 | user()->can('create', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'settings ' => 'array',
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Upload.php:
--------------------------------------------------------------------------------
1 | user()->can('upload', Page::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'file' => 'mimes:csv,xlsx,xls,txt'
30 | ];
31 | }
32 |
33 | /**
34 | * Get the error messages for the defined validation rules.
35 | *
36 | * @return array
37 | */
38 | public function messages()
39 | {
40 | return [
41 |
42 | ];
43 | }
44 |
45 | }
46 |
--------------------------------------------------------------------------------
/src/Console/Kernel.php:
--------------------------------------------------------------------------------
1 | command('inspire')
28 | // ->hourly();
29 | }
30 |
31 | /**
32 | * Register the commands for the application.
33 | *
34 | * @return void
35 | */
36 | protected function commands()
37 | {
38 | $this->load(__DIR__.'/Commands');
39 |
40 | require base_path('routes/console.php');
41 | }
42 | }
43 |
--------------------------------------------------------------------------------
/src/Http/Controllers/AnalysisController.php:
--------------------------------------------------------------------------------
1 | get('url');
20 | $keyword = $request->get('keyword');
21 |
22 | $data = [
23 | 'success' => false
24 | ];
25 | if (!empty($url)) {
26 | $pageAnalysis = new KeywordAnalysis($url, $keyword, false);
27 |
28 | if ($pageAnalysis->isSuccess()) {
29 | $data = array_merge($pageAnalysis->toArray(), $data);
30 | $data['success'] = true;
31 | $data['result'] = $pageAnalysis->run()->result();
32 | }
33 | }
34 | return view('seo::pages.analysis.index', $data);
35 | }
36 |
37 | }
--------------------------------------------------------------------------------
/src/Jobs/SitemapGeneratorJob.php:
--------------------------------------------------------------------------------
1 | destroyAll();
40 | $siteMap->page()->mergeIntoOne();
41 | }
42 |
43 | }
--------------------------------------------------------------------------------
/src/Jobs/PageCacheJob.php:
--------------------------------------------------------------------------------
1 | get();
37 |
38 | foreach ($pages as $page) {
39 | $tag = new Tag($page);
40 | $tag->make()->save();
41 | }
42 | }
43 |
44 | }
--------------------------------------------------------------------------------
/resources/views/tabs/htaccess.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{csrf_field()}}
4 |
15 |
16 |
17 |
18 |
19 |
--------------------------------------------------------------------------------
/resources/views/pages/images/create.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | {{$page->path}}
6 | Images
7 | Create
8 | @endsection
9 | @section('header')
10 | Add New Image to {{$page->getTitle()}}
11 | @endsection
12 | @section('tools')
13 | Visit Page
14 | @endsection
15 | @section('content')
16 |
17 |
18 |
19 |
20 | @include('seo::forms.image')
21 |
22 |
23 |
24 |
25 | @endSection
--------------------------------------------------------------------------------
/resources/views/pages/settings/edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('content')
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 | Edit {{$model->id}}
11 |
12 |
13 |
18 |
19 |
20 |
21 | @include('forms.seo_setting',[
22 | 'route'=>route('seo_settings.update',$model->id),
23 | 'method'=>'PUT'
24 | ])
25 |
26 |
27 |
28 |
29 | @endSection
--------------------------------------------------------------------------------
/src/Http/Requests/LinkTags/Store.php:
--------------------------------------------------------------------------------
1 | 'nullable|unique:seo_link_tags,rel|max:255',
29 | 'href ' => 'nullable|max:255',
30 | 'status ' => 'required|max:255',
31 | 'page_id ' => 'nullable|numeric',
32 | ];
33 | }
34 |
35 | /**
36 | * Get the error messages for the defined validation rules.
37 | *
38 | * @return array
39 | */
40 | public function messages()
41 | {
42 | return [
43 |
44 | ];
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/src/Http/Requests/LinkTags/Update.php:
--------------------------------------------------------------------------------
1 | 'nullable|unique:seo_link_tags,rel|max:255',
29 | 'href ' => 'nullable|max:255',
30 | 'status ' => 'required|max:255',
31 | 'page_id ' => 'nullable|numeric',
32 | ];
33 | }
34 |
35 | /**
36 | * Get the error messages for the defined validation rules.
37 | *
38 | * @return array
39 | */
40 | public function messages()
41 | {
42 | return [
43 |
44 | ];
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2020 Tuhin Bepari
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_11_120139_create_seo_links__tags_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('rel', 100)->nullable();
19 | $table->string('href')->nullable();
20 | $table->string('status')->default('active');
21 | $table->integer('page_id')->unsigned()->nullable();
22 | $table->foreign('page_id')->references('id')->on('seo_pages')->onDelete('cascade');
23 |
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('seo_link_tags');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/Http/Requests/SiteMaps/Update.php:
--------------------------------------------------------------------------------
1 | user()->can('index', Setting::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'page_id.*' => 'required|exists:seo_pages,id',
30 | 'change_frequency.*' => 'required',
31 | 'priority.*' => 'required'
32 | ];
33 | }
34 |
35 | /**
36 | * Get the error messages for the defined validation rules.
37 | *
38 | * @return array
39 | */
40 | public function messages()
41 | {
42 | return [
43 |
44 | ];
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/resources/views/includes/heading-analysis.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
14 |
16 |
17 |
18 | @foreach($tags as $h)
19 | {{$h}}
20 | @endforeach
21 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/src/Http/Requests/Images/Update.php:
--------------------------------------------------------------------------------
1 | user()->can('update',$this->route('pageImage'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 | 'src' => 'required|max:255',
29 | 'title' => 'nullable|max:100',
30 | 'caption' => 'nullable|max:100',
31 | 'location' => 'nullable|max:50',
32 | ];
33 | }
34 |
35 | /**
36 | * Get the error messages for the defined validation rules.
37 | *
38 | * @return array
39 | */
40 | public function messages()
41 | {
42 | return [
43 |
44 | ];
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/resources/views/tables/setting.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Key
5 | Value
6 | Status
7 | Group
8 | Label
9 | Description
10 |
11 |
12 |
13 |
14 | @foreach($records as $record)
15 |
16 | {{$record->key }}
17 | {{$record->value }}
18 | {{$record->status }}
19 | {{$record->group }}
20 | {{$record->label }}
21 | {{$record->description }}
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 | @endforeach
30 |
31 |
32 |
33 |
34 | {{{$records->render()}}}
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/Http/Requests/Images/Store.php:
--------------------------------------------------------------------------------
1 | user()->can('create', PageImage::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'src' => 'required|max:255',
30 | 'title' => 'nullable|max:100',
31 | 'caption' => 'nullable|max:100',
32 | 'location' => 'nullable|max:50',
33 | ];
34 | }
35 |
36 | /**
37 | * Get the error messages for the defined validation rules.
38 | *
39 | * @return array
40 | */
41 | public function messages()
42 | {
43 | return [
44 |
45 | ];
46 | }
47 |
48 | }
49 |
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_11_120225_create_seo_settings_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('label')->nullable();
19 | $table->string('key', 100)->unique()->index();
20 | $table->string('value')->nullable();
21 | $table->string('description')->nullable();
22 | // either active or inactive
23 | $table->string('status')->default('active');
24 | $table->string('group')->nullable();
25 | $table->timestamps();
26 | });
27 | }
28 |
29 | /**
30 | * Reverse the migrations.
31 | *
32 | * @return void
33 | */
34 | public function down()
35 | {
36 | Schema::dropIfExists('seo_settings');
37 | }
38 | }
39 |
--------------------------------------------------------------------------------
/src/Http/Requests/Settings/Update.php:
--------------------------------------------------------------------------------
1 | user()->can('update', $this->route('setting'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 | 'key ' => 'required|unique:seo_settings,key|max:255',
29 | 'value ' => 'nullable|max:255',
30 | 'status ' => 'required|max:255',
31 | 'group ' => 'nullable|max:255',
32 | ];
33 | }
34 |
35 | /**
36 | * Get the error messages for the defined validation rules.
37 | *
38 | * @return array
39 | */
40 | public function messages()
41 | {
42 | return [
43 |
44 | ];
45 | }
46 |
47 | }
48 |
--------------------------------------------------------------------------------
/composer.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "digitaldream/laravel-seo-tools",
3 | "type": "library",
4 | "description": "Laravel Seo package for Content writer/admin/web master who do not know programming but want to edit/update SEO tags from dashboard",
5 | "keywords": [
6 | "Laravel",
7 | "SEO",
8 | "SEO Tools",
9 | "Laravel SEO tools"
10 | ],
11 | "homepage": "https://github.com/digitaldreams/laravel-seo-tools",
12 | "license": "MIT",
13 | "authors": [
14 | {
15 | "name": "Tuhin Bepari",
16 | "email": "digitaldreams40@gmail.com",
17 | "homepage": "http://www.tuhinbepari.com",
18 | "role": "Developer"
19 | }
20 | ],
21 | "require": {
22 | "php": "^8.2",
23 | "laravel/framework": "^10.0|^11.0",
24 | "digitaldream/data-converter": ">=1.0"
25 | },
26 | "require-dev": {
27 | },
28 | "suggest": {
29 | "digitaldreams/laracrud": "For Laravel Code generator"
30 | },
31 | "autoload": {
32 | "psr-4": {
33 | "SEO\\": "src/"
34 | }
35 | },
36 | "extra": {
37 | "laravel": {
38 | "providers": [
39 | "SEO\\SeoServiceProvider"
40 | ],
41 | "aliases": {
42 | }
43 | }
44 | }
45 | }
46 |
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_11_120225_create_seo_page_images_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('page_id')->unsigned();
19 | $table->string('src')->nullable()->index();
20 | $table->string('title', 100)->nullable();
21 | $table->string('caption', 100)->nullable();
22 | $table->string('location', 100)->nullable();
23 | $table->foreign('page_id')->references('id')->on('seo_pages')->onDelete('cascade');
24 | $table->timestamps();
25 | });
26 | }
27 |
28 | /**
29 | * Reverse the migrations.
30 | *
31 | * @return void
32 | */
33 | public function down()
34 | {
35 | Schema::dropIfExists('seo_page_images');
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/resources/views/pages/dashboard/advanced.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 |
3 | @section('header')
4 | Site Configuration
5 | @endsection
6 | @section('tools')
7 |
8 | @endsection
9 | @section('content')
10 |
11 | Robots.txt
13 |
14 |
15 | .htaccess
17 |
18 |
19 |
20 |
21 |
22 | @include('seo::tabs.robot')
23 |
24 |
25 |
26 |
27 | @include('seo::tabs.htaccess')
28 |
29 |
30 |
31 | @endSection
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/BulkUpdate.php:
--------------------------------------------------------------------------------
1 | user()->can('bulkUpdate', Page::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'page_id.*' => 'required|exists:seo_pages,id',
30 | 'robot_index.*' => 'required|max:50',
31 | 'title.*' => 'required|max:70',
32 | 'description.*' => 'required|max:170',
33 |
34 | ];
35 | }
36 |
37 | /**
38 | * Get the error messages for the defined validation rules.
39 | *
40 | * @return array
41 | */
42 | public function messages()
43 | {
44 | return [
45 |
46 | ];
47 | }
48 |
49 | }
50 |
--------------------------------------------------------------------------------
/src/Services/RobotTxt.php:
--------------------------------------------------------------------------------
1 | path = config('seo.robot_txt', public_path('robots.txt'));
25 | }
26 |
27 | /**
28 | * @return string
29 | */
30 | public function get()
31 | {
32 | $file = $this->file('r');
33 | if ($file->getSize() > 0)
34 | return trim($file->fread($file->getSize()));
35 | return '';
36 | }
37 |
38 | /**
39 | * @param string $content
40 | */
41 | public function save($content = '')
42 | {
43 | $file = $this->file();
44 | $file->fwrite($content);
45 | $file->fflush();
46 | }
47 |
48 | /**
49 | * @param string $mode
50 | */
51 | public function file($mode = 'w+'): \SplFileObject
52 | {
53 | return new \SplFileObject($this->path, $mode);
54 |
55 | }
56 | }
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_11_120055_create_seo_page__meta_tags_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->integer('seo_page_id')->unsigned()->nullable();
19 | $table->integer('seo_meta_tag_id')->unsigned();
20 | $table->text('content')->nullable();
21 | $table->foreign('seo_page_id')->references('id')->on('seo_pages')->onDelete('set null');
22 | $table->foreign('seo_meta_tag_id')->references('id')->on('seo_meta_tags')->onDelete('cascade');
23 | $table->timestamps();
24 | });
25 | }
26 |
27 | /**
28 | * Reverse the migrations.
29 | *
30 | * @return void
31 | */
32 | public function down()
33 | {
34 | Schema::dropIfExists('seo_page_meta_tags');
35 | }
36 | }
37 |
--------------------------------------------------------------------------------
/resources/views/pages/images/edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | {{$page->path}}
6 | Images
7 | {{$model->id}}
8 | Edit
9 |
10 | @endsection
11 | @section('tools')
12 |
13 | @endsection
14 | @section('content')
15 |
16 |
17 |
18 |
19 | @include('seo::forms.image',[
20 | 'route'=>route('seo::pages.images.update',['page'=>$page->id,'pageImage'=>$model->id]),
21 | 'method'=>'PUT'
22 | ])
23 |
24 |
25 |
26 |
27 | @endSection
--------------------------------------------------------------------------------
/resources/views/pages/settings/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Settings
5 | @endsection
6 | @section('content')
7 |
8 | Global
10 |
11 |
12 | Global Meta
15 |
16 |
17 |
18 |
19 | @include('seo::tabs.site')
20 | @include('seo::tabs.page')
21 |
22 |
23 | @endSection
24 | @section('scripts')
25 |
34 | @endsection
--------------------------------------------------------------------------------
/src/Models/PageMetaTag.php:
--------------------------------------------------------------------------------
1 | belongsTo(MetaTag::class, 'seo_meta_tag_id');
42 | }
43 |
44 | /**
45 | * seoPage
46 | *
47 | * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
48 | */
49 | public function seoPage()
50 | {
51 | return $this->belongsTo(Page::class, 'seo_page_id');
52 | }
53 |
54 |
55 |
56 | }
--------------------------------------------------------------------------------
/resources/views/pages/settings/show.blade.php:
--------------------------------------------------------------------------------
1 | @extends('layouts.app')
2 | @section('content')
3 |
4 |
5 |
6 | {{$record->id}}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 | {{csrf_field()}}
21 | {{method_field('DELETE')}}
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | @include('cards.seo_setting')
32 |
33 |
34 | @endSection
--------------------------------------------------------------------------------
/resources/views/modals/page_upload.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | {{csrf_field()}}
6 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
22 |
23 |
24 |
25 |
--------------------------------------------------------------------------------
/resources/views/pages/meta_tags/show.blade.php:
--------------------------------------------------------------------------------
1 | @extends('seo::layouts.app')
2 | @section('content')
3 |
4 |
5 |
6 | {{$record->id}}
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
20 | {{csrf_field()}}
21 | {{method_field('DELETE')}}
22 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 | @include('cards.seo_meta_tag')
32 |
33 |
34 | @endSection
--------------------------------------------------------------------------------
/resources/views/tables/meta_tag_details.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Title
5 | Info
6 | Name
7 | Property
8 | Status
9 | Group
10 | Visibility
11 |
12 |
13 |
14 |
15 | @foreach($records as $record)
16 |
17 | {{$record->input_label }}
18 | {{$record->input_info }}
19 | {{$record->name }}
20 | {{$record->property }}
21 | {{$record->status }}
22 | {{$record->group }}
23 | {{$record->visibility }}
24 |
25 |
26 |
27 |
28 | @include('seo::forms.destroy',['route'=>route('seo::meta-tags.destroy',$record->id)])
29 |
30 |
31 |
32 | @endforeach
33 |
34 |
35 |
36 |
37 | {{{$records->render()}}}
38 |
39 |
40 |
41 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Store.php:
--------------------------------------------------------------------------------
1 | user()->can('create', Page::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'page.path' => 'required|unique:seo_pages,path|max:255',
30 | 'route_name' => 'nullable|max:150',
31 | 'page.robot_index' => 'nullable|max:50',
32 | 'page.robot_follow' => 'nullable|max:50',
33 | 'page.canonical_url' => 'nullable|max:255',
34 | 'page.title' => 'required|max:70',
35 | 'page.description' => 'required|max:170',
36 | ];
37 | }
38 |
39 | /**
40 | * Get the error messages for the defined validation rules.
41 | *
42 | * @return array
43 | */
44 | public function messages()
45 | {
46 | return [
47 |
48 | ];
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/src/Http/Requests/Pages/Update.php:
--------------------------------------------------------------------------------
1 | user()->can('update', $this->route('page'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 | 'page.path' => 'required|max:255|unique:seo_pages,path,' . $this->route('page')->id,
29 | 'route_name' => 'nullable|max:150',
30 | 'page.robot_index' => 'nullable|max:50',
31 | 'page.robot_follow' => 'nullable|max:50',
32 | 'page.canonical_url' => 'nullable|max:255',
33 | 'page.title' => 'required|max:70',
34 | 'page.description' => 'required|max:170',
35 |
36 | ];
37 | }
38 |
39 | /**
40 | * Get the error messages for the defined validation rules.
41 | *
42 | * @return array
43 | */
44 | public function messages()
45 | {
46 | return [
47 |
48 | ];
49 | }
50 |
51 | }
52 |
--------------------------------------------------------------------------------
/resources/views/pages/analysis/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Analysis
5 | @endsection
6 |
7 | @section('content')
8 |
9 |
10 |
18 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 | @include('seo::includes.analysis')
34 | @endSection
--------------------------------------------------------------------------------
/resources/views/forms/tag.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_11_115853_create_seo_pages_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('path')->unique()->index();
19 | $table->string('object', 80)->nullable()->index();
20 | $table->string('object_id', 80)->nullable()->index();
21 | $table->string('robot_index', 50)->default('noindex')->nullable();
22 | $table->string('robot_follow', 50)->default('nofollow')->nullable();
23 | $table->string('canonical_url')->nullable();
24 | $table->string('title', 100)->nullable()->index();
25 | $table->string('title_source', 100)->nullable()->index();
26 | $table->string('description', 180)->nullable();
27 | $table->string('description_source', 180)->nullable();
28 | $table->timestamps();
29 | });
30 | }
31 |
32 | /**
33 | * Reverse the migrations.
34 | *
35 | * @return void
36 | */
37 | public function down()
38 | {
39 | Schema::dropIfExists('seo_pages');
40 | }
41 | }
42 |
--------------------------------------------------------------------------------
/src/Database/migrations/2017_12_11_115949_create_seo_meta_tags_table.php:
--------------------------------------------------------------------------------
1 | increments('id');
18 | $table->string('name', 50)->nullable();
19 | $table->string('property', 100)->nullable();
20 | // either active or inactive
21 | $table->string('status', 50)->default('active');
22 | $table->string('group', 50)->nullable();
23 | $table->string('input_type', 50)->default('text');
24 | $table->string('default_value')->nullable();
25 | $table->string('input_placeholder')->nullable();
26 | $table->string('input_label')->nullable();
27 | $table->string('input_info')->nullable();
28 | // either page or global
29 | $table->string('visibility', 50)->default('page');
30 | $table->timestamps();
31 | });
32 | }
33 |
34 | /**
35 | * Reverse the migrations.
36 | *
37 | * @return void
38 | */
39 | public function down()
40 | {
41 | Schema::dropIfExists('seo_meta_tags');
42 | }
43 | }
44 |
--------------------------------------------------------------------------------
/src/Http/Requests/MetaTags/Store.php:
--------------------------------------------------------------------------------
1 | user()->can('create', MetaTag::class);
19 | }
20 |
21 | /**
22 | * Get the validation rules that apply to the request.
23 | *
24 | * @return array
25 | */
26 | public function rules()
27 | {
28 | return [
29 | 'name' => 'nullable|unique:seo_meta_tags,name|max:50',
30 | 'property' => 'nullable|unique:seo_meta_tags,property|max:100',
31 | 'status' => 'required|max:50',
32 | 'group' => 'nullable|max:50',
33 | 'input_type' => 'required|max:50',
34 | 'input_help_text' => 'nullable|max:255',
35 | 'input_placeholder' => 'nullable|max:255',
36 | 'input_label' => 'nullable|max:255',
37 | 'input_info' => 'nullable|max:255',
38 | 'visibility' => 'required|max:50',
39 | ];
40 | }
41 |
42 | /**
43 | * Get the error messages for the defined validation rules.
44 | *
45 | * @return array
46 | */
47 | public function messages()
48 | {
49 | return [
50 |
51 | ];
52 | }
53 |
54 | }
55 |
--------------------------------------------------------------------------------
/resources/views/pages/dashboard/social.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | Social Media Setting
4 | @endsection
5 | @section('tools')
6 |
7 | @endsection
8 | @section('content')
9 |
10 | Accounts
12 |
13 |
14 | Facebook
16 |
17 |
18 |
21 |
22 |
23 |
24 | @include('seo::tabs.social')
25 |
26 |
27 | @include('seo::forms.meta-tag-global',['tags'=>$og])
28 |
29 |
30 |
33 |
34 |
35 | @endSection
--------------------------------------------------------------------------------
/src/Http/Requests/MetaTags/Update.php:
--------------------------------------------------------------------------------
1 | user()->can('update', $this->route('meta_tag'));
18 | }
19 |
20 | /**
21 | * Get the validation rules that apply to the request.
22 | *
23 | * @return array
24 | */
25 | public function rules()
26 | {
27 | return [
28 | 'name' => 'nullable|max:50|unique:seo_meta_tags,name,' . $this->route('meta_tag')->id,
29 | 'property' => 'nullable|max:100|unique:seo_meta_tags,property,' . $this->route('meta_tag')->id,
30 | 'status' => 'required|max:50',
31 | 'group' => 'nullable|max:50',
32 | 'input_type' => 'required|max:50',
33 | 'input_help_text' => 'nullable|max:255',
34 | 'input_placeholder' => 'nullable|max:255',
35 | 'input_label' => 'nullable|max:255',
36 | 'input_info' => 'nullable|max:255',
37 | 'visibility' => 'required|max:50',
38 | ];
39 | }
40 |
41 | /**
42 | * Get the error messages for the defined validation rules.
43 | *
44 | * @return array
45 | */
46 | public function messages()
47 | {
48 | return [
49 |
50 | ];
51 | }
52 |
53 | }
54 |
--------------------------------------------------------------------------------
/src/Models/PageImage.php:
--------------------------------------------------------------------------------
1 | belongsTo(Page::class, 'page_id');
36 | }
37 |
38 | public function getSrc()
39 | {
40 | if (parse_url($this->src, PHP_URL_HOST)) {
41 | return $this->src;
42 | }
43 | return asset($this->src);
44 | }
45 |
46 | /**
47 | * @return varchar
48 | */
49 | public function getFullUrl()
50 | {
51 | if (parse_url($this->src, PHP_URL_HOST)) {
52 | return $this->src;
53 | }
54 | url($this->src);
55 | }
56 |
57 | public function getTitle()
58 | {
59 | return $this->title;
60 | }
61 |
62 | public function getCaption()
63 | {
64 | return $this->caption;
65 | }
66 |
67 | public function getLocation()
68 | {
69 | return $this->location;
70 | }
71 |
72 | }
--------------------------------------------------------------------------------
/resources/views/pages/pages/show.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | {{pathinfo($record->path,PATHINFO_BASENAME)}}
6 | @endsection
7 | @section('header')
8 | {{$record->title}}
9 | @endsection
10 | @section('tools')
11 |
12 |
30 |
31 | @endsection
32 | @section('content')
33 | @include('seo::includes.analysis')
34 | @endSection
--------------------------------------------------------------------------------
/src/Models/Setting.php:
--------------------------------------------------------------------------------
1 | first();
35 | return is_object($settings) ? $settings->$column : false;
36 | }
37 |
38 | /**
39 | * @param $files
40 | * @return array
41 | */
42 | public static function upload($files)
43 | {
44 | $imageMeta = [];
45 |
46 | $imageDriver = config('seo.storage.driver', 'public');
47 | $imagePrefix = config('seo.storage.prefix', 'storage');
48 | $imageFolder = config('seo.storage.folder', 'seo');
49 |
50 | foreach ($files as $key => $fields) {
51 | if (!isset($fields['value'])) {
52 | continue;
53 | }
54 | $img = $fields['value'];
55 | $path = $img->store($imageFolder, $imageDriver);
56 | $imageMeta[$key]['value'] = asset($imagePrefix . '/' . $path);
57 | }
58 | return $imageMeta;
59 | }
60 | }
--------------------------------------------------------------------------------
/resources/views/cards/page.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
5 |
6 |
7 | {{$record->getDescription()}}
8 |
9 |
10 |
40 |
41 |
--------------------------------------------------------------------------------
/resources/views/includes/site-nav-dropdown.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{isset($menu)?$menu:'Dashboard'}}
4 |
5 |
7 | Toggle Dropdown
8 |
9 |
26 |
--------------------------------------------------------------------------------
/src/Http/Controllers/SiteMapController.php:
--------------------------------------------------------------------------------
1 | Page::where('robot_index', 'index')->paginate(15)
25 | ]);
26 | }
27 |
28 | /**
29 | *
30 | */
31 | public function update(Update $update)
32 | {
33 | $mit = new \MultipleIterator(\MultipleIterator::MIT_KEYS_ASSOC);
34 | $mit->attachIterator(new \ArrayIterator($update->get('page_id')), "id");
35 | $mit->attachIterator(new \ArrayIterator($update->get('change_frequency')), "change_frequency");
36 | $mit->attachIterator(new \ArrayIterator($update->get('priority')), "priority");
37 |
38 | foreach ($mit as $page) {
39 | $pageModel = Page::find($page['id']);
40 |
41 | if ($pageModel) {
42 | $pageModel->change_frequency = $page['change_frequency'];
43 | $pageModel->priority = $page['priority'];
44 | $pageModel->save();
45 | }
46 | }
47 | return redirect()->back()->with(config('seo.flash_message'), 'Site Map settings saved successfully');
48 | }
49 |
50 | public function store()
51 | {
52 | dispatch(new SitemapGeneratorJob());
53 | return redirect()->back()->with(config('seo.flash_message'), 'Your request for generating sitemap are in queue now.');
54 | }
55 | }
--------------------------------------------------------------------------------
/resources/views/pages/dashboard/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 |
3 | @section('header')
4 | Dashboard
5 | @endsection
6 | @section('tools')
7 | @endsection
8 | @section('content')
9 |
10 | Home
12 |
13 |
14 | Site
16 |
17 |
18 | Webmaster Tools
21 |
22 | Personal/Company info
25 |
26 |
27 |
28 | @include('seo::tabs.dashboard')
29 | @include('seo::tabs.site')
30 |
31 | @include('seo::forms.meta-tag-global',['tags'=>$webmasterTags])
32 |
33 |
34 |
35 | @include('seo::tabs.ownership')
36 |
37 |
38 |
39 | @endSection
40 |
41 | @section('scripts')
42 |
50 | @endsection
--------------------------------------------------------------------------------
/config/seo.php:
--------------------------------------------------------------------------------
1 | 'seo::layouts.app',
7 | /**
8 | * Middleware that will wrap up seo routes
9 | */
10 | 'middleware' => 'auth',
11 | /**
12 | *
13 | */
14 | 'linkProviders' => [
15 |
16 | ],
17 | /**
18 | * Name of the flash variable that holds success message
19 | */
20 | 'flash_message' => 'permit_message',
21 |
22 | /**
23 | * Name of the flash variable that holds error message
24 | */
25 | 'flash_error' => 'permit_error',
26 |
27 | /**
28 | * Full path where robot.txt file will be saved.
29 | */
30 | 'robot_txt' => public_path('robots.txt'),
31 |
32 | /**
33 | * Full path where .htaccess file will be saved.
34 | */
35 | 'htaccess' => public_path('.htaccess'),
36 |
37 | /**
38 | * public folder of your xml sitemap
39 | */
40 | 'sitemap_location' => 'sitemaps',
41 |
42 | /**
43 | * Cache setting
44 | */
45 | 'cache' => [
46 | /**
47 | * file or database
48 | */
49 | 'driver' => 'file',
50 | /**
51 | * Do you like to serve seo tags from cache. It is highly recommended on production server.
52 | */
53 | 'enable' => true,
54 |
55 | /**
56 | * Path where html files will be saved.
57 | */
58 | 'storage' => storage_path('app/seo'),
59 |
60 | /**
61 | * After a this time cache will be update with database.
62 | *
63 | * Expire in seconds. Default it would be one hour
64 | */
65 | 'expire' => 3600
66 | ],
67 |
68 | /**
69 | * Image Storage
70 | */
71 | 'storage' => [
72 |
73 | /**
74 | * Storage driver
75 | */
76 | 'driver' => 'public',
77 |
78 | /**
79 | * Prefix which will be used before every image url
80 | */
81 | 'prefix' => 'storage',
82 |
83 | /**
84 | * Which folder on your driver will storage all the files
85 | */
86 | 'folder' => 'seo'
87 | ],
88 | 'models' => [
89 |
90 | ],
91 | ];
--------------------------------------------------------------------------------
/Policies/ImagePolicy.php:
--------------------------------------------------------------------------------
1 | isSuperAdmin()) {
20 | return true;
21 | }
22 | }
23 |
24 | /**
25 | * @param User $user
26 | * @return bool
27 | */
28 | public function index(User $user)
29 | {
30 | return false;
31 | }
32 |
33 | /**
34 | * Determine whether the user can create Image.
35 | *
36 | * @param User $user
37 | * @return mixed
38 | */
39 | public function create(User $user)
40 | {
41 | return false;
42 | }
43 |
44 | /**
45 | * Determine whether the user can store the Image.
46 | *
47 | * @param User $user
48 | * @param Image $image
49 | * @return mixed
50 | */
51 | public function store(User $user, Image $image)
52 | {
53 | return false;
54 | }
55 |
56 | /**
57 | * Determine whether the user can edit the Image.
58 | *
59 | * @param User $user
60 | * @param Image $image
61 | * @return mixed
62 | */
63 | public function edit(User $user, Image $image)
64 | {
65 | return false;
66 | }
67 |
68 | /**
69 | * Determine whether the user can update the Image.
70 | *
71 | * @param User $user
72 | * @param Image $image
73 | * @return mixed
74 | */
75 | public function update(User $user, Image $image)
76 | {
77 | return false;
78 | }
79 |
80 | /**
81 | * Determine whether the user can delete the Image.
82 | *
83 | * @param User $user
84 | * @param Image $image
85 | * @return mixed
86 | */
87 | public function delete(User $user, Image $image)
88 | {
89 | return false;
90 | }
91 |
92 | }
93 |
--------------------------------------------------------------------------------
/src/Http/Controllers/DashboardController.php:
--------------------------------------------------------------------------------
1 | Setting::paginate(10),
26 | 'model' => new Setting(),
27 | 'page_total' => Page::count(),
28 | 'meta_tag_total' => MetaTag::count(),
29 | 'setting_total' => Setting::count(),
30 | 'webmasterTags' => $metaTags['webmaster_tools'] ?? []
31 | ];
32 | return view('seo::pages.dashboard.index', $data);
33 | }
34 |
35 | /**
36 | * Manage Social Media
37 | */
38 | public function social()
39 | {
40 | $metaTags = MetaTag::forGlobal();
41 | $data = [
42 | 'records' => Setting::paginate(10),
43 | 'og' => $metaTags['og'] ?? [],
44 | 'twitter' => $metaTags['twitter'] ?? [],
45 | 'model' => new Setting(),
46 | ];
47 | return view('seo::pages.dashboard.social', $data);
48 | }
49 |
50 | /**
51 | * Manage Site map
52 | */
53 | public function sitemap()
54 | {
55 | $data = [
56 | 'pages' => Page::where('robot_index', 'index')->paginate(15),
57 | 'sitemaps' => (new SiteMap())->all()
58 | ];
59 | return view('seo::pages.dashboard.sitemap', $data);
60 | }
61 |
62 | /**
63 | * Import Export and Download Pages
64 | */
65 | public function tools()
66 | {
67 | $data = [];
68 | return view('seo::pages.dashboard.tools', $data);
69 | }
70 |
71 | /**
72 | *
73 | */
74 | public function advanced()
75 | {
76 | $data = [];
77 | return view('seo::pages.dashboard.advanced', $data);
78 | }
79 | }
80 |
--------------------------------------------------------------------------------
/resources/views/pages/images/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 | Dashboard
4 | Pages
5 | {{$page->path}}
6 | Images
7 |
8 | @endsection
9 | @section('header')
10 | Images
11 | @endsection
12 | @section('tools')
13 | Visit Page
14 |
15 | @endsection
16 | @section('content')
17 |
18 | @foreach($records->chunk(3) as $recordChunk)
19 | @foreach($recordChunk as $record)
20 |
21 |
22 |
23 |
{{$record->caption}}
24 |
25 |
26 |
27 | @include('seo::forms.destroy',['route'=>route('seo::pages.images.destroy',['page'=>$page->id,'pageImage'=>$record->id])])
28 |
29 |
{{$record->title}}
30 |
31 | {{$record->location}}
32 |
33 |
34 |
35 | @endforeach
36 | @endforeach
37 | @if($records->count()==0)
38 |
41 | @endif
42 |
43 | @endSection
--------------------------------------------------------------------------------
/resources/views/cards/setting.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
26 |
27 |
28 |
29 |
30 | Key
31 | {{$record->key}}
32 |
33 |
34 | Value
35 | {{$record->value}}
36 |
37 |
38 | Status
39 | {{$record->status}}
40 |
41 |
42 | Group
43 | {{$record->group}}
44 |
45 |
46 | Label
47 | {{$record->label}}
48 |
49 |
50 | Description
51 | {{$record->description}}
52 |
53 |
54 |
55 |
56 |
57 |
58 |
--------------------------------------------------------------------------------
/Policies/SettingPolicy.php:
--------------------------------------------------------------------------------
1 | isSuperAdmin()) {
20 | return true;
21 | }
22 | }
23 |
24 | /**
25 | * @param User $user
26 | * @return bool
27 | */
28 | public function index(User $user)
29 | {
30 | return false;
31 | }
32 |
33 | /**
34 | * Determine whether the user can edit the Setting.
35 | *
36 | * @param User $user
37 | * @param Setting $setting
38 | * @return mixed
39 | */
40 | public function edit(User $user, Setting $setting)
41 | {
42 | return false;
43 | }
44 |
45 | /**
46 | * Determine whether the user can update the Setting.
47 | *
48 | * @param User $user
49 | * @param Setting $setting
50 | * @return mixed
51 | */
52 | public function update(User $user, Setting $setting)
53 | {
54 | return false;
55 | }
56 |
57 | /**
58 | * Determine whether the user can store the Setting.
59 | *
60 | * @param User $user
61 | * @param Setting $setting
62 | * @return mixed
63 | */
64 | public function create(User $user)
65 | {
66 | return true;
67 | }
68 |
69 | /**
70 | * Determine whether the user can robotTxt the Setting.
71 | *
72 | * @param User $user
73 | * @param Setting $setting
74 | * @return mixed
75 | */
76 | public function robotTxt(User $user, Setting $setting)
77 | {
78 | return false;
79 | }
80 |
81 | /**
82 | * Determine whether the user can htaccess the Setting.
83 | *
84 | * @param User $user
85 | * @param Setting $setting
86 | * @return mixed
87 | */
88 | public function htaccess(User $user, Setting $setting)
89 | {
90 | return false;
91 | }
92 |
93 | }
94 |
--------------------------------------------------------------------------------
/resources/views/forms/image.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {{csrf_field()}}
3 |
4 |
17 |
30 |
40 |
41 | Location
42 |
43 |
46 | @if($errors->has('location'))
47 |
48 | {{ $errors->first('location') }}
49 |
50 | @endif
51 |
52 |
53 |
54 |
55 |
56 |
57 |
--------------------------------------------------------------------------------
/Policies/MetaTagPolicy.php:
--------------------------------------------------------------------------------
1 | isSuperAdmin()) {
20 | return true;
21 | }
22 | }
23 |
24 | /**
25 | * @param User $user
26 | * @return bool
27 | */
28 | public function index(User $user)
29 | {
30 | return false;
31 | }
32 |
33 | /**
34 | * Determine whether the user can create MetaTag.
35 | *
36 | * @param User $user
37 | * @return mixed
38 | */
39 | public function create(User $user)
40 | {
41 | return false;
42 | }
43 |
44 | /**
45 | * Determine whether the user can store the MetaTag.
46 | *
47 | * @param User $user
48 | * @param MetaTag $metaTag
49 | * @return mixed
50 | */
51 | public function store(User $user, MetaTag $metaTag)
52 | {
53 | return false;
54 | }
55 |
56 | /**
57 | * Determine whether the user can edit the MetaTag.
58 | *
59 | * @param User $user
60 | * @param MetaTag $metaTag
61 | * @return mixed
62 | */
63 | public function edit(User $user, MetaTag $metaTag)
64 | {
65 | return false;
66 | }
67 |
68 | /**
69 | * Determine whether the user can update the MetaTag.
70 | *
71 | * @param User $user
72 | * @param MetaTag $metaTag
73 | * @return mixed
74 | */
75 | public function update(User $user, MetaTag $metaTag)
76 | {
77 | return false;
78 | }
79 |
80 | /**
81 | * Determine whether the user can global the MetaTag.
82 | *
83 | * @param User $user
84 | * @param MetaTag $metaTag
85 | * @return mixed
86 | */
87 | public function global(User $user, MetaTag $metaTag)
88 | {
89 | return false;
90 | }
91 |
92 | /**
93 | * Determine whether the user can delete the MetaTag.
94 | *
95 | * @param User $user
96 | * @param MetaTag $metaTag
97 | * @return mixed
98 | */
99 | public function delete(User $user, MetaTag $metaTag)
100 | {
101 | return false;
102 | }
103 |
104 | }
105 |
--------------------------------------------------------------------------------
/resources/views/cards/meta_tag.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
26 |
27 |
28 |
29 |
30 | Name
31 | {{$record->name}}
32 |
33 |
34 | Property
35 | {{$record->property}}
36 |
37 |
38 | Status
39 | {{$record->status}}
40 |
41 |
42 | Group
43 | {{$record->group}}
44 |
45 |
46 | Input Type
47 | {{$record->input_type}}
48 |
49 |
50 | Input Placeholder
51 | {{$record->input_placeholder}}
52 |
53 |
54 | Input Label
55 | {{$record->input_label}}
56 |
57 |
58 | Input Info
59 | {{$record->input_info}}
60 |
61 |
62 | Visibility
63 | {{$record->visibility}}
64 |
65 |
66 |
67 |
68 |
69 |
70 |
--------------------------------------------------------------------------------
/src/Jobs/PageUploadJob.php:
--------------------------------------------------------------------------------
1 | filePath);
50 | $pages = $fileManager->config(['first_row_as_headline' => true])->read()->makeAssoc()->filter($this->filters)->getData();
51 |
52 | foreach ($pages as $page) {
53 | $images = [];
54 | if (isset($page['id'])) {
55 | $model = Page::find($page['id']);
56 | } elseif (isset($page['path'])) {
57 | $model = Page::whereIn('path', [trim((string) $page['path'], "/"), "/" . trim((string) $page['path'], "/"), url($page['path'])])->first();
58 | }
59 | if (!$model) {
60 | $model = new Page();
61 | }
62 | if (isset($page['images'])) {
63 | $images = $page['images'];
64 | unset($page['images']);
65 | }
66 | if ($model->fill($page)->save()) {
67 | if (!empty($images)) {
68 | if (strripos((string) $images, "|") !== false) {
69 | $images = explode("|", (string) $images);
70 | } else {
71 | $images = [$images];
72 | }
73 | }
74 | foreach ($images as $image) {
75 | PageImage::create([
76 | 'src' => $image,
77 | 'page_id' => $model->id
78 | ]);
79 | }
80 | }
81 |
82 | }
83 | }
84 | }
85 |
--------------------------------------------------------------------------------
/routes/web.php:
--------------------------------------------------------------------------------
1 | 'seo', 'as' => 'seo::',
4 | 'middleware' => ['web', config('seo.middleware', 'auth')],
5 | 'namespace' => '\SEO\Http\Controllers'], function () {
6 | Route::get('analysis', ['uses' => 'AnalysisController@index', 'analysis.index']);
7 | Route::get('dashboard', ['uses' => 'DashboardController@index', 'as' => 'dashboard.index']);
8 | Route::get('dashboard/social', ['uses' => 'DashboardController@social', 'as' => 'dashboard.social']);
9 | Route::get('dashboard/sitemap', ['uses' => 'DashboardController@sitemap', 'as' => 'dashboard.sitemap']);
10 | Route::get('dashboard/tools', ['uses' => 'DashboardController@tools', 'as' => 'dashboard.tools']);
11 | Route::get('dashboard/advanced', ['uses' => 'DashboardController@advanced', 'as' => 'dashboard.advanced']);
12 |
13 | Route::resource('pages.images', 'ImageController', ['except' => ['show'], 'parameters' => [
14 | 'images' => 'pageImage'
15 | ]]);
16 |
17 | Route::get('pages/bulk-edit', ['uses' => 'PageController@bulkEdit', 'as' => 'pages.bulkEdit']);
18 | Route::post('pages/bulk-update', ['uses' => 'PageController@bulkUpdate', 'as' => 'pages.bulkUpdate']);
19 |
20 | Route::post('pages/cache', ['uses' => 'PageController@cache', 'as' => 'pages.cache']);
21 |
22 | Route::post('pages/upload', ['uses' => 'PageController@upload', 'as' => 'pages.upload']);
23 |
24 | Route::get('pages/download-zip', ['uses' => 'PageController@zip', 'as' => 'pages.zip']);
25 |
26 | Route::get('pages/download', ['uses' => 'PageController@download', 'as' => 'pages.download']);
27 |
28 | Route::get('pages/meta/{page}', ['uses' => 'PageController@meta', 'as' => 'pages.meta']);
29 |
30 | Route::post('pages/meta/{page}', ['uses' => 'PageController@saveMeta', 'as' => 'pages.meta.save']);
31 |
32 | Route::get('pages/generate', ['uses' => 'PageController@generate', 'as' => 'pages.generate']);
33 |
34 | Route::resource('pages', 'PageController');
35 |
36 | Route::post('meta-tags/global', ['uses' => 'MetaTagController@global', 'as' => 'meta-tags.global']);
37 |
38 | Route::resource('meta-tags', 'MetaTagController');
39 |
40 | Route::post('settings/robot-txt', ['uses' => 'SettingController@robotTxt', 'as' => 'settings.robot_txt']);
41 | Route::post('settings/htaccess', ['uses' => 'SettingController@htaccess', 'as' => 'settings.htaccess']);
42 |
43 | Route::resource('settings', 'SettingController', ['only' => ['index', 'store']]);
44 |
45 | Route::post('sitemap/update', ['uses' => 'SiteMapController@update', 'as' => 'sitemap.update']);
46 | Route::post('sitemap/generate', ['uses' => 'SiteMapController@store', 'as' => 'sitemap.generate']);
47 | });
48 |
--------------------------------------------------------------------------------
/resources/views/includes/sidebar.blade.php:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/resources/views/pages/dashboard/tools.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('breadcrumb')
3 |
4 | @include('seo::includes.site-nav-dropdown',['menu'=>'Tools'])
5 |
6 |
7 | @endsection
8 | @section('tools')
9 |
10 | @endsection
11 | @section('content')
12 |
13 |
14 |
15 |
16 |
17 | Upload Your CSV file
18 |
19 |
20 |
22 | Upload CSV
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 | Download CSV
35 |
36 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 | Download page Html
51 |
52 |
57 |
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | Page Bulk Edit
66 |
67 |
72 |
73 |
74 |
75 |
76 |
77 |
78 | @include('seo::modals.page_upload')
79 |
80 | @endSection
--------------------------------------------------------------------------------
/resources/views/tabs/site.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{csrf_field()}}
4 |
21 |
50 |
51 |
52 |
53 |
54 |
--------------------------------------------------------------------------------
/resources/views/forms/setting.blade.php:
--------------------------------------------------------------------------------
1 |
2 | {{csrf_field()}}
3 |
4 |
14 |
15 |
25 |
26 |
36 |
37 |
47 |
48 |
58 |
59 |
69 |
70 |
71 |
72 |
73 |
74 |
75 |
76 |
--------------------------------------------------------------------------------
/src/Http/Controllers/LinkTagController.php:
--------------------------------------------------------------------------------
1 |
19 | */
20 | class LinkTagController extends Controller
21 | {
22 | /**
23 | * Display a listing of the resource.
24 | *
25 | * @return \Illuminate\Http\Response
26 | */
27 | public function index(Index $request)
28 | {
29 | return view('linktag.index', ['records' => LinkTag::paginate(10)]);
30 | }
31 |
32 | /**
33 | * Show the form for creating a new resource.
34 | *
35 | * @return \Illuminate\Http\Response
36 | */
37 | public function create(Create $request)
38 | {
39 | return view('linktag.create', [
40 | 'model' => new LinkTag,
41 | ]);
42 | }
43 |
44 | /**
45 | * Store a newly created resource in storage.
46 | *
47 | * @return \Illuminate\Http\Response
48 | */
49 | public function store(Store $request)
50 | {
51 | $model = new LinkTag;
52 | $model->fill($request->all());
53 |
54 | if ($model->save()) {
55 |
56 | session()->flash('app_message', 'LinkTag saved successfully');
57 |
58 | return redirect()->route('seo_link_tags.index');
59 | } else {
60 | session()->flash('app_message', 'Something is wrong while saving LinkTag');
61 | }
62 |
63 | return redirect()->back();
64 | }
65 |
66 | /**
67 | * Show the form for editing the specified resource.
68 | *
69 | * @return \Illuminate\Http\Response
70 | */
71 | public function edit(Edit $request, LinkTag $linktag)
72 | {
73 |
74 | return view('linktag.edit', [
75 | 'model' => $linktag,
76 | ]);
77 | }
78 |
79 | /**
80 | * Update a existing resource in storage.
81 | *
82 | * @return \Illuminate\Http\Response
83 | */
84 | public function update(Update $request, LinkTag $linktag)
85 | {
86 | $linktag->fill($request->all());
87 |
88 | if ($linktag->save()) {
89 | session()->flash('app_message', 'LinkTag successfully updated');
90 | return redirect()->route('seo_link_tags.index');
91 | } else {
92 | session()->flash('app_error', 'Something is wrong while updating LinkTag');
93 | }
94 | return redirect()->back();
95 | }
96 |
97 | /**
98 | * Delete a resource from storage.
99 | *
100 | * @return \Illuminate\Http\Response
101 | * @throws \Exception
102 | */
103 | public function destroy(Destroy $request, LinkTag $linktag)
104 | {
105 | if ($linktag->delete()) {
106 | session()->flash('app_message', 'LinkTag successfully deleted');
107 | } else {
108 | session()->flash('app_error', 'Error occurred while deleting LinkTag');
109 | }
110 |
111 | return redirect()->back();
112 | }
113 | }
114 |
--------------------------------------------------------------------------------
/resources/views/layouts/app.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 | {{config('app.name')}}
7 |
8 |
9 |
10 |
12 |
14 | @yield('css')
15 |
20 |
21 |
22 |
23 |
24 |
25 | {{config('app.name')}}
26 |
27 |
28 | @if (auth()->check())
29 |
30 |
33 | Logout
34 |
35 |
37 | {{ csrf_field() }}
38 |
39 |
40 | @else
41 |
42 | Login
43 |
44 | @endif
45 |
46 |
47 |
48 |
49 |
50 | @include('seo::includes.sidebar')
51 |
52 |
53 |
54 |
55 |
56 | @yield('header')
57 |
58 |
59 |
60 | @yield('tools')
61 |
62 |
63 | @yield('content')
64 |
65 |
66 |
67 |
68 |
71 |
74 |
77 |
78 | @yield('scripts')
79 |
80 |
81 |
--------------------------------------------------------------------------------
/resources/views/pages/pages/index.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | Pages
4 | @endsection
5 | @section('tools')
6 |
7 |
32 | @endsection
33 | @section('content')
34 |
35 |
36 |
61 |
62 | {!! $records->appends(['object'=>request('object'),'search'=>request('search')])->render() !!}
63 |
64 |
65 |
66 |
67 | @foreach($records as $record)
68 |
69 | @include('seo::cards.page')
70 |
71 | @endforeach
72 |
73 | {!! $records->render() !!}
74 | @include('seo::modals.page_upload')
75 | @endSection
--------------------------------------------------------------------------------
/resources/views/tabs/sitemap.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{csrf_field()}}
4 |
5 |
6 | Entries per sitemap page
7 |
11 |
12 |
13 | How frequently the page is likely to change
14 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 |
67 |
72 |
--------------------------------------------------------------------------------
/src/SeoServiceProvider.php:
--------------------------------------------------------------------------------
1 | 'Policies\ModelPolicy',
28 | Setting::class => SettingPolicy::class,
29 | Page::class => PagePolicy::class,
30 | MetaTag::class => MetaTagPolicy::class,
31 | PageImage::class => ImagePolicy::class
32 | ];
33 |
34 | /**
35 | *
36 | */
37 | public function boot()
38 | {
39 | $this->loadRoutesFrom(__DIR__ . '/../routes/web.php');
40 | $this->loadMigrationsFrom(__DIR__ . '/Database/migrations');
41 | $this->loadViewsFrom(__DIR__ . '/../resources/views', 'seo');
42 | $this->publishes([
43 | __DIR__ . '/../config/seo.php' => config_path('seo.php'),
44 | __DIR__ . '/../resources/views' => resource_path('views/vendor/seo'),
45 | ]);
46 | $this->publishes([
47 | __DIR__ . '/../Policies' => base_path('app/Policies/Seo')
48 | ], 'seo-policies');
49 | }
50 |
51 | /**
52 | *
53 | */
54 | public function register()
55 | {
56 | $this->registerPolicies();
57 | $this->mergeConfigFrom(
58 | __DIR__ . '/../config/seo.php', 'seo'
59 | );
60 | $blade = app('view')->getEngineResolver()->resolve('blade')->getCompiler();
61 | $blade->directive('seoForm', fn($model) => "");
62 | $blade->directive('seoTags', fn($model) => "tags()); ?>");
63 | Event::listen(['eloquent.saved: *', 'eloquent.created: *'], function ($name, $models) {
64 | $modelConfig = config('seo.models');
65 | $modelNames = array_keys($modelConfig);
66 |
67 | foreach ($models as $model) {
68 | $modelClassName = $model::class;
69 | if (in_array($modelClassName, $modelNames)) {
70 | if (isset($modelConfig[$modelClassName]['route'])) {
71 | $routes = $modelConfig[$modelClassName]['route'];
72 | $allowedRoutes = is_array($routes) ? $routes : [$routes];
73 | if (!in_array(Route::currentRouteName(), $allowedRoutes)) {
74 | continue;
75 | }
76 | }
77 | if (!isset($modelConfig[$modelClassName]['job'])) {
78 | continue;
79 | }
80 | $jobClass = $modelConfig[$modelClassName]['job'];
81 | $jobClass::dispatch($model)->onConnection('sync');
82 | }
83 | }
84 |
85 | });
86 | }
87 |
88 | /**
89 | * Register the Permitlication's policies.
90 | *
91 | * @return void
92 | */
93 | public function registerPolicies()
94 | {
95 | foreach ($this->policies as $key => $value) {
96 | Gate::policy($key, $value);
97 | }
98 | }
99 |
100 | /**
101 | * To register seo as first level command. E.g. seo:model
102 | *
103 | * @return array
104 | */
105 | public function provides()
106 | {
107 | return ['seo'];
108 | }
109 |
110 | }
111 |
--------------------------------------------------------------------------------
/src/Http/Controllers/ImageController.php:
--------------------------------------------------------------------------------
1 |
23 | */
24 | class ImageController extends Controller
25 | {
26 | /**
27 | * Display a listing of the resource.
28 | *
29 | * @return Response
30 | */
31 | public function index(Index $request, Page $page)
32 | {
33 |
34 | return view('seo::pages.images.index', [
35 | 'records' => $page->pageImages()->paginate(10),
36 | 'page' => $page
37 | ]);
38 | }
39 |
40 |
41 | /**
42 | * Show the form for creating a new resource.
43 | *
44 | * @return Response
45 | */
46 | public function create(Create $request, Page $page)
47 | {
48 | return view('seo::pages.images.create', [
49 | 'model' => new PageImage(),
50 | 'page' => $page
51 |
52 | ]);
53 | }
54 |
55 | /**
56 | * Store a newly created resource in storage.
57 | *
58 | * @return Response
59 | */
60 | public function store(Store $request, Page $page)
61 | {
62 | $model = new PageImage();
63 | $model->fill($request->all());
64 | $model->page_id = $page->id;
65 |
66 | if ($model->save()) {
67 | session()->flash(config('seo.flash_message'), 'Image saved successfully');
68 |
69 | return redirect()->route('seo::pages.images.index', $page->id);
70 | } else {
71 | session()->flash(config('seo.flash_error'), 'Something is wrong while saving Image');
72 | }
73 |
74 | return redirect()->back();
75 | }
76 |
77 | /**
78 | * Show the form for editing the specified resource.
79 | *
80 | * @return Response
81 | */
82 | public function edit(Edit $request, Page $page, PageImage $pageImage)
83 | {
84 | return view('seo::pages.images.edit', [
85 | 'model' => $pageImage,
86 | 'page' => $page
87 | ]);
88 | }
89 |
90 | /**
91 | * Update a existing resource in storage.
92 | *
93 | * @return Response
94 | */
95 | public function update(Update $request, Page $page, PageImage $pageImage)
96 | {
97 | $pageImage->fill($request->all());
98 |
99 | if ($pageImage->save()) {
100 | session()->flash(config('seo.flash_message'), 'Image successfully updated');
101 | return redirect()->route('seo::pages.images.index', $page->id);
102 | } else {
103 | session()->flash(config('seo.flash_error'), 'Something is wrong while updating Image');
104 | }
105 | return redirect()->back();
106 | }
107 |
108 | /**
109 | * Delete a resource from storage.
110 | *
111 | * @return Response
112 | * @throws \Exception
113 | */
114 | public function destroy(Destroy $request, Page $page, PageImage $pageImage)
115 | {
116 | if ($pageImage->delete()) {
117 | session()->flash(config('seo.flash_message'), 'Image successfully deleted');
118 | } else {
119 | session()->flash(config('seo.flash_error'), 'Error occurred while deleting Image');
120 | }
121 |
122 | return redirect()->back();
123 | }
124 |
125 | }
126 |
--------------------------------------------------------------------------------
/src/Http/Controllers/SettingController.php:
--------------------------------------------------------------------------------
1 |
22 | */
23 | class SettingController extends Controller
24 | {
25 | /**
26 | * Display a listing of the resource.
27 | *
28 | * @return Response
29 | */
30 | public function index(Index $request)
31 | {
32 | return view('seo::pages.settings.index', [
33 | 'records' => Setting::paginate(10),
34 | 'model' => new Setting(),
35 | 'sitemaps' => (new SiteMap())->all(),
36 | 'metaTags'=>[]
37 | ]
38 | );
39 | }
40 |
41 | /**
42 | * Show the form for editing the specified resource.
43 | *
44 | * @return Response
45 | */
46 | public function edit(Edit $request, Setting $setting)
47 | {
48 | return view('seo::pages.settings.edit', [
49 | 'model' => $setting,
50 | ]);
51 | }
52 |
53 | /**
54 | * Update a existing resource in storage.
55 | *
56 | * @return Response
57 | */
58 | public function update(Update $request, Setting $setting)
59 | {
60 | $setting->fill($request->all());
61 |
62 | if ($setting->save()) {
63 | session()->flash(config('seo.flash_message'), 'Setting successfully updated');
64 | return redirect()->route('seo::settings.index');
65 | } else {
66 | session()->flash(config('seo.flash_error'), 'Something is wrong while updating Setting');
67 | }
68 | return redirect()->back();
69 | }
70 |
71 | /**
72 | * Update a existing resource in storage.
73 | *
74 | * @param Setting $setting
75 | * @return Response
76 | */
77 | public function store(Store $request)
78 | {
79 | $settings = $request->get('settings', []);
80 | foreach ($settings as $key => $fields) {
81 | Setting::where('key', $key)->update($fields);
82 | }
83 | $fields = $request->file('settings', []);
84 | $files = Setting::upload($fields);
85 |
86 | foreach ($files as $key => $fileFields) {
87 | Setting::where('key', $key)->update($fileFields);
88 | }
89 | session()->flash(config('seo.flash_message'), 'Setting successfully updated');
90 |
91 | return redirect()->back();
92 | }
93 |
94 | /**
95 | * Update robot.txt file
96 | *
97 | * @return \Illuminate\Http\RedirectResponse
98 | */
99 | public function robotTxt(Request $request)
100 | {
101 | $robotValue = $request->get('robot_txt');
102 | $robotTxt = new RobotTxt();
103 | $robotTxt->save($robotValue);
104 |
105 | return redirect()->back()->with(config('seo.flash_message'), 'Robot.txt file updated successfully');
106 |
107 | }
108 |
109 | /**
110 | * Update robot.txt file
111 | *
112 | * @return void
113 | */
114 | public function htaccess(Request $request)
115 | {
116 | $htaccessValue = $request->get('htaccess');
117 |
118 | $htaccess = new HtaccessFile();
119 | $htaccess->save($htaccessValue);
120 |
121 | return redirect()->back()->with(config('seo.flash_message'), '.htaccess file updated successfully');
122 | }
123 | }
124 |
--------------------------------------------------------------------------------
/src/Jobs/PageGeneratorJob.php:
--------------------------------------------------------------------------------
1 | all();
44 |
45 | foreach ($links as $link) {
46 | $page = $this->page($link);
47 |
48 | if ($page->save()) {
49 | $total++;
50 | PageImage::where('page_id', $page->id)->delete();
51 |
52 | if (isset($link['images']) && !empty($link['images']) && is_array($link['images'])) {
53 | $this->pageImage($page, $link['images']);
54 | }
55 | }
56 | }
57 | }
58 | }
59 | }
60 |
61 | /**
62 | * @param Page $page
63 | * @param array $images
64 | */
65 | protected function pageImage($page, $images)
66 | {
67 | foreach ($images as $image) {
68 | if (is_array($image)) {
69 | if (!isset($image['src'])) {
70 | continue;
71 | }
72 | $pageImage = PageImage::create(['src' => $image['src'], 'page_id' => $page->id]);
73 |
74 | if (isset($image['title'])) {
75 | $pageImage->title = $image['title'];
76 | }
77 | if (isset($image['caption'])) {
78 | $pageImage->caption = $image['caption'];
79 |
80 | }
81 | if (isset($image['location'])) {
82 | $pageImage->location = $image['location'];
83 | }
84 |
85 | } else {
86 | PageImage::create(['src' => $image, 'page_id' => $page->id]);
87 | }
88 | }
89 | }
90 |
91 | /**
92 | * @param $link
93 | * @return Page
94 | */
95 | protected function page($link)
96 | {
97 | $setting = new Setting();
98 |
99 | $changeFrequency = $setting->getValueByKey('page_changefreq');
100 | $priority = $setting->getValueByKey('page_priority');
101 |
102 | $path = $link['link'];
103 | $object = $link['object'] ?? null;
104 | $objectId = $link['object_id'] ?? null;
105 | $page = Page::firstOrNew(['object' => $object, 'object_id' => $objectId]);
106 |
107 | $page->path = $path;
108 | $page->canonical_url = $path;
109 | $page->title_source = isset($link['title']) ? substr((string) $link['title'], 0, 70) : '';
110 | $page->description_source = isset($link['description']) ? substr((string) $link['description'], 0, 150) : '';
111 |
112 | $page->created_at = $link['created_at'] ?? '';
113 | $page->updated_at = $link['updated_at'] ?? '';
114 | $page->change_frequency = !empty($changeFrequency) ? $changeFrequency : 'monthly';
115 | $page->priority = (!empty($priority) && $priority < 1.1) ? $priority : 0.5;
116 |
117 | return $page;
118 | }
119 | }
120 |
--------------------------------------------------------------------------------
/resources/views/forms/fields/page_fields.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | Title
4 |
7 |
8 | @if($errors->has('page.title'))
9 |
10 | {{ $errors->first('page.title') }}
11 |
12 | @endif
13 |
14 |
15 |
16 | Robot Index
17 |
18 | Default
19 | robot_index)=='index'?'selected':''}}>Index
20 |
21 | robot_index)=='noindex'?'selected':''}}>No
22 | Index
23 |
24 |
25 |
26 | @if($errors->has('page.robot_index'))
27 |
28 | {{ $errors->first('page.robot_index') }}
29 |
30 | @endif
31 |
32 |
33 | Robot Follow
34 |
35 | Default
36 | robot_follow)=='follow'?'selected':''}}>Follow
37 |
38 | robot_follow)=='nofollow'?'selected':''}}>No
39 | Follow
40 |
41 |
42 |
43 | @if($errors->has('page.robot_follow'))
44 |
45 | {{ $errors->first('page.robot_follow') }}
46 |
47 | @endif
48 |
49 |
50 |
51 | @if(isset($showPageUrl) && !empty($showPageUrl))
52 |
53 | Page Url
54 |
57 | @if($errors->has('page.path'))
58 |
59 | {{ $errors->first('page.path') }}
60 |
61 | @endif
62 |
63 | @endif
64 |
65 |
66 | Canonical Url
67 |
69 | @if($errors->has('page.canonical_url'))
70 |
71 | {{ $errors->first('page.canonical_url') }}
72 |
73 | @endif
74 |
75 |
76 |
77 |
78 | Description
79 | {{old('page.description',$model->getDescription())}}
81 |
82 |
83 | @if($errors->has('page.description'))
84 |
85 | {{ $errors->first('page.description') }}
86 |
87 | @endif
88 |
--------------------------------------------------------------------------------
/src/Services/SchemaBuilder.php:
--------------------------------------------------------------------------------
1 | settings = Setting::where('group', 'ownership')->pluck('value', 'key')->toArray();
26 | $this->socialAccounts = Setting::where('group', 'social_media_links')->pluck('value', 'key')->toArray();
27 | }
28 |
29 | /**
30 | * @return null|string
31 | */
32 | public function ownership()
33 | {
34 | $info = $this->buildOwnerShip();
35 | return !empty($info) ? json_encode($info, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) : null;
36 | }
37 |
38 | /**
39 | * @return array|void
40 | */
41 | private function buildOwnerShip()
42 | {
43 | $arr = [];
44 |
45 | if (!empty($this->settings['ownership_type'])) {
46 | $arr['@context'] = 'https://schema.org';
47 | $arr['@type'] = $this->settings['ownership_type'];
48 | $arr['name'] = $this->settings['ownership_name'];
49 | $arr['url'] = $this->settings['ownership_url'];
50 | $arr = $this->logo($arr);
51 |
52 | if (!empty($this->settings['ownership_address'])) {
53 | $arr['address'] = $this->settings['ownership_address'];
54 | }
55 | if (!empty($this->settings['ownership_email']) && filter_var($this->settings['ownership_email'], FILTER_VALIDATE_EMAIL)) {
56 | $arr['email'] = $this->settings['ownership_email'];
57 | }
58 |
59 | $arr['sameAs'] = $this->getSocialMediaLinks();
60 | $arr = $this->telephone($arr);
61 |
62 |
63 | }
64 | return $arr;
65 | }
66 |
67 | /**
68 | *
69 | */
70 | private function getSocialMediaLinks()
71 | {
72 | $retArr = [];
73 |
74 | foreach ($this->socialAccounts as $sm => $url) {
75 | if (!empty($url)) {
76 | $retArr[] = $url;
77 | }
78 | }
79 | return $retArr;
80 | }
81 |
82 | /**
83 | * @param $arr
84 | * @return mixed
85 | */
86 | private function telephone($arr)
87 | {
88 | if (isset($this->settings['ownership_contact_point_telephone']) && !empty($this->settings['ownership_contact_point_telephone'])) {
89 | if ($this->settings['ownership_type'] == 'Organization') {
90 | $arr['contactPoint'] = [
91 | [
92 | "@type" => "ContactPoint",
93 | 'telephone' => $this->settings['ownership_contact_point_telephone'],
94 | 'contactType' => $this->settings['ownership_contact_point_contact_type']
95 | ]
96 | ];
97 | } else {
98 | $arr['telephone'] = $this->settings['ownership_contact_point_telephone'];
99 | }
100 | }
101 | return $arr;
102 | }
103 |
104 | /**
105 | * @param $arr
106 | * @return array
107 | */
108 | private function logo($arr)
109 | {
110 | if (isset($this->settings['ownership_logo']) && !empty($this->settings['ownership_logo']) && filter_var($this->settings['ownership_logo'], FILTER_VALIDATE_URL)) {
111 | if ($this->settings['ownership_type'] == 'Organization') {
112 | $arr['logo'] = $this->settings['ownership_logo'];
113 | } else {
114 | $arr['image'] = $this->settings['ownership_logo'];
115 | }
116 | }
117 | return $arr;
118 | }
119 |
120 |
121 | }
122 |
--------------------------------------------------------------------------------
/src/Http/Controllers/MetaTagController.php:
--------------------------------------------------------------------------------
1 |
22 | */
23 | class MetaTagController extends Controller
24 | {
25 | /**
26 | * Display a listing of the resource.
27 | *
28 | * @return Response
29 | */
30 | public function index(Index $request)
31 | {
32 | return view('seo::pages.meta_tags.index', ['records' => MetaTag::paginate(6)]);
33 | }
34 |
35 |
36 | /**
37 | * Show the form for creating a new resource.
38 | *
39 | * @return Response
40 | */
41 | public function create(Create $request)
42 | {
43 | return view('seo::pages.meta_tags.create', [
44 | 'model' => new MetaTag,
45 | ]);
46 | }
47 |
48 | /**
49 | * Store a newly created resource in storage.
50 | *
51 | * @return Response
52 | */
53 | public function store(Store $request)
54 | {
55 | $model = new MetaTag;
56 | $model->fill($request->all());
57 |
58 | if ($model->save()) {
59 |
60 | session()->flash(config('seo.flash_message'), 'MetaTag saved successfully');
61 | return redirect()->route('seo::meta-tags.index');
62 | } else {
63 | session()->flash(config('seo.flash_error'), 'Something is wrong while saving MetaTag');
64 | }
65 | return redirect()->back();
66 | }
67 |
68 | /**
69 | * Show the form for editing the specified resource.
70 | *
71 | * @return Response
72 | */
73 | public function edit(Edit $request, MetaTag $meta_tag)
74 | {
75 | return view('seo::pages.meta_tags.edit', [
76 | 'model' => $meta_tag,
77 | ]);
78 | }
79 |
80 | /**
81 | * Update a existing resource in storage.
82 | *
83 | * @return Response
84 | */
85 | public function update(Update $request, MetaTag $meta_tag)
86 | {
87 | $meta_tag->fill($request->all());
88 |
89 | if ($meta_tag->save()) {
90 |
91 | session()->flash(config('seo.flash_message'), 'MetaTag successfully updated');
92 | return redirect()->route('seo::meta-tags.index');
93 | } else {
94 | session()->flash(config('seo.flash_error'), 'Something is wrong while updating MetaTag');
95 | }
96 | return redirect()->back();
97 | }
98 |
99 | /**
100 | * @return \Illuminate\Http\RedirectResponse
101 | */
102 | public function global(Request $request)
103 | {
104 | $metaValues = $request->get('meta', []);
105 | foreach ($metaValues as $id => $content) {
106 | $pageMeta = PageMetaTag::firstOrCreate(['seo_page_id' => null, 'seo_meta_tag_id' => $id]);
107 | $pageMeta->content = $content;
108 | $pageMeta->save();
109 | }
110 | return redirect()->back()->with(config('seo.flash_message'), 'Global Meta Tags saved successfully');
111 | }
112 |
113 | /**
114 | * Delete a resource from storage.
115 | *
116 | * @return Response
117 | * @throws \Exception
118 | */
119 | public function destroy(Destroy $request, MetaTag $meta_tag)
120 | {
121 | if ($meta_tag->delete()) {
122 | session()->flash(config('seo.flash_message'), 'MetaTag successfully deleted');
123 | } else {
124 | session()->flash(config('seo.flash_error'), 'Error occurred while deleting MetaTag');
125 | }
126 |
127 | return redirect()->back();
128 | }
129 | }
130 |
--------------------------------------------------------------------------------
/resources/views/pages/pages/bulk-edit.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | Pages
4 | @endsection
5 | @section('tools')
6 |
7 | New Page
8 |
9 | @endsection
10 | @section('content')
11 |
12 | {{csrf_field()}}
13 |
14 |
82 | @endSection
--------------------------------------------------------------------------------
/resources/views/tabs/ownership.blade.php:
--------------------------------------------------------------------------------
1 | This data is shown as metadata in your site. It is intended to appear in
2 | Google's Knowledge Graph.
3 | You can be either a company or a person
4 |
5 | {{csrf_field()}}
6 |
7 | Organization / person
8 |
10 | Choose
11 | getValueByKey('ownership_type')=='Person'?'selected':''}}>Person
12 | getValueByKey('ownership_type')=='Organization'?'selected':''}}>
13 | Organization
14 |
15 |
16 |
17 |
18 |
19 | Web
20 | Site
21 |
24 |
25 |
26 |
27 | Name
28 |
31 |
32 |
33 |
34 | Email Address
35 |
38 |
39 |
40 |
47 |
48 | Customer
49 | Service Number
50 |
54 |
55 |
67 |
68 |
69 | @if($model->getValueByKey('ownership_logo'))
70 |
71 | @endif
72 |
73 |
74 |
75 |
--------------------------------------------------------------------------------
/resources/views/tabs/social.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | {{csrf_field()}}
4 |
5 |
6 |
18 |
32 |
33 |
34 |
47 |
48 |
63 |
64 |
75 |
76 |
77 |
89 |
90 |
91 |
92 |
93 |
--------------------------------------------------------------------------------
/resources/views/tabs/dashboard.blade.php:
--------------------------------------------------------------------------------
1 |
2 |
3 | On Page Seo Tool for Laravel
4 |
5 | By using this tool you can easily about to insert on page seo tags like title, meta tags, scripts, webmaster
6 | validation, robot.txt file content. It also generate site map of your site with one click.
7 | You can able to import and export meta tags by csv or excel file.
8 |
9 |
10 |
11 |
12 |
13 |
14 |
17 |
18 |
{{$setting_total or 0 }}
19 | Global settings
20 |
21 |
22 |
23 |
24 |
25 |
36 |
37 |
{{$page_total or 0 }}
38 | Pages that are optimized
39 |
40 |
41 |
42 |
43 |
44 |
45 |
55 |
56 |
57 | {{isset($meta_tag_total)?$meta_tag_total: 0 }}
58 | Meta Tags
59 |
60 |
61 |
62 |
63 |
64 |
65 |
Social Media
66 |
93 |
94 |
102 |
--------------------------------------------------------------------------------
/resources/views/pages/dashboard/sitemap.blade.php:
--------------------------------------------------------------------------------
1 | @extends(config('seo.layout'))
2 | @section('header')
3 | XML SiteMap Manger
4 | @endsection
5 | @section('tools')
6 |
7 | @endsection
8 | @section('content')
9 |
10 | {{csrf_field()}}
11 |
12 |
70 |
71 |
72 |
73 |
89 |
94 | @endSection
--------------------------------------------------------------------------------