diff --git a/app/Helpers/helpers.php b/app/Helpers/helpers.php index 9f0c4123..57cace3a 100644 --- a/app/Helpers/helpers.php +++ b/app/Helpers/helpers.php @@ -33,10 +33,12 @@ if(!function_exists('category_menu')){ * make menu from categories */ function category_menu(){ - $categories = main_categories(); - if(count($categories)>6){ - } + return \App\Models\Category::main()->select('id','title_tm','title_ru')->get(); +// $categories = main_categories(); +// if(count($categories)>6){ +// //todo implement top category menu +// } } } diff --git a/app/Http/Controllers/EventCheckoutController.php b/app/Http/Controllers/EventCheckoutController.php index 7e10c024..c18d056b 100644 --- a/app/Http/Controllers/EventCheckoutController.php +++ b/app/Http/Controllers/EventCheckoutController.php @@ -277,10 +277,11 @@ class EventCheckoutController extends Controller ]; if ($this->is_embedded) { - return view('Public.ViewEvent.Embedded.EventPageCheckout', $data); + return view('Public.ViewEvent.Embedded.EventPageCheckout', $data); // <--- todo check this out } - return view('Public.ViewEvent.EventPageCheckout', $data); +// return view('Public.ViewEvent.EventPageCheckout', $data); + return view('Bilettm.ViewEvent.EventPageCheckout', $data); } /** diff --git a/app/Http/routes.php b/app/Http/routes.php index 2cb8410f..2ff09eb5 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -120,11 +120,11 @@ Route::group( /* * Public event page routes */ - Route::group(['prefix' => 'category'], function () { + Route::group(['prefix' => 'c'], function () { /** * Events by category */ - Route::get('/{category_id}', [ + Route::get('/{cat_id}/{cat_slug?}', [ 'as' => 'showCategoryEventsPage', 'uses' => 'PublicController@showCategoryEvents', ]); diff --git a/app/Models/Category.php b/app/Models/Category.php index 6ec36f2d..f2cb215a 100644 --- a/app/Models/Category.php +++ b/app/Models/Category.php @@ -9,6 +9,9 @@ namespace App\Models; +use Illuminate\Support\Facades\Config; +use Illuminate\Support\Str; + class Category extends \Illuminate\Database\Eloquent\Model{ use \Backpack\CRUD\CrudTrait; /** @@ -30,6 +33,22 @@ class Category extends \Illuminate\Database\Eloquent\Model{ */ protected $softDelete = false; protected $fillable = ['title_tm','title_ru','view_type','lft','rgt','parent_id','depth']; + + /** + * Get the url of the event. + * + * @return string + */ + public function getUrlAttribute() + { + return route("showCategoryEventsPage", ["cat_id"=>$this->id, "cat_slug"=>Str::slug($this->title)]); + //return URL::to('/') . '/e/' . $this->id . '/' . Str::slug($this->title); + } + + public function getTitleAttribute(){ + + return $this->{'title_'.Config::get('app.locale')}; + } /** * The events associated with the category. * diff --git a/composer.json b/composer.json index cd9a0e14..fb10a170 100755 --- a/composer.json +++ b/composer.json @@ -46,9 +46,7 @@ "backpack/settings": "^2.1", "backpack/pagemanager": "^1.1", "backpack/permissionmanager": "^4.0", - "davejamesmiller/laravel-breadcrumbs": "5.3", - "teamtnt/tntsearch": "^2.1", - "teamtnt/laravel-scout-tntsearch-driver": "^7.2" + "davejamesmiller/laravel-breadcrumbs": "5.3" }, diff --git a/config/app.php b/config/app.php index da6d405b..9d495990 100644 --- a/config/app.php +++ b/config/app.php @@ -65,7 +65,7 @@ return [ | */ - 'locale' => 'tk', + 'locale' => 'ru', /* |-------------------------------------------------------------------------- @@ -172,8 +172,6 @@ return [ Barryvdh\LaravelIdeHelper\IdeHelperServiceProvider::class, Laracasts\Utilities\JavaScript\JavaScriptServiceProvider::class, Mcamara\LaravelLocalization\LaravelLocalizationServiceProvider::class, - Laravel\Scout\ScoutServiceProvider::class, - TeamTNT\Scout\TNTSearchScoutServiceProvider::class, ], /* diff --git a/config/laravellocalization.php b/config/laravellocalization.php index 6fd77703..6056bdd9 100644 --- a/config/laravellocalization.php +++ b/config/laravellocalization.php @@ -46,13 +46,13 @@ return [ //'en-AU' => ['name' => 'Australian English', 'script' => 'Latn', 'native' => 'Australian English', 'regional' => 'en_AU'], //'en-GB' => ['name' => 'British English', 'script' => 'Latn', 'native' => 'British English', 'regional' => 'en_GB'], //'en-US' => ['name' => 'U.S. English', 'script' => 'Latn', 'native' => 'U.S. English', 'regional' => 'en_US'], - 'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'], + //'es' => ['name' => 'Spanish', 'script' => 'Latn', 'native' => 'español', 'regional' => 'es_ES'], //'eo' => ['name' => 'Esperanto', 'script' => 'Latn', 'native' => 'esperanto', 'regional' => ''], //'eu' => ['name' => 'Basque', 'script' => 'Latn', 'native' => 'euskara', 'regional' => 'eu_ES'], //'ewo' => ['name' => 'Ewondo', 'script' => 'Latn', 'native' => 'ewondo', 'regional' => ''], //'ee' => ['name' => 'Ewe', 'script' => 'Latn', 'native' => 'eʋegbe', 'regional' => ''], //'fil' => ['name' => 'Filipino', 'script' => 'Latn', 'native' => 'Filipino', 'regional' => 'fil_PH'], - 'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'], + //'fr' => ['name' => 'French', 'script' => 'Latn', 'native' => 'français', 'regional' => 'fr_FR'], //'fr-CA' => ['name' => 'Canadian French', 'script' => 'Latn', 'native' => 'français canadien', 'regional' => 'fr_CA'], //'fy' => ['name' => 'Western Frisian', 'script' => 'Latn', 'native' => 'frysk', 'regional' => 'fy_DE'], //'fur' => ['name' => 'Friulian', 'script' => 'Latn', 'native' => 'furlan', 'regional' => 'fur_IT'], @@ -142,7 +142,7 @@ return [ //'hz' => ['name' => 'Herero', 'script' => 'Latn', 'native' => 'Otjiherero', 'regional' => ''], //'uz-Latn' => ['name' => 'Uzbek (Latin)', 'script' => 'Latn', 'native' => 'oʼzbekcha', 'regional' => 'uz_UZ'], //'nds' => ['name' => 'Low German', 'script' => 'Latn', 'native' => 'Plattdüütsch', 'regional' => 'nds_DE'], - 'pl' => ['name' => 'Polish', 'script' => 'Latn', 'native' => 'polski', 'regional' => 'pl_PL'], + //'pl' => ['name' => 'Polish', 'script' => 'Latn', 'native' => 'polski', 'regional' => 'pl_PL'], //'pt' => ['name' => 'Portuguese', 'script' => 'Latn', 'native' => 'português', 'regional' => 'pt_PT'], //'pt-BR' => ['name' => 'Brazilian Portuguese', 'script' => 'Latn', 'native' => 'português do Brasil', 'regional' => 'pt_BR'], //'ff' => ['name' => 'Fulah', 'script' => 'Latn', 'native' => 'Pulaar', 'regional' => 'ff_SN'], @@ -221,7 +221,7 @@ return [ //'mk' => ['name' => 'Macedonian', 'script' => 'Cyrl', 'native' => 'македонски', 'regional' => 'mk_MK'], //'mn' => ['name' => 'Mongolian (Cyrillic)', 'script' => 'Cyrl', 'native' => 'монгол', 'regional' => 'mn_MN'], //'ce' => ['name' => 'Chechen', 'script' => 'Cyrl', 'native' => 'нохчийн мотт', 'regional' => 'ce_RU'], - //'ru' => ['name' => 'Russian', 'script' => 'Cyrl', 'native' => 'русский', 'regional' => 'ru_RU'], + 'ru' => ['name' => 'Russian', 'script' => 'Cyrl', 'native' => 'русский', 'regional' => 'ru_RU'], //'sah' => ['name' => 'Yakut', 'script' => 'Cyrl', 'native' => 'саха тыла', 'regional' => ''], //'tt' => ['name' => 'Tatar', 'script' => 'Cyrl', 'native' => 'татар теле', 'regional' => 'tt_RU'], //'tg' => ['name' => 'Tajik (Cyrillic)', 'script' => 'Cyrl', 'native' => 'тоҷикӣ', 'regional' => 'tg_TJ'], diff --git a/resources/views/Bilettm/Partials/PublicHeader.blade.php b/resources/views/Bilettm/Partials/PublicHeader.blade.php index db39c768..2e2b9e02 100644 --- a/resources/views/Bilettm/Partials/PublicHeader.blade.php +++ b/resources/views/Bilettm/Partials/PublicHeader.blade.php @@ -30,9 +30,9 @@