Skip to content

Commit

Permalink
added SEO for other pages
Browse files Browse the repository at this point in the history
  • Loading branch information
sawirricardo committed May 19, 2021
1 parent 97cc4a1 commit c7b8994
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 0 deletions.
4 changes: 4 additions & 0 deletions app/Http/Livewire/App/Article/Create.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\App\Article;

use Artesaos\SEOTools\Facades\SEOTools;
use Livewire\Component;
use Illuminate\Support\Str;

Expand All @@ -14,6 +15,9 @@ class Create extends Component
public function mount()
{
$this->article = new \App\Models\Article();

SEOTools::setTitle('Create new article', false);
SEOTools::setDescription('New article created here.');
}

protected $rules = [
Expand Down
4 changes: 4 additions & 0 deletions app/Http/Livewire/App/Article/Edit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\App\Article;

use Artesaos\SEOTools\Facades\SEOTools;
use Livewire\Component;
use Illuminate\Support\Str;

Expand All @@ -17,6 +18,9 @@ public function mount(\App\Models\Article $article)
$this->article_tags = $article->tags->map(function ($tag) {
return $tag->id;
});

SEOTools::setTitle('Edit article', false);
SEOTools::setDescription('Article is being edited.');
}

protected $rules = [
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Livewire/App/Login.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\App;

use Artesaos\SEOTools\Facades\SEOTools;
use Illuminate\Support\Facades\Auth;
use Livewire\Component;

Expand All @@ -17,6 +18,11 @@ class Login extends Component
'credentials.password' => ['required'],
];

public function mount()
{
SEOTools::setTitle('Login', false);
}

public function render()
{
return view('livewire.app.login');
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Livewire/App/Register.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\App;

use Artesaos\SEOTools\Facades\SEOTools;
use Illuminate\Support\Facades\Auth;
use Illuminate\Validation\Rules\Password;
use Livewire\Component;
Expand Down Expand Up @@ -34,6 +35,11 @@ protected function rules()
];
}

public function mount()
{
SEOTools::setTitle('Sign Up', false);
}

public function render()
{
return view('livewire.app.register');
Expand Down
3 changes: 3 additions & 0 deletions app/Http/Livewire/App/Setting.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

namespace App\Http\Livewire\App;

use Artesaos\SEOTools\Facades\SEOTools;
use Illuminate\Support\Facades\Hash;
use Illuminate\Validation\Rule;
use Illuminate\Validation\Rules\Password;
Expand All @@ -15,6 +16,8 @@ public function mount()
{
$userId = auth()->user()->getAuthIdentifier();
$this->user = \App\Models\User::find($userId)->toArray();

SEOTools::setTitle('My setting', false);
}

protected function rules()
Expand Down

0 comments on commit c7b8994

Please sign in to comment.