mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#3409 Arapça sorunu
This commit is contained in:
parent
713c2d5987
commit
ac3f51194a
@ -1,5 +1,6 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv;
|
||||
|
||||
use Visiosoft\AdvsModule\Adv\Command\AddSlug;
|
||||
use Visiosoft\AdvsModule\Adv\Command\DeleteOptionConfiguration;
|
||||
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
|
||||
use Anomaly\Streams\Platform\Entry\EntryObserver;
|
||||
@ -8,6 +9,13 @@ use Visiosoft\AdvsModule\Adv\Event\DeletingAd;
|
||||
|
||||
class AdvObserver extends EntryObserver
|
||||
{
|
||||
public function updating(EntryInterface $entry)
|
||||
{
|
||||
$this->dispatch(new AddSlug($entry));
|
||||
|
||||
parent::updating($entry);
|
||||
}
|
||||
|
||||
public function deleting(EntryInterface $entry)
|
||||
{
|
||||
$this->dispatch(new DeleteOptionConfiguration($entry));
|
||||
|
||||
@ -0,0 +1,23 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Adv\Command;
|
||||
|
||||
use Illuminate\Support\Str;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvInterface;
|
||||
|
||||
class AddSlug
|
||||
{
|
||||
protected $ad;
|
||||
|
||||
public function __construct(AdvInterface $ad)
|
||||
{
|
||||
$this->ad = $ad;
|
||||
}
|
||||
|
||||
public function handle()
|
||||
{
|
||||
if (!$this->ad->slug && $this->ad->name) {
|
||||
$this->ad->update([
|
||||
'slug' => Str::slug($this->ad->name)
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -63,7 +63,9 @@ class AdvFormBuilder extends FormBuilder
|
||||
|
||||
protected $rules = [];
|
||||
|
||||
protected $skips = [];
|
||||
protected $skips = [
|
||||
'slug'
|
||||
];
|
||||
|
||||
protected $actions = [];
|
||||
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
<?php namespace Visiosoft\AdvsModule\Http\Controller;
|
||||
|
||||
use Anomaly\FilesModule\File\Contract\FileRepositoryInterface;
|
||||
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
|
||||
use Anomaly\Streams\Platform\Http\Controller\PublicController;
|
||||
use Anomaly\Streams\Platform\Message\MessageBag;
|
||||
@ -11,7 +10,6 @@ use Illuminate\Contracts\Events\Dispatcher;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Support\Facades\Auth;
|
||||
use Illuminate\Support\Facades\Cookie;
|
||||
use Illuminate\Support\Str;
|
||||
use Visiosoft\AdvsModule\Adv\AdvModel;
|
||||
use Visiosoft\AdvsModule\Adv\Contract\AdvRepositoryInterface;
|
||||
use Visiosoft\AdvsModule\Adv\Event\ChangedStatusAd;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user