diff --git a/.DS_Store b/.DS_Store index 02e352e9..25e069c1 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/app/Http/Controllers/Admin/MenuCrudController.php b/app/Http/Controllers/Admin/MenuCrudController.php index d6614507..cd74b426 100644 --- a/app/Http/Controllers/Admin/MenuCrudController.php +++ b/app/Http/Controllers/Admin/MenuCrudController.php @@ -47,6 +47,7 @@ class MenuCrudController extends CrudController ['name' => 'name', 'type' => 'text', 'label' => 'Name'], ['name' => 'url', 'type' => 'text', 'label' => 'URL'], ['name' => 'menu_type', 'type' => 'enum', 'label' => 'Menu Type'], + ['name' => 'details', 'type' => 'table', 'label' => 'Details', 'columns' => ['section' => 'Section']], ]); // add asterisk for fields that are required in MenuRequest $this->crud->setRequiredFields(StoreRequest::class, 'create'); diff --git a/app/Http/Controllers/Admin/DescriptionCrudController.php b/app/Http/Controllers/Admin/PageCrudController.php similarity index 55% rename from app/Http/Controllers/Admin/DescriptionCrudController.php rename to app/Http/Controllers/Admin/PageCrudController.php index 2575b0ea..f5aca8d8 100644 --- a/app/Http/Controllers/Admin/DescriptionCrudController.php +++ b/app/Http/Controllers/Admin/PageCrudController.php @@ -5,16 +5,16 @@ namespace App\Http\Controllers\Admin; use Backpack\CRUD\app\Http\Controllers\CrudController; // VALIDATION: change the requests to match your own file names if you need form validation -use App\Http\Requests\DescriptionRequest as StoreRequest; -use App\Http\Requests\DescriptionRequest as UpdateRequest; +use App\Http\Requests\PageRequest as StoreRequest; +use App\Http\Requests\PageRequest as UpdateRequest; use Backpack\CRUD\CrudPanel; /** - * Class DescriptionCrudController + * Class PageCrudController * @package App\Http\Controllers\Admin * @property-read CrudPanel $crud */ -class DescriptionCrudController extends CrudController +class PageCrudController extends CrudController { public function setup() { @@ -23,9 +23,9 @@ class DescriptionCrudController extends CrudController | CrudPanel Basic Information |-------------------------------------------------------------------------- */ - $this->crud->setModel('App\Models\Description'); - $this->crud->setRoute(config('backpack.base.route_prefix') . '/description'); - $this->crud->setEntityNameStrings('description', 'descriptions'); + $this->crud->setModel('App\Models\Page'); + $this->crud->setRoute(config('backpack.base.route_prefix') . '/page'); + $this->crud->setEntityNameStrings('page', 'pages'); /* |-------------------------------------------------------------------------- @@ -34,25 +34,40 @@ class DescriptionCrudController extends CrudController */ // TODO: remove setFromDb() and manually define Fields and Columns - //$this->crud->setFromDb(); + //$this->crud->setFromDb(); - $this->crud->addColumns([ - ['name' => 'header','type' => 'text', 'lable' => 'Header'], + $this->crud->addColumns([ + ['name' => 'title','type' => 'text', 'lable' => 'Title'], + ['name' => 'keywords','type' => 'text', 'lable' => 'Keywords'], + ['name' => 'meta_description','type' => 'text', 'lable' => 'Meta description'], + ['name' => 'description','type' => 'text', 'lable' => 'Description'], ['name' => 'menu_id', 'type' => 'select', 'entity' => 'menu', 'attribute' =>'name', 'model' => 'App\Models\Menu', 'lable'=>'Menu'], ]); $this->crud->addFields([ - ['name' => 'header','type' => 'text', 'lable' => 'Header'], + ['name' => 'title','type' => 'text', 'lable' => 'Title'], + ['name' => 'keywords','type' => 'text', 'lable' => 'Keywords'], + ['name' => 'meta_description','type' => 'text', 'lable' => 'Meta description'], ['name' => 'description','type' => 'summernote', 'lable' => 'Description'], ['name' => 'menu_id', 'type' => 'select', 'entity' => 'menu', 'attribute' =>'name', 'model' => 'App\Models\Menu', 'lable'=>'Menu'], + // [ // Select2Multiple = n-n relationship (with pivot table) + // 'label' => "Slider", + // 'type' => 'select2_multiple', + // 'name' => 'sliders', // the method that defines the relationship in your Model + // 'entity' => 'sliders', // the method that defines the relationship in your Model + // 'attribute' => 'page_id', // foreign key attribute that is shown to user + // 'model' => "App\Models\Slider", // foreign key model + // 'pivot' => false, // on create&update, do you need to add/delete pivot table entries? + // // 'select_all' => true, // show Select All and Clear buttons? + // ] ]); - // add asterisk for fields that are required in DescriptionRequest + // add asterisk for fields that are required in PageRequest $this->crud->setRequiredFields(StoreRequest::class, 'create'); $this->crud->setRequiredFields(UpdateRequest::class, 'edit'); } diff --git a/app/Http/Controllers/Admin/PageadCrudController.php b/app/Http/Controllers/Admin/PageadCrudController.php index 5dd36714..8225aaae 100644 --- a/app/Http/Controllers/Admin/PageadCrudController.php +++ b/app/Http/Controllers/Admin/PageadCrudController.php @@ -37,12 +37,16 @@ class PageadCrudController extends CrudController //$this->crud->setFromDb(); $this->crud->addColumns([ + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], ['name' => 'name','type' => 'text', 'lable' => 'Name'], ['name' => 'adv_type', 'type' => 'enum', 'label' => 'Adv Type'], ['name' => 'img_url','type' => 'text', 'lable' => 'Image'], ]); $this->crud->addFields([ + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], ['name' => 'name','type' => 'text', 'lable' => 'Name'], ['name' => 'adv_type', 'type' => 'enum', 'label' => 'Adv Type'], [ 'label' => "Image", diff --git a/app/Http/Controllers/Admin/PageSliderCrudController.php b/app/Http/Controllers/Admin/ProgrammeCrudController.php similarity index 57% rename from app/Http/Controllers/Admin/PageSliderCrudController.php rename to app/Http/Controllers/Admin/ProgrammeCrudController.php index 4efe2794..453975f8 100644 --- a/app/Http/Controllers/Admin/PageSliderCrudController.php +++ b/app/Http/Controllers/Admin/ProgrammeCrudController.php @@ -5,16 +5,16 @@ namespace App\Http\Controllers\Admin; use Backpack\CRUD\app\Http\Controllers\CrudController; // VALIDATION: change the requests to match your own file names if you need form validation -use App\Http\Requests\PageSliderRequest as StoreRequest; -use App\Http\Requests\PageSliderRequest as UpdateRequest; +use App\Http\Requests\ProgrammeRequest as StoreRequest; +use App\Http\Requests\ProgrammeRequest as UpdateRequest; use Backpack\CRUD\CrudPanel; /** - * Class PageSliderCrudController + * Class ProgrammeCrudController * @package App\Http\Controllers\Admin * @property-read CrudPanel $crud */ -class PageSliderCrudController extends CrudController +class ProgrammeCrudController extends CrudController { public function setup() { @@ -23,9 +23,9 @@ class PageSliderCrudController extends CrudController | CrudPanel Basic Information |-------------------------------------------------------------------------- */ - $this->crud->setModel('App\Models\PageSlider'); - $this->crud->setRoute(config('backpack.base.route_prefix') . '/pageslider'); - $this->crud->setEntityNameStrings('pageslider', 'page_sliders'); + $this->crud->setModel('App\Models\Programme'); + $this->crud->setRoute(config('backpack.base.route_prefix') . '/programme'); + $this->crud->setEntityNameStrings('programme', 'programmes'); /* |-------------------------------------------------------------------------- @@ -35,24 +35,28 @@ class PageSliderCrudController extends CrudController // TODO: remove setFromDb() and manually define Fields and Columns //$this->crud->setFromDb(); - $this->crud->addColumns([ - ['name' => 'alt','type' => 'text', 'lable' => 'Alt'], - ['name' => 'img_url','type' => 'text', 'lable' => 'Img Url'], - ['name' => 'menu_id', 'type' => 'select', 'entity' => 'menu', 'attribute' =>'name', 'model' => 'App\Models\Menu', - 'lable'=>'Menu'], + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], + ['name' => 'name','type' => 'text', 'lable' => 'Name'], ]); $this->crud->addFields([ - ['name' => 'alt','type' => 'text', 'lable' => 'Alt'], - ['name' => 'img_url','type' => 'browse', 'lable' => 'Img Url'], - ['name' => 'menu_id', 'type' => 'select', 'entity' => 'menu', 'attribute' =>'name', 'model' => 'App\Models\Menu', - 'lable'=>'Menu'], + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], + ['name' => 'name','type' => 'text', 'lable' => 'Name'], + ['name' => 'altyn','type' => 'summernote', 'lable' => 'Altyn Asyr'], + ['name' => 'yashlyk','type' => 'summernote', 'lable' => 'Yashlyk'], + ['name' => 'miras','type' => 'summernote', 'lable' => 'Miras'], + ['name' => 'turkmenistan','type' => 'summernote', 'lable' => 'Turkmenistan'], + ['name' => 'owaz', 'type' => 'summernote', 'lable' => 'Turkmen Owazy'], + ['name' => 'sport','type' => 'summernote', 'lable' => 'Turkmen Sport'], ]); - // add asterisk for fields that are required in PageSliderRequest + + // add asterisk for fields that are required in ProgrammeRequest $this->crud->setRequiredFields(StoreRequest::class, 'create'); $this->crud->setRequiredFields(UpdateRequest::class, 'edit'); } diff --git a/app/Http/Controllers/Admin/ShowCrudController.php b/app/Http/Controllers/Admin/ShowCrudController.php index 34e7ed89..07d555d2 100644 --- a/app/Http/Controllers/Admin/ShowCrudController.php +++ b/app/Http/Controllers/Admin/ShowCrudController.php @@ -36,7 +36,8 @@ class ShowCrudController extends CrudController // TODO: remove setFromDb() and manually define Fields and Columns //$this->crud->setFromDb(); $this->crud->addColumns([ - ['name' => 'replace_type', 'type' => 'enum', 'label' => 'Category'], + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], ['name' => 'alt','type' => 'text', 'lable' => 'Alt'], ['name' => 'name','type' => 'text', 'lable' => 'Name'], ['name' => 'view','type' => 'number', 'lable' => 'View'], @@ -44,7 +45,8 @@ class ShowCrudController extends CrudController ]); $this->crud->addFields([ - ['name' => 'replace_type', 'type' => 'enum', 'label' => 'Category'], + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], [ // image 'label' => "Material Image", @@ -61,6 +63,7 @@ class ShowCrudController extends CrudController ['name' => 'video_url','type' => 'browse', 'lable' => 'Video'], ['name' => 'view','type' => 'number', 'lable' => 'View'], ['name' => 'description','type' => 'summernote', 'lable' => 'Text'], + ['name' => 'home','type' => 'checkbox', 'lable' => 'Home'], ]); diff --git a/app/Http/Controllers/Admin/SliderCrudController.php b/app/Http/Controllers/Admin/SliderCrudController.php index 7a9fb148..7cc51b08 100644 --- a/app/Http/Controllers/Admin/SliderCrudController.php +++ b/app/Http/Controllers/Admin/SliderCrudController.php @@ -37,20 +37,22 @@ class SliderCrudController extends CrudController //$this->crud->setFromDb(); $this->crud->addColumns([ + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], + ['name' => 'home','type' => 'boolean', 'lable' => 'Home'], ['name' => 'img_url','type' => 'text', 'lable' => 'Image'], ['name' => 'alt','type' => 'text', 'lable' => 'Alt'], - ['name' => 'url','type' => 'text', 'lable' => 'URL'], - ['name' => 'text','type' => 'text', 'lable' => 'Text'], - + ]); $this->crud->addFields([ + ['name' => 'page_id', 'type' => 'select', 'entity' => 'page', 'attribute' =>'title', 'model' => 'App\Models\Page', + 'lable'=>'Page'], ['name' => 'img_url','type' => 'browse', 'lable' => 'Image'], ['name' => 'alt','type' => 'text', 'lable' => 'Alt'], - ['name' => 'url','type' => 'text', 'lable' => 'URL'], - ['name' => 'text','type' => 'text', 'lable' => 'Text'], - - + ['name' => 'home','type' => 'checkbox', 'lable' => 'Home'], + + ]); diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 3a6bf08a..7a117efc 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -14,6 +14,7 @@ use App\Models\PageSlider; use App\Models\Description; use App\Models\Advertisement; use App\Models\Pagead; +use App\Models\Page; use Carbon\Carbon; use Illuminate\Http\Request; use Illuminate\Support\Facades\Cookie; @@ -49,15 +50,18 @@ class HomeController extends Controller public function indexWeb(){ - - $sliders = Slider::get(); + $sliders = Slider::where('home', 1)->get(); $news = News::take(4)->orderBy('created_at', 'DESC')->get(); - $shows = Show::orderBy('created_at', 'DESC') + $shows = Show::where('home', 1)->orderBy('created_at', 'DESC') ->take(11) ->get(); - $showTop2 = $shows->where('replace_type', 'homeShows')->take(2); - $showTop3 = $shows->where('replace_type', 'homeShows')->skip(2)->take(3); - $bestShows = $shows->where('replace_type','bestShowsHome'); + $showTop2 = $shows->take(2); + $shows->shift(); + $shows->shift(); + $showTop3 = $shows->take(3); + $shows->shift(); + $shows->shift(); + $shows->shift(); $adverts = Advertisement::distinct('adv_type')->get(); $advertTop = $adverts->where('adv_type', 'top')->first(); $advertMiddle = $adverts->where('adv_type', 'middle')->first(); @@ -66,35 +70,56 @@ class HomeController extends Controller 'sliders' => $sliders, 'news' => $news, 'showTop3' => $showTop3, - 'bestShows' => $bestShows, + 'bestShows' => $shows, 'advertTop' => $advertTop, 'advertMiddle' => $advertMiddle, 'advertBottom' => $advertBottom, - 'showTop2' => $showTop2 + 'showTop2' => $showTop2, + 'title' => 'Turkmen Tv', + 'keywords' => 'Turkmen Tv', + 'meta_description' => 'Turkmen Tv', + ]); + } + + public function newsList(){ + $news = News::orderBy('created_at', 'DESC')->paginate(7); + $main = $news->shift(); + return view('web.newsList')->with([ + 'news' => $news, + 'main' => $main, + 'title' => 'Habarlar', + 'keywords' => 'Turkmen Tv Habarlar', + 'meta_description' => 'Turkmen Tv Habarlar', + ]); + } + + public function getNews($newsId){ + $news = News::findOrFail($newsId); + $newsMenu = News::orderBy('created_at', 'DESC')->take(6)->get(); + return view('web.getNews')->with([ + 'news' => $news, + 'newsMenu' => $newsMenu, + 'title' => $news->name, + 'keywords' => $news->name, + 'meta_description' => $news->name, ]); } public function menuLinkWeb($menu_id){ - $pageSliders = PageSlider::where('menu_id', $menu_id)->get(); - $descriptions = Description::where('menu_id', $menu_id)->firstOrFail(); - $news = News::take(7)->get(); - $news1 = $news->first(); - $news2 = $news->skip(1)->take(6); - $bestShows = Show::where('replace_type','bestShowsHome')->get(); - $tmFilms = Show::where('replace_type','tmFilm')->get(); - $animations = Show::where('replace_type','animations')->get(); - $pageNames = Menu::where('id', $menu_id)->firstOrFail(); - $pageAds = Pagead::get(); + $page = Page::where('menu_id', $menu_id)->firstOrFail(); + $pageSliders = $page->sliders; + $shows = $page->shows; + $advs = $page->pageads; + $programmes = $page->programmes; return view('web.pageWeb')->with([ + 'page' => $page, 'pageSliders' => $pageSliders, - 'pageNames' => $pageNames, - 'descriptions' => $descriptions, - 'pageAds' => $pageAds, - 'tmFilms' => $tmFilms, - 'animations' => $animations, - 'news1' => $news1, - 'news2' => $news2, - 'bestShows' => $bestShows + 'shows' => $shows, + 'advs' => $advs, + 'programmes' => $programmes, + 'title' => $page->titile, + 'keywords' => $page->keywords, + 'meta_description' => $page->meta_description, ]); } diff --git a/app/Http/Requests/PageRequest.php b/app/Http/Requests/PageRequest.php new file mode 100644 index 00000000..773ff806 --- /dev/null +++ b/app/Http/Requests/PageRequest.php @@ -0,0 +1,56 @@ +check(); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return [ + // 'name' => 'required|min:5|max:255' + ]; + } + + /** + * Get the validation attributes that apply to the request. + * + * @return array + */ + public function attributes() + { + return [ + // + ]; + } + + /** + * Get the validation messages that apply to the request. + * + * @return array + */ + public function messages() + { + return [ + // + ]; + } +} diff --git a/app/Http/Requests/ProgrammeRequest.php b/app/Http/Requests/ProgrammeRequest.php new file mode 100644 index 00000000..c9d01b06 --- /dev/null +++ b/app/Http/Requests/ProgrammeRequest.php @@ -0,0 +1,56 @@ +check(); + } + + /** + * Get the validation rules that apply to the request. + * + * @return array + */ + public function rules() + { + return [ + // 'name' => 'required|min:5|max:255' + ]; + } + + /** + * Get the validation attributes that apply to the request. + * + * @return array + */ + public function attributes() + { + return [ + // + ]; + } + + /** + * Get the validation messages that apply to the request. + * + * @return array + */ + public function messages() + { + return [ + // + ]; + } +} diff --git a/app/Models/Menu.php b/app/Models/Menu.php index 1b8cbdfc..9190f4fe 100644 --- a/app/Models/Menu.php +++ b/app/Models/Menu.php @@ -34,13 +34,10 @@ class Menu extends Model | RELATIONS |-------------------------------------------------------------------------- */ - public function pagesliders(){ - return $this->hasMany(PageSlider::class); + public function pages(){ + return $this->hasOne(PageSlider::class); } - public function descriptions(){ - return $this->hasMany(Description::class); - } /* |-------------------------------------------------------------------------- | SCOPES diff --git a/app/Models/News.php b/app/Models/News.php index 7a667ea0..dfb1f8e8 100644 --- a/app/Models/News.php +++ b/app/Models/News.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; +use Illuminate\Support\Str; class News extends Model { @@ -28,7 +29,13 @@ class News extends Model | FUNCTIONS |-------------------------------------------------------------------------- */ - + public static function boot() + { + parent::boot(); + static::deleting(function($obj) { + \Storage::disk('uploads')->delete($obj->img_url); + }); + } /* |-------------------------------------------------------------------------- | RELATIONS @@ -52,4 +59,35 @@ class News extends Model | MUTATORS |-------------------------------------------------------------------------- */ + public function setBannerUrlAttribute($value) + { + $attribute_name = "img_url"; + $disk = 'uploads'; // or use your own disk, defined in config/filesystems.php + $destination_path = "images"; // path relative to the disk above + + // if the image was erased + if ($value==null) { + // delete the image from disk + \Storage::disk($disk)->delete($this->{$attribute_name}); + + // set null in the database column + $this->attributes[$attribute_name] = null; + } + + // if a base64 was sent, store it in the db + if (starts_with($value, 'data:image')) + { + // 0. Make the image + $image = \Image::make($value)->encode('jpg', 90); + // 1. Generate a filename. + $filename = md5($value.time()).'.jpg'; + // 2. Store the image on disk. + \Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream()); + // 3. Save the public path to the database + // but first, remove "public/" from the path, since we're pointing to it from the root folder + // that way, what gets saved in the database is the user-accesible URL + $public_destination_path = Str::replaceFirst('public/', '', $destination_path); + $this->attributes[$attribute_name] = $public_destination_path.'/'.$filename; + } + } } diff --git a/app/Models/PageSlider.php b/app/Models/Page.php similarity index 75% rename from app/Models/PageSlider.php rename to app/Models/Page.php index ac7f7703..0c1b0c5e 100644 --- a/app/Models/PageSlider.php +++ b/app/Models/Page.php @@ -5,7 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; -class PageSlider extends Model +class Page extends Model { use CrudTrait; @@ -15,11 +15,11 @@ class PageSlider extends Model |-------------------------------------------------------------------------- */ - protected $table = 'pagesliders'; + protected $table = 'pages'; // protected $primaryKey = 'id'; // public $timestamps = false; // protected $guarded = ['id']; - protected $fillable = ['alt', 'img_url', 'menu_id']; + protected $fillable = ['title', 'keywords', 'meta_description', 'description', 'menu_id']; // protected $hidden = []; // protected $dates = []; @@ -37,6 +37,22 @@ class PageSlider extends Model public function menu(){ return $this->belongsTo(Menu::class); } + + public function sliders(){ + return $this->hasMany(Slider::class); + } + + public function shows(){ + return $this->hasMany(Show::class); + } + + public function pageads(){ + return $this->hasMany(Pagead::class); + } + + public function programmes(){ + return $this->hasMany(Programme::class); + } /* |-------------------------------------------------------------------------- | SCOPES diff --git a/app/Models/Pagead.php b/app/Models/Pagead.php index 7e981f29..9898ae09 100644 --- a/app/Models/Pagead.php +++ b/app/Models/Pagead.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; +use Illuminate\Support\Str; class Pagead extends Model { @@ -28,13 +29,22 @@ class Pagead extends Model | FUNCTIONS |-------------------------------------------------------------------------- */ - + public static function boot() + { + parent::boot(); + static::deleting(function($obj) { + \Storage::disk('uploads')->delete($obj->img_url); + \Storage::disk('uploads')->delete($obj->poster_url); + }); + } /* |-------------------------------------------------------------------------- | RELATIONS |-------------------------------------------------------------------------- */ - + public function page(){ + return $this->belongsTo(Page::class); + } /* |-------------------------------------------------------------------------- | SCOPES @@ -52,4 +62,44 @@ class Pagead extends Model | MUTATORS |-------------------------------------------------------------------------- */ + public function setPosterUrlAttribute ($value){ + + $this->uploader("poster_url", $value); + } + + public function setImgUrlAttribute($value) + { + + $this->uploader("img_url", $value); + } + + private function uploader ($attribute_name, $value){ + $disk = 'uploads'; // or use your own disk, defined in config/filesystems.php + $destination_path = "images"; // path relative to the disk above + + // if the image was erased + if ($value==null) { + // delete the image from disk + \Storage::disk($disk)->delete($this->{$attribute_name}); + + // set null in the database column + $this->attributes[$attribute_name] = null; + } + + // if a base64 was sent, store it in the db + if (starts_with($value, 'data:image')) + { + // 0. Make the image + $image = \Image::make($value)->encode('jpg', 90); + // 1. Generate a filename. + $filename = md5($value.time()).'.jpg'; + // 2. Store the image on disk. + \Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream()); + // 3. Save the public path to the database + // but first, remove "public/" from the path, since we're pointing to it from the root folder + // that way, what gets saved in the database is the user-accesible URL + $public_destination_path = Str::replaceFirst('public/', '', $destination_path); + $this->attributes[$attribute_name] = $public_destination_path.'/'.$filename; + } + } } diff --git a/app/Models/Description.php b/app/Models/Programme.php similarity index 85% rename from app/Models/Description.php rename to app/Models/Programme.php index 37ae6aae..0e59aae9 100644 --- a/app/Models/Description.php +++ b/app/Models/Programme.php @@ -5,7 +5,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; -class Description extends Model +class Programme extends Model { use CrudTrait; @@ -15,11 +15,11 @@ class Description extends Model |-------------------------------------------------------------------------- */ - protected $table = 'descriptions'; + protected $table = 'programmes'; // protected $primaryKey = 'id'; // public $timestamps = false; // protected $guarded = ['id']; - protected $fillable = ['header', 'description', 'menu_id']; + protected $fillable = ['name', 'altyn', 'yashlyk', 'miras', 'turkmenistan', 'owaz', 'sport', 'page_id']; // protected $hidden = []; // protected $dates = []; @@ -34,8 +34,8 @@ class Description extends Model | RELATIONS |-------------------------------------------------------------------------- */ - public function menu(){ - return $this->belongsTo(Menu::class); + public function page(){ + return $this->belongsTo(Page::class); } /* |-------------------------------------------------------------------------- diff --git a/app/Models/Show.php b/app/Models/Show.php index ad971afe..71d62670 100644 --- a/app/Models/Show.php +++ b/app/Models/Show.php @@ -4,6 +4,7 @@ namespace App\Models; use Illuminate\Database\Eloquent\Model; use Backpack\CRUD\CrudTrait; +use Illuminate\Support\Str; class Show extends Model { @@ -19,7 +20,7 @@ class Show extends Model // protected $primaryKey = 'id'; // public $timestamps = false; // protected $guarded = ['id']; - protected $fillable = ['name', 'alt', 'img_url', 'description', 'view', 'video_url', 'replace_type']; + protected $fillable = ['name', 'alt', 'img_url', 'description', 'view', 'video_url', 'menu_id', 'home']; // protected $hidden = []; // protected $dates = []; @@ -28,13 +29,21 @@ class Show extends Model | FUNCTIONS |-------------------------------------------------------------------------- */ - + public static function boot() + { + parent::boot(); + static::deleting(function($obj) { + \Storage::disk('uploads')->delete($obj->img_url); + }); + } /* |-------------------------------------------------------------------------- | RELATIONS |-------------------------------------------------------------------------- */ - + public function page(){ + return $this->belongsTo(Page::class); + } /* |-------------------------------------------------------------------------- | SCOPES @@ -52,4 +61,36 @@ class Show extends Model | MUTATORS |-------------------------------------------------------------------------- */ + + public function setImgUrlAttribute($value) + { + $attribute_name = "img_url"; + $disk = 'uploads'; // or use your own disk, defined in config/filesystems.php + $destination_path = "images"; // path relative to the disk above + + // if the image was erased + if ($value==null) { + // delete the image from disk + \Storage::disk($disk)->delete($this->{$attribute_name}); + + // set null in the database column + $this->attributes[$attribute_name] = null; + } + + // if a base64 was sent, store it in the db + if (starts_with($value, 'data:image')) + { + // 0. Make the image + $image = \Image::make($value)->encode('jpg', 90); + // 1. Generate a filename. + $filename = md5($value.time()).'.jpg'; + // 2. Store the image on disk. + \Storage::disk($disk)->put($destination_path.'/'.$filename, $image->stream()); + // 3. Save the public path to the database + // but first, remove "public/" from the path, since we're pointing to it from the root folder + // that way, what gets saved in the database is the user-accesible URL + $public_destination_path = Str::replaceFirst('public/', '', $destination_path); + $this->attributes[$attribute_name] = $public_destination_path.'/'.$filename; + } + } } diff --git a/app/Models/Slider.php b/app/Models/Slider.php index 2e7750e7..115f4f32 100644 --- a/app/Models/Slider.php +++ b/app/Models/Slider.php @@ -19,7 +19,7 @@ class Slider extends Model // protected $primaryKey = 'id'; // public $timestamps = false; // protected $guarded = ['id']; - protected $fillable = ['img_url', 'alt', 'url', 'text']; + protected $fillable = ['img_url', 'alt', 'page_id', 'home']; // protected $hidden = []; // protected $dates = []; @@ -34,7 +34,9 @@ class Slider extends Model | RELATIONS |-------------------------------------------------------------------------- */ - + public function page(){ + return $this->belongsTo(Page::class); + } /* |-------------------------------------------------------------------------- | SCOPES diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index 4503e976..ec002cd8 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -3,6 +3,7 @@ namespace App\Providers; use App\Models\Category; +use App\Models\Menu; use Illuminate\Support\Facades\View; use Illuminate\Support\ServiceProvider; diff --git a/database/migrations/2019_05_16_104001_create_menus_table.php b/database/migrations/2019_05_16_104001_create_menus_table.php index 3ac4188c..d7e4d4da 100644 --- a/database/migrations/2019_05_16_104001_create_menus_table.php +++ b/database/migrations/2019_05_16_104001_create_menus_table.php @@ -16,7 +16,7 @@ class CreateMenusTable extends Migration $table->increments('id'); $table->string('name'); $table->string('url'); - $table->enum('menu_type',['top','middle','bottom']); + $table->enum('menu_type',['top','middle','bottom','home']); $table->timestamps(); }); } diff --git a/database/migrations/2019_05_24_115737_create_descriptions_table.php b/database/migrations/2019_05_16_113951_create_pages_table.php similarity index 59% rename from database/migrations/2019_05_24_115737_create_descriptions_table.php rename to database/migrations/2019_05_16_113951_create_pages_table.php index 92abff28..29c81817 100644 --- a/database/migrations/2019_05_24_115737_create_descriptions_table.php +++ b/database/migrations/2019_05_16_113951_create_pages_table.php @@ -3,7 +3,7 @@ use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; -class CreateDescriptionsTable extends Migration +class CreatePagesTable extends Migration { /** * Run the migrations. @@ -12,10 +12,12 @@ class CreateDescriptionsTable extends Migration */ public function up() { - Schema::create('descriptions', function (Blueprint $table) { + Schema::create('pages', function (Blueprint $table) { $table->increments('id'); - $table->string('header'); - $table->longText('description'); + $table->string('title')->nullable(); + $table->string('keywords')->nullable(); + $table->text('meta_description')->nullable(); + $table->longText('description')->nullable(); $table->unsignedInteger('menu_id'); $table->foreign('menu_id')->references('id')->on('menus'); $table->timestamps(); @@ -29,6 +31,6 @@ class CreateDescriptionsTable extends Migration */ public function down() { - Schema::dropIfExists('descriptions'); + Schema::dropIfExists('pages'); } } diff --git a/database/migrations/2019_05_16_123130_create_sliders_table.php b/database/migrations/2019_05_16_123130_create_sliders_table.php index 655acf5b..42880538 100644 --- a/database/migrations/2019_05_16_123130_create_sliders_table.php +++ b/database/migrations/2019_05_16_123130_create_sliders_table.php @@ -16,6 +16,9 @@ class CreateSlidersTable extends Migration $table->increments('id'); $table->text('img_url'); $table->string('alt')->nullable(); + $table->boolean('home')->default(0); + $table->unsignedInteger('page_id')->nullable(); + $table->foreign('page_id')->references('id')->on('pages'); $table->timestamps(); }); } diff --git a/database/migrations/2019_05_20_115910_create_shows_table.php b/database/migrations/2019_05_20_115910_create_shows_table.php index f0fe3150..61964fa4 100644 --- a/database/migrations/2019_05_20_115910_create_shows_table.php +++ b/database/migrations/2019_05_20_115910_create_shows_table.php @@ -20,7 +20,9 @@ class CreateShowsTable extends Migration $table->longText('description')->nullable(); $table->integer('view'); $table->longText('video_url')->nullable(); - $table->enum('replace_type',['homeShows','bestShowsHome','animations','tmFilm']); + $table->boolean('home')->default(0); + $table->unsignedInteger('page_id')->nullable(); + $table->foreign('page_id')->references('id')->on('pages'); $table->timestamps(); }); } diff --git a/database/migrations/2019_05_21_113314_create_pagesliders_table.php b/database/migrations/2019_05_21_113314_create_pagesliders_table.php deleted file mode 100644 index e6ddb5ea..00000000 --- a/database/migrations/2019_05_21_113314_create_pagesliders_table.php +++ /dev/null @@ -1,37 +0,0 @@ -increments('id'); - $table->string('alt')->nullable(); - $table->longText('img_url')->nullable(); - $table->unsignedInteger('menu_id')->nullable(); - $table->foreign('menu_id')->references('id')->on('menus'); - $table->timestamps(); - }); - - - - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::dropIfExists('pagesliders'); - } -} diff --git a/database/migrations/2019_05_28_112418_create_pageads_table.php b/database/migrations/2019_05_28_112418_create_pageads_table.php index b0e08f4b..f8526951 100644 --- a/database/migrations/2019_05_28_112418_create_pageads_table.php +++ b/database/migrations/2019_05_28_112418_create_pageads_table.php @@ -19,6 +19,8 @@ class CreatePageadsTable extends Migration $table->longText('poster_url')->nullable(); $table->longText('img_url')->nullable(); $table->longText('video_url')->nullable(); + $table->unsignedInteger('page_id')->nullable(); + $table->foreign('page_id')->references('id')->on('pages'); $table->timestamps(); }); } diff --git a/database/migrations/2019_05_31_205304_create_programmes_table.php b/database/migrations/2019_05_31_205304_create_programmes_table.php new file mode 100644 index 00000000..363b2093 --- /dev/null +++ b/database/migrations/2019_05_31_205304_create_programmes_table.php @@ -0,0 +1,39 @@ +increments('id'); + $table->string('name'); + $table->longText('altyn')->nullable(); + $table->longText('yashlyk')->nullable(); + $table->longText('miras')->nullable(); + $table->longText('turkmenistan')->nullable(); + $table->longText('owaz')->nullable(); + $table->longText('sport')->nullable(); + $table->unsignedInteger('page_id')->nullable(); + $table->foreign('page_id')->references('id')->on('pages'); + $table->timestamps(); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::dropIfExists('programmes'); + } +} diff --git a/database/migrations/2020_05_14_204216_add_to_sliders_table.php b/database/migrations/2020_05_14_204216_add_to_sliders_table.php deleted file mode 100644 index 59015c71..00000000 --- a/database/migrations/2020_05_14_204216_add_to_sliders_table.php +++ /dev/null @@ -1,34 +0,0 @@ -string('url')->nullable(); - $table->text('text')->nullable(); - }); - } - - /** - * Reverse the migrations. - * - * @return void - */ - public function down() - { - Schema::table('sliders', function (Blueprint $table) { - $table->dropColumn('url'); - $table->dropColumn('text'); - }); - } -} diff --git a/database/seeds/MenuSeeder.php b/database/seeds/MenuSeeder.php index 61fd1e3c..9aaa074d 100644 --- a/database/seeds/MenuSeeder.php +++ b/database/seeds/MenuSeeder.php @@ -23,6 +23,7 @@ class MenuSeeder extends Seeder ['id'=>null,'name'=>'Habarlar','url'=>'/','menu_type'=>'middle'], ['id'=>null,'name'=>'Göni ýaýlym','url'=>'/','menu_type'=>'middle'], ['id'=>null,'name'=>'Teleprogramma','url'=>'/','menu_type'=>'middle'], + ['id'=>null,'name'=>'Home','url'=>'/','menu_type'=>'home'], ]; DB::table('menus')->insert($groups); } diff --git a/public/.DS_Store b/public/.DS_Store index c670258a..22aeac8b 100644 Binary files a/public/.DS_Store and b/public/.DS_Store differ diff --git a/public/assets/.DS_Store b/public/assets/.DS_Store index 46b02aa5..aeb47916 100644 Binary files a/public/assets/.DS_Store and b/public/assets/.DS_Store differ diff --git a/public/assets/favicon.ico b/public/assets/favicon.ico new file mode 100644 index 00000000..5a0138b3 Binary files /dev/null and b/public/assets/favicon.ico differ diff --git a/public/favicon.ico b/public/favicon.ico deleted file mode 100644 index e69de29b..00000000 diff --git a/public/uploads/.tmb/l1_d2ViL2FkdmVydGlzZW1lbnRzL29rdXouanBn1559340196.png b/public/uploads/.tmb/l1_d2ViL2FkdmVydGlzZW1lbnRzL29rdXouanBn1559340196.png new file mode 100644 index 00000000..bfda9d16 Binary files /dev/null and b/public/uploads/.tmb/l1_d2ViL2FkdmVydGlzZW1lbnRzL29rdXouanBn1559340196.png differ diff --git a/public/uploads/images/115213f0c4b0e0fd57d95ab78972efac.jpg b/public/uploads/images/115213f0c4b0e0fd57d95ab78972efac.jpg new file mode 100644 index 00000000..185b63a1 Binary files /dev/null and b/public/uploads/images/115213f0c4b0e0fd57d95ab78972efac.jpg differ diff --git a/public/uploads/images/123a129c2edb9cb7804890480392fc9c.jpg b/public/uploads/images/123a129c2edb9cb7804890480392fc9c.jpg new file mode 100644 index 00000000..834ee5fb Binary files /dev/null and b/public/uploads/images/123a129c2edb9cb7804890480392fc9c.jpg differ diff --git a/public/uploads/images/16425664c035ac10321b5660e53da4f3.jpg b/public/uploads/images/16425664c035ac10321b5660e53da4f3.jpg new file mode 100644 index 00000000..a423fc3e Binary files /dev/null and b/public/uploads/images/16425664c035ac10321b5660e53da4f3.jpg differ diff --git a/public/uploads/images/1e82245dca37dffc58a96fecc6d66dc5.jpg b/public/uploads/images/1e82245dca37dffc58a96fecc6d66dc5.jpg new file mode 100644 index 00000000..1c4bb0d5 Binary files /dev/null and b/public/uploads/images/1e82245dca37dffc58a96fecc6d66dc5.jpg differ diff --git a/public/uploads/images/264e85ad0b00b4d041f3840ad0da2130.jpg b/public/uploads/images/264e85ad0b00b4d041f3840ad0da2130.jpg new file mode 100644 index 00000000..834ee5fb Binary files /dev/null and b/public/uploads/images/264e85ad0b00b4d041f3840ad0da2130.jpg differ diff --git a/public/uploads/images/2c0ceed1247d4a96b67adbdc8bbf8aba.jpg b/public/uploads/images/2c0ceed1247d4a96b67adbdc8bbf8aba.jpg new file mode 100644 index 00000000..cd8db712 Binary files /dev/null and b/public/uploads/images/2c0ceed1247d4a96b67adbdc8bbf8aba.jpg differ diff --git a/public/uploads/images/35fa164cb6b0132c12e39435c74bfd84.jpg b/public/uploads/images/35fa164cb6b0132c12e39435c74bfd84.jpg new file mode 100644 index 00000000..73bedd57 Binary files /dev/null and b/public/uploads/images/35fa164cb6b0132c12e39435c74bfd84.jpg differ diff --git a/public/uploads/images/385be97756ff33816d49baa4e9a0defd.jpg b/public/uploads/images/385be97756ff33816d49baa4e9a0defd.jpg new file mode 100644 index 00000000..809cecde Binary files /dev/null and b/public/uploads/images/385be97756ff33816d49baa4e9a0defd.jpg differ diff --git a/public/uploads/images/4970cb1bb82e3ec0d92909522fc41c67.jpg b/public/uploads/images/4970cb1bb82e3ec0d92909522fc41c67.jpg new file mode 100644 index 00000000..b46db64d Binary files /dev/null and b/public/uploads/images/4970cb1bb82e3ec0d92909522fc41c67.jpg differ diff --git a/public/uploads/images/51288a64874eeec4b76e1e675b98efad.jpg b/public/uploads/images/51288a64874eeec4b76e1e675b98efad.jpg new file mode 100644 index 00000000..3a17dff8 Binary files /dev/null and b/public/uploads/images/51288a64874eeec4b76e1e675b98efad.jpg differ diff --git a/public/uploads/images/579c09f48f01e7a747c221485fa7a357.jpg b/public/uploads/images/579c09f48f01e7a747c221485fa7a357.jpg new file mode 100644 index 00000000..e7ceae2e Binary files /dev/null and b/public/uploads/images/579c09f48f01e7a747c221485fa7a357.jpg differ diff --git a/public/uploads/images/5f7b5882556fc16a76a008baa6c10931.jpg b/public/uploads/images/5f7b5882556fc16a76a008baa6c10931.jpg new file mode 100644 index 00000000..1c4bb0d5 Binary files /dev/null and b/public/uploads/images/5f7b5882556fc16a76a008baa6c10931.jpg differ diff --git a/public/uploads/images/6e70a67120928b3764c50482f9a47bef.jpg b/public/uploads/images/6e70a67120928b3764c50482f9a47bef.jpg new file mode 100644 index 00000000..c0e42d21 Binary files /dev/null and b/public/uploads/images/6e70a67120928b3764c50482f9a47bef.jpg differ diff --git a/public/uploads/images/771b459f13a1d2b49aed2799cc2ba40b.jpg b/public/uploads/images/771b459f13a1d2b49aed2799cc2ba40b.jpg new file mode 100644 index 00000000..49ec5c5f Binary files /dev/null and b/public/uploads/images/771b459f13a1d2b49aed2799cc2ba40b.jpg differ diff --git a/public/uploads/images/782fb2d1ec281555f5efaf4eb0a32651.jpg b/public/uploads/images/782fb2d1ec281555f5efaf4eb0a32651.jpg new file mode 100644 index 00000000..c0e42d21 Binary files /dev/null and b/public/uploads/images/782fb2d1ec281555f5efaf4eb0a32651.jpg differ diff --git a/public/uploads/images/7c6fd8d57c0f1130c51f254b6b041524.jpg b/public/uploads/images/7c6fd8d57c0f1130c51f254b6b041524.jpg new file mode 100644 index 00000000..cd8db712 Binary files /dev/null and b/public/uploads/images/7c6fd8d57c0f1130c51f254b6b041524.jpg differ diff --git a/public/uploads/images/847fc3c3c2114a6c7c40c6d2bc4c55bf.jpg b/public/uploads/images/847fc3c3c2114a6c7c40c6d2bc4c55bf.jpg new file mode 100644 index 00000000..0a48f1ac Binary files /dev/null and b/public/uploads/images/847fc3c3c2114a6c7c40c6d2bc4c55bf.jpg differ diff --git a/public/uploads/images/9b377c17a3ab32fa488c128f1b2e4b35.jpg b/public/uploads/images/9b377c17a3ab32fa488c128f1b2e4b35.jpg new file mode 100644 index 00000000..aaa2f82b Binary files /dev/null and b/public/uploads/images/9b377c17a3ab32fa488c128f1b2e4b35.jpg differ diff --git a/public/uploads/images/a6e528d2782c4a1e7c23938185faf896.jpg b/public/uploads/images/a6e528d2782c4a1e7c23938185faf896.jpg new file mode 100644 index 00000000..b46db64d Binary files /dev/null and b/public/uploads/images/a6e528d2782c4a1e7c23938185faf896.jpg differ diff --git a/public/uploads/images/a7f0c9ef33f647842d3f2708a46d34d1.jpg b/public/uploads/images/a7f0c9ef33f647842d3f2708a46d34d1.jpg new file mode 100644 index 00000000..a2f0b8c1 Binary files /dev/null and b/public/uploads/images/a7f0c9ef33f647842d3f2708a46d34d1.jpg differ diff --git a/public/uploads/images/a96dafb88f46cc660523fb4a95c96f5e.jpg b/public/uploads/images/a96dafb88f46cc660523fb4a95c96f5e.jpg new file mode 100644 index 00000000..aaa2f82b Binary files /dev/null and b/public/uploads/images/a96dafb88f46cc660523fb4a95c96f5e.jpg differ diff --git a/public/uploads/images/adc68a1a57c6a754fab342e0d9d63035.jpg b/public/uploads/images/adc68a1a57c6a754fab342e0d9d63035.jpg new file mode 100644 index 00000000..aaa2f82b Binary files /dev/null and b/public/uploads/images/adc68a1a57c6a754fab342e0d9d63035.jpg differ diff --git a/public/uploads/images/b201be4c716b4cde6413772c92149bd9.jpg b/public/uploads/images/b201be4c716b4cde6413772c92149bd9.jpg new file mode 100644 index 00000000..49ec5c5f Binary files /dev/null and b/public/uploads/images/b201be4c716b4cde6413772c92149bd9.jpg differ diff --git a/public/uploads/images/b9267afd20cdc7c33ccea0b6825d49bd.jpg b/public/uploads/images/b9267afd20cdc7c33ccea0b6825d49bd.jpg new file mode 100644 index 00000000..7324ce9f Binary files /dev/null and b/public/uploads/images/b9267afd20cdc7c33ccea0b6825d49bd.jpg differ diff --git a/public/uploads/images/bb700c0ab93384bbcfb0a5596d2f39b3.jpg b/public/uploads/images/bb700c0ab93384bbcfb0a5596d2f39b3.jpg new file mode 100644 index 00000000..3a17dff8 Binary files /dev/null and b/public/uploads/images/bb700c0ab93384bbcfb0a5596d2f39b3.jpg differ diff --git a/public/uploads/images/c23cabe7f97996d42ba8a7a4cc6519c6.jpg b/public/uploads/images/c23cabe7f97996d42ba8a7a4cc6519c6.jpg new file mode 100644 index 00000000..e7ceae2e Binary files /dev/null and b/public/uploads/images/c23cabe7f97996d42ba8a7a4cc6519c6.jpg differ diff --git a/public/uploads/images/c3149084e4b6b79a13034cdb69fd2bca.jpg b/public/uploads/images/c3149084e4b6b79a13034cdb69fd2bca.jpg new file mode 100644 index 00000000..e7ceae2e Binary files /dev/null and b/public/uploads/images/c3149084e4b6b79a13034cdb69fd2bca.jpg differ diff --git a/public/uploads/images/da76311bc2383c928f637adb1280dc65.jpg b/public/uploads/images/da76311bc2383c928f637adb1280dc65.jpg new file mode 100644 index 00000000..911917fd Binary files /dev/null and b/public/uploads/images/da76311bc2383c928f637adb1280dc65.jpg differ diff --git a/public/uploads/images/e5873a9a25342181a770eb4b84fdde16.jpg b/public/uploads/images/e5873a9a25342181a770eb4b84fdde16.jpg new file mode 100644 index 00000000..e7ceae2e Binary files /dev/null and b/public/uploads/images/e5873a9a25342181a770eb4b84fdde16.jpg differ diff --git a/public/uploads/images/ee507dbd8c6fb71afb9f9fbe9cfb2275.jpg b/public/uploads/images/ee507dbd8c6fb71afb9f9fbe9cfb2275.jpg new file mode 100644 index 00000000..7324ce9f Binary files /dev/null and b/public/uploads/images/ee507dbd8c6fb71afb9f9fbe9cfb2275.jpg differ diff --git a/public/uploads/images/fe9145e59cb598b0a9c9c9f077779744.jpg b/public/uploads/images/fe9145e59cb598b0a9c9c9f077779744.jpg new file mode 100644 index 00000000..60ec6084 Binary files /dev/null and b/public/uploads/images/fe9145e59cb598b0a9c9c9f077779744.jpg differ diff --git a/public/uploads/web/advertisements/okuz.jpg b/public/uploads/web/advertisements/okuz.jpg new file mode 100644 index 00000000..8a9a45f5 Binary files /dev/null and b/public/uploads/web/advertisements/okuz.jpg differ diff --git a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php index 617009c3..118a79f5 100644 --- a/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php +++ b/resources/views/vendor/backpack/base/inc/sidebar_content.blade.php @@ -6,22 +6,11 @@
+ {!! $news->description !!} +
+