Skip to content

Instantly share code, notes, and snippets.

View abishekrsrikaanth's full-sized avatar
🏠
Working from home

Abishek R Srikaanth abishekrsrikaanth

🏠
Working from home
View GitHub Profile
<?php
use App\Models\User;
namespace App\Nova\Metrics;
class NewUsers extends Value
{
public $name = 'Customers';
<?php
namespace App\Models;
class User extends Authenticatable
{
use Notifiable, HasRoles, Billable;
public $table = 'users';
<?php
use Laravel\Nova\Http\Requests\NovaRequest;
trait ShouldRedirectToParentFromChildResource
{
/**
* Return the location to redirect the user after creation.
*/
public static function redirectAfterCreate(NovaRequest $request, $resource)
<?php
public function fields(Request $request)
{
return [
Textarea::make('Description')
->displayUsing(function($description) {
return Str::substr($description, 0, 100) . '....';
})->onlyOnIndex(),
<?php
Textarea::make('Description')->displayUsing(function($description) {
return Str::substr($description, 0, 100) . '....';
}),
<?php
use Illuminate\Http\Request;
trait ResourceDoesNotRequireEditing
{
/**
* Determine if the current user can create new resources.
*
* @param Request $request
<?php
/**
* Get the displayable label of the resource.
*
* @return string
*/
public static function label()
{
return 'Emails Sent';
use Laravel\Nova\Resource;
class Customer extends Resource
{
public static $displayInNavigation = false;
}
php artisan nova:resource Account/Resources/Customers --model="App\Domains\Account\Models\Customer"
import Vue from 'vue';
import PubNubVue from 'pubnub-vue';
import App from './App';
Vue.use(PubNubVue, {
subscribeKey: 'YOUR SUBSCRIBE KEY HERE',
publishKey: 'YOUR PUBLISH KEY HERE'
});
new Vue({