Webfont changes
This commit is contained in:
parent
49c2f1c9d8
commit
de1ccc7c0b
|
|
@ -7,11 +7,5 @@ return [
|
|||
'route' => 'admin.cms.webfont',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
], [
|
||||
'key' => 'cms.homeseo',
|
||||
'name' => 'webfont::app.homeseo',
|
||||
'route' => 'admin.cms.homeseo',
|
||||
'sort' => 2,
|
||||
'icon-class' => '',
|
||||
]
|
||||
];
|
||||
|
|
@ -10,6 +10,4 @@ Route::group(['middleware' => ['admin']], function () {
|
|||
Route::get('admin/webfont/activate/{id}', 'Webkul\Webfont\Http\Controllers\WebfontController@activate')->name('admin.cms.webfont.activate');
|
||||
|
||||
Route::post('admin/webfont/remove/{id}', 'Webkul\Webfont\Http\Controllers\WebfontController@remove')->name('admin.cms.webfont.remove');
|
||||
|
||||
Route::get('admin/home/seo', 'Webkul\Webfont\Http\Controllers\WebfontController@homeSeo')->name('admin.cms.homeseo');
|
||||
});
|
||||
|
|
|
|||
|
|
@ -4,10 +4,28 @@ namespace Webkul\Webfont\Models;
|
|||
|
||||
use Illuminate\Database\Eloquent\Model;
|
||||
use Webkul\Webfont\Contracts\Webfont as WebfontContract;
|
||||
use Company;
|
||||
|
||||
class Webfont extends Model implements WebfontContract
|
||||
{
|
||||
protected $table = 'google_web_fonts';
|
||||
|
||||
protected $fillable = ['font', 'activated'];
|
||||
protected $fillable = ['font', 'activated', 'company_id'];
|
||||
|
||||
/**
|
||||
* Create a new Eloquent query builder for the model.
|
||||
*
|
||||
* @param \Illuminate\Database\Query\Builder $query
|
||||
* @return \Illuminate\Database\Eloquent\Builder|static
|
||||
*/
|
||||
public function newEloquentBuilder($query)
|
||||
{
|
||||
$company = Company::getCurrent();
|
||||
|
||||
if (auth()->guard('super-admin')->check() || ! isset($company->id)) {
|
||||
return new \Illuminate\Database\Eloquent\Builder($query);
|
||||
} else {
|
||||
return new \Illuminate\Database\Eloquent\Builder($query->where('google_web_fonts' . '.company_id', $company->id));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -22,7 +22,7 @@ class WebfontServiceProvider extends ServiceProvider
|
|||
|
||||
$this->loadRoutesFrom(__DIR__ . '/../Http/routes.php');
|
||||
|
||||
$this->app->concord->registerModel(\Webkul\Webfont\Contracts\Webfont::class, \Webkul\Webfont\Models\Webfont::class);
|
||||
\Webkul\Webfont\Models\Webfont::observe(\Webkul\Webfont\Observers\WebfontObserver::class);
|
||||
|
||||
$this->app->register(EventServiceProvider::class);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue