Skip to content

Instantly share code, notes, and snippets.

View Mozartted's full-sized avatar
💭
building stuff

Moz Mozartted

💭
building stuff
View GitHub Profile
@Mozartted
Mozartted / NoteSidebar.vue
Created August 31, 2017 11:12
New NoteSidebar axios enhanced
<template>
<div class="col-md-3 nopadding">
<div class="note-container">
<div class="note-title">Real Notes</div>
<div class="notes-items" v-for="(note,index) in notes" @click="selectNotes(note)">
<h5 class="font-fa">{{note.title}}</h5>
<span @click="remove(note,index)">click to remove</span>
</div>
<div class="add-note" @click="createNote">New Note?</div>
</div>
@Mozartted
Mozartted / NoteApp.vue
Created August 31, 2017 10:51
The Axios enhananced
<template>
<div class="col-md-12 contain nopadding">
<note-sidebar v-if="notes" :initialnotes="notes" @noteChosen="noteSelected"></note-sidebar>
<note-editor v-if="firstNote" :note="firstNote"/>
</div>
</template>
<script>
import NoteEditor from './NoteEditor.vue';
import NoteSidebar from './NoteSidebar';
@Mozartted
Mozartted / api.php
Last active August 31, 2017 10:17
Routes handling Note operations
<?php
Route::get('/notes',['as'=>'noteGet','uses'=>'NoteController@notes']);
Route::post('/notes/create',['as'=>'noteCreate','uses'=>'NoteController@createNote']);
Route::delete('/notes/delete/{id}',['as'=>'noteControl','uses'=>'NoteController@deleteNote']);
Route::put('/notes/update/{id}',['as'=>'noteControl','uses'=>'NoteController@updateNote']);
@Mozartted
Mozartted / NoteController.php
Created August 31, 2017 10:07
Controller handling all note operations
<?php
namespace App\Http\Controllers;
use App\Note;
use Illuminate\Http\Request;
class NoteController extends Controller
{
@Mozartted
Mozartted / create_user_table.php
Created August 31, 2017 09:52
Creating the Users
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
@Mozartted
Mozartted / create_note_table.php
Last active August 31, 2017 09:51
Creating Note Table
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateNotesTable extends Migration
{
/**
* Run the migrations.
@Mozartted
Mozartted / app.scss
Created August 24, 2017 14:37
app .scss file
// Fonts
@import url("https://fonts.googleapis.com/css?family=Raleway:300,400,600");
// Variables
@import "variables";
// Bootstrap
@import "~bootstrap-sass/assets/stylesheets/bootstrap";
@import "./components/notes";
@Mozartted
Mozartted / welcome.blade.php
Created August 24, 2017 14:29
welcome blade view
<!doctype html>
<html lang="{{ app()->getLocale() }}">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="csrf-token" content="{{ csrf_token()}}">
<title>Laravel</title>
<!-- Fonts -->
@Mozartted
Mozartted / NoteEditor.vue
Last active August 24, 2017 14:28
NoteEditor Components
<template>
<div class="col-md-9 nopadding">
<div class="col-md-12">
<input class="top-input" type="" name="" :value="note.title" v-model="note.title" @input="Updated">
</div>
<textarea class="main-text" v-model="note.content">
</textarea>
</div>
</template>
<script>
@Mozartted
Mozartted / NoteSidebar.vue
Created August 24, 2017 13:33
NoteSidebar component
<template>
<div class="col-md-3 nopadding">
<div class="note-container">
<div class="note-title">Real Notes</div>
<div class="notes-items" v-for="(note,index) in notes" @click="selectNotes(note)">
{{note.title}}
<span @click="remove(note,index)">remove</span>
</div>
<div class="add-note" @click="createNote">New Note?</div>
</div>