Skip to content

Instantly share code, notes, and snippets.

View guest.vue
<script>
import navigationMixin from '@/mixins/navigation';
export default {
name: "guest",
mixins: [navigationMixin],
}
</script>
View HomeController.php
<?php namespace App\Controllers;
class HomeController extends BaseController
{
public function index () {
return $this->blade->render('home', ['name' => 'Cursosdesarrolloweb']);
}
}
View BaseController.php
<?php namespace App\Controllers;
use CodeIgniter\Controller;
use Jenssegers\Blade\Blade;
class BaseController extends Controller
{
protected $blade;
public function __construct () {
View component.vue
<template>
<div class="cmp" v-if="id">
{{ id }}
</div>
</template>
<script>
import {createNamespacedHelpers} from 'vuex';
const { mapActions, mapState } = createNamespacedHelpers(
"users"
View Component.js
watch: {
'component_data.dato2': function (newVal, oldVal) {
// DO STUFF
}
},
View Component.js
data () {
return {
component_data: {
dato1: 1,
dato2: 2,
dato3: 3
},
}
}
View AdminController.php
<?php
public function coursesJson () {
if(request()->ajax()) {
$vueTables = new EloquentVueTables;
/*************************************OBTENEMOS LA FK Y LA RELACIÓN*************************************/
$data = $vueTables->get(new Course, ['courses.id', 'name', 'status', 'teacher_id'], ['teacher']);
return response()->json($data);
}
return abort(401);
View Encryptable.php
<?php
namespace App\Traits;
/**
* Trait Encryptable
* @package App\Traits
*/
trait Encryptable
{
View component.vue
<template>
<div>
<select v-model="selected_hour">
<option v-for="(value, key) in hours" :value="value">{{ value }}</option>
</select>
</div>
</template>
<script>
export defaul {