Skip to content

Instantly share code, notes, and snippets.

Laracasts laracasts

Block or report user

Report or block laracasts

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@laracasts
laracasts / Alert.vue
Created Mar 15, 2016
Alert .vue example.
View Alert.vue
<template>
<div class="Alert Alert--{{ type | capitalize }}">
<slot></slot>
</div>
</template>
<script>
export default {
props: {
type: {
@laracasts
laracasts / modal.blade.php
Last active Aug 12, 2019
Modals with Zero JavaScript
View modal.blade.php
<div id="{{ $name }}" class="overlay">
<a href="#" class="cancel"></a>
<div class="modal">
{{ $slot }}
<a href="#" class="close">&times;</a>
</div>
</div>
@laracasts
laracasts / vue-custom-input-component-exercise.js
Created Jan 9, 2017
vuecasts.com - Custom Input Components exercise.
View vue-custom-input-component-exercise.js
Vue.component('coupon', {
props: ['code'],
template: `
<input type="text"
:value="code"
@input="updateCode($event.target.value)"
ref="input">
`,
View webpack.config.js
let webpack = require('webpack');
let path = require('path');
module.exports = {
entry: {
app: './resources/assets/js/app.js',
vendor: ['vue', 'axios']
},
output: {
@laracasts
laracasts / gist:f4a304232c1be6dbb4f8
Last active Jul 15, 2019
Laracasts PHPStorm theme.
View gist:f4a304232c1be6dbb4f8
@laracasts
laracasts / Gulpfile.js
Created Aug 20, 2014
PHPSpec auto-testing Gulpfile
View Gulpfile.js
var gulp = require('gulp');
var phpspec = require('gulp-phpspec');
var run = require('gulp-run');
var notify = require('gulp-notify');
gulp.task('test', function() {
gulp.src('spec/**/*.php')
.pipe(run('clear'))
.pipe(phpspec('', { notify: true }))
.on('error', notify.onError({
@laracasts
laracasts / Accordion.vue
Created May 25, 2018
vuecasts.com - episode 41 source code.
View Accordion.vue
<template>
<div>
<accordion-item
v-for="(item, index) in items"
:title="item[titleName]"
:body="item[bodyName]"
:key="index"
:is-open="activeItemIndex == index"
@toggled="onToggle"
></accordion-item>
View sublime-user-setting.json
{
"additional_path_items":
[
"/usr/local/php5/bin/"
],
"auto_complete_selector": "source, text",
"bold_folder_labels": true,
"color_scheme": "Packages/Colorsublime-Themes/Facebook.tmTheme",
"font_face": "Fira Code",
"font_options": [],
@laracasts
laracasts / usage.php
Last active Mar 2, 2019
Little JavaScript helpers for a Laravel app.
View usage.php
{{ Form::open(['data-remote', 'data-remote-success-message' => 'I have now done the thing.']) }}
{{ Form::text('name') }}
{{ Form::submit('Submit', ['data-confirm' => 'Are you sure?']) }}
{{ Form::close() }}
@laracasts
laracasts / pivot-generator.php
Last active Sep 14, 2018
Artisan Pivot Migration Generator
View pivot-generator.php
<?php
namespace App\Console\Commands;
use Illuminate\Console\GeneratorCommand;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputOption;
class PivotMigrationMakeCommand extends GeneratorCommand
{
You can’t perform that action at this time.