--- /dev/null
+<?php
+
+namespace App\Http\Controllers\Admin;
+
+use A17\Twill\Http\Controllers\Admin\ModuleController;
+
+class PharmaChronicleController extends ModuleController
+{
+ protected $moduleName = 'pharmaChronicles';
+}
--- /dev/null
+<?php
+
+namespace App\Http\Controllers;
+
+use App\Models\PharmaChronicle;
+use Illuminate\Http\Request;
+
+class PharmaChronicleController extends Controller
+{
+
+ public function index()
+ {
+ $videos = PharmaChronicle::query()
+ ->orderByDesc('broadcast_date')
+ ->published()
+ ->visible()
+ ->take(2)
+ ->get();
+ \View::share('title', "Les Chroniques Pharma");
+ \View::share('videos', $videos);
+
+ return view('pharma-chronicle.index');
+
+ }
+}
--- /dev/null
+<?php
+
+namespace App\Http\Requests\Admin;
+
+use A17\Twill\Http\Requests\Admin\Request;
+
+class PharmaChronicleRequest extends Request
+{
+ public function rulesForCreate()
+ {
+ return [];
+ }
+
+ public function rulesForUpdate()
+ {
+ return [];
+ }
+}
--- /dev/null
+<?php
+
+namespace App\Models;
+
+use A17\Twill\Models\Behaviors\HasSlug;
+use A17\Twill\Models\Model;
+
+class PharmaChronicle extends Model
+{
+ use HasSlug;
+
+ protected $fillable = [
+ 'published',
+ 'title',
+ 'youtube_link',
+ 'broadcast_date',
+ ];
+
+ public $slugAttributes = [
+ 'title',
+ ];
+
+}
--- /dev/null
+<?php
+
+namespace App\Models\Slugs;
+
+use A17\Twill\Models\Model;
+
+class PharmaChronicleSlug extends Model
+{
+ protected $table = "pharma_chronicle_slugs";
+}
--- /dev/null
+<?php
+
+namespace App\Repositories;
+
+use A17\Twill\Repositories\Behaviors\HandleSlugs;
+use A17\Twill\Repositories\ModuleRepository;
+use App\Models\PharmaChronicle;
+
+class PharmaChronicleRepository extends ModuleRepository
+{
+ use HandleSlugs;
+
+ public function __construct(PharmaChronicle $model)
+ {
+ $this->model = $model;
+ }
+}
'title' => 'Humeurs',
'module' => true
],
+ 'pharmaChronicles' => [
+ 'title' => 'Chroniques pharma',
+ 'module' => true
+ ],
'weeklyAgendas' => [
'title' => 'Agenda',
'module' => true
--- /dev/null
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+
+class CreatePharmaChroniclesTables extends Migration
+{
+ public function up()
+ {
+ Schema::create('pharma_chronicles', function (Blueprint $table) {
+ // this will create an id, a "published" column, and soft delete and timestamps columns
+ createDefaultTableFields($table);
+
+ // feel free to modify the name of this column, but title is supported by default (you would need to specify the name of the column Twill should consider as your "title" column in your module controller if you change it)
+ $table->string('title', 200)->nullable();
+
+ // your generated model and form include a description field, to get you started, but feel free to get rid of it if you don't need it
+ //$table->text('description')->nullable();
+
+ $table->text('youtube_link')->nullable();
+
+ $table->timestamp('broadcast_date')->nullable();
+
+ // add those 2 columns to enable publication timeframe fields (you can use publish_start_date only if you don't need to provide the ability to specify an end date)
+ // $table->timestamp('publish_start_date')->nullable();
+ });
+
+ Schema::create('pharma_chronicle_slugs', function (Blueprint $table) {
+ createDefaultSlugsTableFields($table, 'pharma_chronicle');
+ });
+
+
+ }
+
+ public function down()
+ {
+
+ Schema::dropIfExists('pharma_chronicle_slugs');
+ Schema::dropIfExists('pharma_chronicles');
+ }
+}
--- /dev/null
+@extends('twill::layouts.form')
+
+@section('contentFields')
+ @formField('input', [
+ 'name' => 'youtube_link',
+ 'label' => 'Lien YouTube',
+ 'maxlength' => 500,
+ 'required' => true
+
+ ])
+
+ @formField('date_picker', [
+ 'name' => 'broadcast_date',
+ 'label' => 'Date de diffusion',
+ 'withTime' => false,
+ 'required' => true
+ ])
+@stop
@extends('twill::layouts.settings', ['contentFieldsetLabel' => 'Modification du contenu statique'])
@section('contentFields')
+
+ @formField('wysiwyg', [
+ 'label' => 'Texte Chroniques Pharma',
+ 'name' => 'pharma_chronicles_text',
+ 'maxlength' => 1000,
+ 'required' => true,
+ 'toolbarOptions' => \App\Helpers\Fields::fullToolbar(),
+ ])
@formField('wysiwyg', [
'label' => 'Texte page pas encore abonné',
'name' => 'not_registered_text',
--- /dev/null
+@extends('layouts.app')
+@inject('settings', \A17\Twill\Repositories\SettingRepository)
+
+@section('content')
+ <div class="container psq-podcasts">
+ <h1>L'actualité du médicament à la une de notre quotidien</h1>
+
+
+ <div class="mt-5 row">
+ <div class="col-md-7">
+ <img src="https://prescription-quotidien.com/images/e9ed1eeb-f2c9-48a2-b170-e46c8342fc58/Check-up-sante-web-204_3.jpg" alt="" class="w-100">
+
+ <div>
+ <h2 class="text-center my-3">DÉCOUVREZ LA DERNIÈRE ÉMISSION DE CHECK-UP SANTÉ </h2>
+ {!! $settings->byKey('pharma_chronicles_text') !!}
+ </div>
+
+ </div>
+
+ <div class="col-md-5">
+ <div class="text-center">
+ <p>CHECK-UP SANTÉ</p>
+ <p>RETROUVEZ LES DERNIÈRES</p>
+ <p>CHRONIQUE PHARMA D'OLIVIER ROBICHON</p>
+
+
+ @foreach($videos as $video)
+
+ <h3>{{$video->broadcast_date}}</h3>
+ <h3>{{$video->title}}</h3>
+ @component('site.blocks.youtube', ['yt_url' => $video->youtube_link])
+ @endcomponent
+
+
+ @endforeach
+
+ </div>
+
+ </div>
+
+
+ </div>
+
+
+ </div>
+
+@endsection
@php
-$url = \App\Helpers\StreamingPlatforms::youtubeEmbed($block->input('url'));
+$url = \App\Helpers\StreamingPlatforms::youtubeEmbed(isset($block) ? $block->input('url') : $yt_url);
@endphp
<div class="youtube-block">
@if($url === null)
Route::module('weeklyAgendas');
// Route::module('eventImages');
Route::module('humeurs');
+ Route::module('pharmaChronicles');
Route::module('guests'); //podcast guests
});
Route::get('humeurs/{slug}', 'HumeurController@show')->name('humeur.show');
Route::get('agendas/{agenda:start_date}', 'AgendaController@show')->name('agenda.show');
+ Route::get('chroniques-pharma', 'PharmaChronicleController@index')->name('pharma-chronicle.index');
+
+
Route::get('/l/{link:slug}', 'TrackedLinkController@redirect')->name('track');
Route::get('site-ferme', 'WallController@wall');