diff --git a/app/Models/SubRange.php b/app/Models/SubRange.php index b2eced04..c465b4aa 100644 --- a/app/Models/SubRange.php +++ b/app/Models/SubRange.php @@ -10,11 +10,21 @@ class SubRange extends Model { use HasFactory; + /** + * The model's attributes. + * + * @var array + */ protected $attributes = [ 'back_link_url' => '', 'back_link_text' => '' ]; + /** + * The attributes that are mass assignable. + * + * @var array + */ protected $fillable = [ 'name', 'picture_alt', 'back_link_url', 'back_link_text', @@ -22,20 +32,28 @@ class SubRange extends Model 'subtitle', 'content' ]; + /** + * Perform any actions required after the model boots. + * + * @return void + */ protected static function booted() { static::creating(function (SubRange $subRange) { - $subRange->title = clean($subRange->title); $subRange->content = clean($subRange->content); $subRange->slug = Str::slug($subRange->name); }); static::updating(function (SubRange $subRange) { - $subRange->title = clean($subRange->title); $subRange->content = clean($subRange->content); $subRange->slug = Str::slug($subRange->name); }); } + /** + * BelongsToMany ranges relation + * + * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany + */ public function ranges() { return $this->belongsToMany(Range::class, 'range_sub_range'); diff --git a/package-lock.json b/package-lock.json index c4dc4f63..2a12dfd0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,5 +1,5 @@ { - "name": "srcs", + "name": "legaulois2020", "lockfileVersion": 2, "requires": true, "packages": { diff --git a/resources/js/app.js b/resources/js/app.js index 29bdce07..694f9074 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -9,6 +9,8 @@ require('vue-select-image/dist/vue-select-image.css'); let bootstrap = require('bootstrap'); require('bootstrap/js/dist/tooltip'); import bsCustomFileInput from 'bs-custom-file-input' +import Vue from 'vue' +window.Vue = Vue $(document).ready(function () { bsCustomFileInput.init() @@ -25,10 +27,11 @@ if (window.vueDebug) { Vue.config.debug = true; } -window.Vue = require('vue/dist/vue.min.js'); -import VueSelectImage from 'vue-select-image'; +import VueSelectImage from 'vue-select-image' // ES6 Modules or TypeScript -import Swal from 'sweetalert2'; +import Swal from 'sweetalert2' + + // bootstrap styling window.Swal = Swal.mixin({