View app.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link href="/css/app.css" rel="stylesheet"> | |
<!-- Scripts --> | |
<script> | |
window.Laravel = {!! json_encode([ | |
'csrfToken' => csrf_token(), | |
]) !!}; | |
</script> |
View header.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
if($this->session->role) { | |
if($this->session->role === "user") { | |
$this->load->view('menus/user_menu'); | |
} elseif($this->session->role === "admin") { | |
$this->load->view('menus/admin_menu'); | |
} | |
} |
View SuperCourse.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App\Traits; | |
trait SuperCourse { | |
protected static function bootSuperCourse() { | |
static::creating(function($course) { | |
dd($course->toArray()); | |
}); | |
} | |
} |
View Course.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use App\Traits\SuperCourse; | |
use Illuminate\Database\Eloquent\Model; | |
class Course extends Model | |
{ |
View companies.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div id="companies"> | |
<ul> | |
<li v-for="company in companies"> | |
{{ company.name }} | |
</li> | |
</ul> | |
</div> | |
</template> |
View companies.blade.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<company-list | |
:companies="{{ json_encode($companies) }}" | |
> | |
</company-list> |
View web.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::resource('/companies', 'CompanyController'); | |
/** | |
GET|HEAD | companies | companies.index | App\Http\Controllers\CompanyController@index | web,auth | | |
POST | companies | companies.store | App\Http\Controllers\CompanyController@store | web,auth | | |
GET|HEAD | companies/create | companies.create | App\Http\Controllers\CompanyController@create | web,auth | | |
DELETE | companies/{company} | companies.destroy | App\Http\Controllers\CompanyController@destroy | web,auth | | |
GET|HEAD | companies/{company} | companies.show | App\Http\Controllers\CompanyController@show | web,auth | | |
PUT|PATCH | companies/{company} | companies.update | App\Http\Controllers\CompanyController@update | web,auth | |
View web.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
Route::resource('/companies', 'CompanyController', ['parameters' => [ | |
'companies' => 'model' | |
]]); | |
/** | |
GET|HEAD | companies | companies.index | App\Http\Controllers\CompanyController@index | web,auth | | |
POST | companies | companies.store | App\Http\Controllers\CompanyController@store | web,auth | | |
GET|HEAD | companies/create | companies.create | App\Http\Controllers\CompanyController@create | web,auth | | |
DELETE | companies/{model} | companies.destroy | App\Http\Controllers\CompanyController@destroy | web,auth | |
View CompanyController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @param Company $model | |
*/ | |
public function edit(Company $model) { | |
//TODO mostrar el formulario de edición de la compañía | |
} |
View ModulesController.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function store() | |
{ | |
$error = null; | |
DB::beginTransaction(); | |
try { | |
Module::buildComponent("type1"); | |
OlderNewer