I like to maximize the working space of a dashboard so here's a few tips to accomplish that with Larave Nova.
nova/resources/css/app.css
/**
* Nova CSS Tweaks (add to line 3)
| import React from 'react'; | |
| import ReactDOM from 'react-dom'; | |
| const handleLogout = () => { | |
| axios.post('/logout') | |
| .then(() => location.href = '/home') | |
| }; | |
| function Example() { | |
| return ( |
| #!/bin/bash | |
| if [ "$EUID" -ne 0 ] | |
| then echo "Please run as root" | |
| exit | |
| fi | |
| apt-get install pkg-config libmagickwand-dev -y | |
| cd /tmp | |
| wget https://pecl.php.net/get/imagick-3.4.4.tgz | |
| tar xvzf imagick-3.4.4.tgz |
| <?php | |
| // Add "api_token" field to your user model | |
| // https://medium.com/@danielalvidrez/how-to-use-laravels-built-in-token-auth-6b6f6c26d059 | |
| // http://laravel.local/api/resources/pages/1?api_token=XXX | |
| use Illuminate\Http\Request; | |
| use Illuminate\Support\Facades\Auth; | |
| use Illuminate\Support\Facades\Config; | |
| use Illuminate\Support\Facades\App; | |
| Route::middleware('auth:api')->get('resources/{resource}/{page?}', function ($resource, $page = 1) { |
| <IfModule mod_rewrite.c> | |
| <IfModule mod_negotiation.c> | |
| Options -MultiViews -Indexes | |
| </IfModule> | |
| RewriteEngine On | |
| # Force HTTPS & Allow LetsEncrypt | |
| RewriteCond %{REQUEST_URI} !\.well-known/acme-challenge | |
| RewriteCond %{HTTP:X-Forwarded-Proto} !https |
| function pushme { | |
| br=`git branch | grep "*"` | |
| git add --all | |
| if (($# > 1)); then | |
| params='' | |
| for i in $*; | |
| do |
| details summary { | |
| cursor: pointer; | |
| outline: none !important; | |
| display: inline-block; | |
| padding: 8px 12px; | |
| padding-top: 10px; | |
| border-radius: 4px; | |
| overflow: hidden; | |
| background: #F09825; | |
| color: white; |
| <?php | |
| namespace App\Builders; | |
| use Illuminate\Database\Eloquent\Builder as BaseBuilder; | |
| class Builder extends BaseBuilder | |
| { | |
| public function search($term, $attributes) | |
| { |
| // Add this to the "boot()" method of your "AppServiceProvider" | |
| <?php | |
| \Illuminate\Database\Eloquent\Builder::macro('search', function ($name, $search) { | |
| return $this->where($name, 'LIKE', $search ? '%'.$search.'%' : ''); | |
| }); |
| <?php | |
| // Usage: | |
| // Before | |
| @if ($errors->has('email')) | |
| <span>{{ $errors->first('email') }}</span> | |
| @endif | |
| // After: |