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 __construct() | |
{ | |
// Only apply middleware to these methods | |
$this->middleware('auth', ['only' => ['create', 'store', 'edit', 'delete']]); | |
// Or exclude middleware from these methods | |
$this->middleware('auth', ['except' => ['confirmPage', 'confirmOrder', 'invoice']]); | |
} |
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(old('uid_tag')) | |
@foreach(old('uid_tag') as $product) | |
<input type="text" name="uid_tag[]" value="{{ old('uid_tag')[$loop->index] }}" size="30" /> | |
<textarea | |
placeholder="Include weight or count" | |
name="product_description[]" | |
cols="45" | |
rows="1" | |
value="{{ old('product_description')[$loop->index] }}" |
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
<h2 class="ui header">Semantic UI Lightbox Example</h2> | |
<section class="ui stackable cards"> | |
<figure class="PhotoCard ui card"> | |
<img src="http://via.placeholder.com/300x250" class="ui fluid image"> | |
<figcaption class="content"> | |
Cool pics | |
</figcaption> | |
</figure> | |
</section> | |
<script> |
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
/** | |
* Setup model event hooks | |
*/ | |
public static function boot() | |
{ | |
parent::boot(); | |
self::creating(function ($table) { | |
// Generate uuid | |
$table->uuid = Uuid::generate(4); | |
}); |
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 __construct() | |
{ | |
// Apply middleware to only certain routes | |
$this->middleware('auth', ['only' => ['create', 'store', 'edit', 'delete']]); | |
// Or apply middleware to all routes except these | |
$this->middleware('auth', ['except' => ['index', 'show']]); | |
} |
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 | |
class PageResourceCollection extends ResourceCollection | |
{ | |
public function toArray($request) | |
{ | |
return [ | |
'data' => $this->collection->transform(function($page){ | |
return [ | |
'id' => $page->id, | |
'title' => $page->title, |
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\Http\Controllers; | |
use App\Models\Project; | |
use Illuminate\Http\Request; | |
class ProjectController extends Controller | |
{ | |
public function update(Request $request, Project $project) |
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
function slugify(text) | |
{ | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} |
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
module.exports = { | |
slugify: function(text) { | |
return text.toString().toLowerCase() | |
.replace(/\s+/g, '-') // Replace spaces with - | |
.replace(/[^\w\-]+/g, '') // Remove all non-word chars | |
.replace(/\-\-+/g, '-') // Replace multiple - with single - | |
.replace(/^-+/, '') // Trim - from start of text | |
.replace(/-+$/, ''); // Trim - from end of text | |
} | |
}; |
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
<style> | |
@media (max-width: 800px) { | |
.container { | |
display: -webkit-box; | |
display: -moz-box; | |
display: -ms-flexbox; | |
display: -webkit-flex; | |
display: flex; | |
-webkit-box-orient: vertical; | |
-moz-box-orient: vertical; |