Showing preview only (251K chars total). Download the full file or copy to clipboard to get everything.
Repository: zgabievi/pingcrm-svelte
Branch: master
Commit: 4bc6d9883123
Files: 136
Total size: 220.4 KB
Directory structure:
gitextract_loyfmr9_/
├── .editorconfig
├── .eslintrc.js
├── .gitattributes
├── .gitignore
├── .prettierrc
├── LICENSE
├── Procfile
├── app/
│ ├── Account.php
│ ├── Console/
│ │ └── Kernel.php
│ ├── Contact.php
│ ├── Exceptions/
│ │ └── Handler.php
│ ├── Http/
│ │ ├── Controllers/
│ │ │ ├── Auth/
│ │ │ │ ├── ForgotPasswordController.php
│ │ │ │ ├── LoginController.php
│ │ │ │ ├── RegisterController.php
│ │ │ │ ├── ResetPasswordController.php
│ │ │ │ └── VerificationController.php
│ │ │ ├── ContactsController.php
│ │ │ ├── Controller.php
│ │ │ ├── DashboardController.php
│ │ │ ├── ImagesController.php
│ │ │ ├── OrganizationsController.php
│ │ │ ├── ReportsController.php
│ │ │ └── UsersController.php
│ │ ├── Kernel.php
│ │ └── Middleware/
│ │ ├── Authenticate.php
│ │ ├── CheckForMaintenanceMode.php
│ │ ├── EncryptCookies.php
│ │ ├── RedirectIfAuthenticated.php
│ │ ├── TrimStrings.php
│ │ ├── TrustProxies.php
│ │ └── VerifyCsrfToken.php
│ ├── Model.php
│ ├── Organization.php
│ ├── Providers/
│ │ ├── AppServiceProvider.php
│ │ ├── AuthServiceProvider.php
│ │ ├── BroadcastServiceProvider.php
│ │ ├── EventServiceProvider.php
│ │ └── RouteServiceProvider.php
│ └── User.php
├── artisan
├── bootstrap/
│ ├── app.php
│ └── cache/
│ └── .gitignore
├── composer.json
├── config/
│ ├── app.php
│ ├── auth.php
│ ├── broadcasting.php
│ ├── cache.php
│ ├── database.php
│ ├── filesystems.php
│ ├── hashing.php
│ ├── logging.php
│ ├── mail.php
│ ├── queue.php
│ ├── sentry.php
│ ├── services.php
│ ├── session.php
│ └── view.php
├── database/
│ ├── .gitignore
│ ├── factories/
│ │ ├── ContactFactory.php
│ │ ├── OrganizationFactory.php
│ │ └── UserFactory.php
│ ├── migrations/
│ │ ├── 2019_03_05_000000_create_accounts_table.php
│ │ ├── 2019_03_05_000000_create_contacts_table.php
│ │ ├── 2019_03_05_000000_create_organizations_table.php
│ │ ├── 2019_03_05_000000_create_password_resets_table.php
│ │ └── 2019_03_05_000000_create_users_table.php
│ └── seeds/
│ └── DatabaseSeeder.php
├── jsconfig.json
├── package.json
├── phpunit.xml
├── public/
│ ├── .htaccess
│ ├── index.php
│ ├── robots.txt
│ └── web.config
├── readme.md
├── resources/
│ ├── css/
│ │ ├── app.css
│ │ ├── buttons.css
│ │ ├── form.css
│ │ ├── nprogress.css
│ │ └── reset.css
│ ├── js/
│ │ ├── Pages/
│ │ │ ├── Auth/
│ │ │ │ └── Login.svelte
│ │ │ ├── Contacts/
│ │ │ │ ├── Create.svelte
│ │ │ │ ├── Edit.svelte
│ │ │ │ └── Index.svelte
│ │ │ ├── Dashboard/
│ │ │ │ └── Index.svelte
│ │ │ ├── Error.svelte
│ │ │ ├── Organizations/
│ │ │ │ ├── Create.svelte
│ │ │ │ ├── Edit.svelte
│ │ │ │ └── Index.svelte
│ │ │ ├── Reports/
│ │ │ │ └── Index.svelte
│ │ │ └── Users/
│ │ │ ├── Create.svelte
│ │ │ ├── Edit.svelte
│ │ │ └── Index.svelte
│ │ ├── Shared/
│ │ │ ├── BottomHeader.svelte
│ │ │ ├── DeleteButton.svelte
│ │ │ ├── FileInput.svelte
│ │ │ ├── FlashMessages.svelte
│ │ │ ├── Helmet.svelte
│ │ │ ├── Icon.svelte
│ │ │ ├── Layout.svelte
│ │ │ ├── LoadingButton.svelte
│ │ │ ├── Logo.svelte
│ │ │ ├── MainMenu.svelte
│ │ │ ├── MainMenuItem.svelte
│ │ │ ├── Pagination.svelte
│ │ │ ├── SearchFilter.svelte
│ │ │ ├── SelectInput.svelte
│ │ │ ├── TextInput.svelte
│ │ │ ├── TopHeader.svelte
│ │ │ └── TrashedMessage.svelte
│ │ ├── app.js
│ │ └── utils.js
│ ├── lang/
│ │ └── en/
│ │ ├── auth.php
│ │ ├── pagination.php
│ │ ├── passwords.php
│ │ └── validation.php
│ └── views/
│ └── app.blade.php
├── routes/
│ ├── api.php
│ ├── channels.php
│ ├── console.php
│ └── web.php
├── server.php
├── storage/
│ ├── app/
│ │ └── .gitignore
│ ├── debugbar/
│ │ └── .gitignore
│ ├── framework/
│ │ ├── .gitignore
│ │ ├── cache/
│ │ │ └── .gitignore
│ │ ├── sessions/
│ │ │ └── .gitignore
│ │ ├── testing/
│ │ │ └── .gitignore
│ │ └── views/
│ │ └── .gitignore
│ └── logs/
│ └── .gitignore
├── tailwind.config.js
├── tests/
│ ├── CreatesApplication.php
│ ├── Feature/
│ │ ├── ContactsTest.php
│ │ └── OrganizationsTest.php
│ └── TestCase.php
└── webpack.mix.js
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
[*.md]
trim_trailing_whitespace = false
[*.yml]
indent_size = 2
================================================
FILE: .eslintrc.js
================================================
module.exports = {
extends: ['eslint:recommended'],
parser: 'babel-eslint',
parserOptions: {
sourceType: 'module',
ecmaFeatures: {
jsx: true
}
},
rules: {
'no-console': 'off',
'no-undef': 'off',
'svelte3/named-blocks': 'off'
}
};
================================================
FILE: .gitattributes
================================================
* text=auto
*.css linguist-vendored
*.scss linguist-vendored
*.js linguist-vendored
CHANGELOG.md export-ignore
================================================
FILE: .gitignore
================================================
/node_modules
/public/css
/public/hot
/public/js
/public/mix-manifest.json
/public/storage
/storage/*.key
/database/*.sqlite
/vendor
.DS_Store
.env
.php_cs.dist
.phpunit.result.cache
Homestead.json
Homestead.yaml
npm-debug.log
yarn-error.log
.idea
================================================
FILE: .prettierrc
================================================
{
"printWidth": 80,
"singleQuote": true,
"tabWidth": 2
}
================================================
FILE: LICENSE
================================================
MIT License
Copyright (c) Jonathan Reinink <jonathan@reinink.ca>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
================================================
FILE: Procfile
================================================
web: vendor/bin/heroku-php-apache2 public/
================================================
FILE: app/Account.php
================================================
<?php
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
class Account extends Model
{
public function users()
{
return $this->hasMany(User::class);
}
public function organizations()
{
return $this->hasMany(Organization::class);
}
public function contacts()
{
return $this->hasMany(Contact::class);
}
}
================================================
FILE: app/Console/Kernel.php
================================================
<?php
namespace App\Console;
use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
class Kernel extends ConsoleKernel
{
/**
* The Artisan commands provided by your application.
*
* @var array
*/
protected $commands = [
//
];
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
{
// $schedule->command('inspire')
// ->hourly();
}
/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
{
$this->load(__DIR__.'/Commands');
require base_path('routes/console.php');
}
}
================================================
FILE: app/Contact.php
================================================
<?php
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
class Contact extends Model
{
use SoftDeletes;
public function organization()
{
return $this->belongsTo(Organization::class);
}
public function getNameAttribute()
{
return $this->first_name.' '.$this->last_name;
}
public function scopeOrderByName($query)
{
$query->orderBy('last_name')->orderBy('first_name');
}
public function scopeFilter($query, array $filters)
{
$query->when($filters['search'] ?? null, function ($query, $search) {
$query->where(function ($query) use ($search) {
$query->where('first_name', 'like', '%'.$search.'%')
->orWhere('last_name', 'like', '%'.$search.'%')
->orWhere('email', 'like', '%'.$search.'%')
->orWhereHas('organization', function ($query) use ($search) {
$query->where('name', 'like', '%'.$search.'%');
});
});
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
if ($trashed === 'with') {
$query->withTrashed();
} elseif ($trashed === 'only') {
$query->onlyTrashed();
}
});
}
}
================================================
FILE: app/Exceptions/Handler.php
================================================
<?php
namespace App\Exceptions;
use Throwable;
use Inertia\Inertia;
use Illuminate\Support\Facades\App;
use Illuminate\Foundation\Exceptions\Handler as ExceptionHandler;
class Handler extends ExceptionHandler
{
/**
* A list of the exception types that are not reported.
*
* @var array
*/
protected $dontReport = [
//
];
/**
* A list of the inputs that are never flashed for validation exceptions.
*
* @var array
*/
protected $dontFlash = [
'password',
'password_confirmation',
];
/**
* Report or log an exception.
*
* @param \Throwable $exception
* @return void
*/
public function report(Throwable $exception)
{
if (app()->bound('sentry') && $this->shouldReport($exception)) {
app('sentry')->captureException($exception);
}
parent::report($exception);
}
/**
* Render an exception into an HTTP response.
*
* @param \Illuminate\Http\Request $request
* @param \Throwable $exception
* @return \Illuminate\Http\Response
*/
public function render($request, Throwable $exception)
{
$response = parent::render($request, $exception);
if (
(App::environment('production'))
&& $request->header('X-Inertia')
&& in_array($response->status(), [500, 503, 404, 403])
) {
return Inertia::render('Error', ['status' => $response->status()])
->toResponse($request)
->setStatusCode($response->status());
}
return $response;
}
}
================================================
FILE: app/Http/Controllers/Auth/ForgotPasswordController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
class ForgotPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset emails and
| includes a trait which assists in sending these notifications from
| your application to your users. Feel free to explore this trait.
|
*/
use SendsPasswordResetEmails;
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
================================================
FILE: app/Http/Controllers/Auth/LoginController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use Inertia\Inertia;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\URL;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Support\Facades\Response;
use Illuminate\Foundation\Auth\AuthenticatesUsers;
class LoginController extends Controller
{
/*
|--------------------------------------------------------------------------
| Login Controller
|--------------------------------------------------------------------------
|
| This controller handles authenticating users for the application and
| redirecting them to your home screen. The controller uses a trait
| to conveniently provide its functionality to your applications.
|
*/
use AuthenticatesUsers;
/**
* Where to redirect users after login.
*
* @var string
*/
protected $redirectTo = '/';
public function showLoginForm()
{
return Inertia::render('Auth/Login');
}
}
================================================
FILE: app/Http/Controllers/Auth/RegisterController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use App\User;
use App\Http\Controllers\Controller;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Facades\Validator;
use Illuminate\Foundation\Auth\RegistersUsers;
class RegisterController extends Controller
{
/*
|--------------------------------------------------------------------------
| Register Controller
|--------------------------------------------------------------------------
|
| This controller handles the registration of new users as well as their
| validation and creation. By default this controller uses a trait to
| provide this functionality without requiring any additional code.
|
*/
use RegistersUsers;
/**
* Where to redirect users after registration.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
/**
* Get a validator for an incoming registration request.
*
* @param array $data
* @return \Illuminate\Contracts\Validation\Validator
*/
protected function validator(array $data)
{
return Validator::make($data, [
'name' => ['required', 'string', 'max:255'],
'email' => ['required', 'string', 'email', 'max:255', 'unique:users'],
'password' => ['required', 'string', 'min:8', 'confirmed'],
]);
}
/**
* Create a new user instance after a valid registration.
*
* @param array $data
* @return \App\User
*/
protected function create(array $data)
{
return User::create([
'name' => $data['name'],
'email' => $data['email'],
'password' => Hash::make($data['password']),
]);
}
}
================================================
FILE: app/Http/Controllers/Auth/ResetPasswordController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\ResetsPasswords;
class ResetPasswordController extends Controller
{
/*
|--------------------------------------------------------------------------
| Password Reset Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling password reset requests
| and uses a simple trait to include this behavior. You're free to
| explore this trait and override any methods you wish to tweak.
|
*/
use ResetsPasswords;
/**
* Where to redirect users after resetting their password.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('guest');
}
}
================================================
FILE: app/Http/Controllers/Auth/VerificationController.php
================================================
<?php
namespace App\Http\Controllers\Auth;
use App\Http\Controllers\Controller;
use Illuminate\Foundation\Auth\VerifiesEmails;
class VerificationController extends Controller
{
/*
|--------------------------------------------------------------------------
| Email Verification Controller
|--------------------------------------------------------------------------
|
| This controller is responsible for handling email verification for any
| user that recently registered with the application. Emails may also
| be re-sent if the user didn't receive the original email message.
|
*/
use VerifiesEmails;
/**
* Where to redirect users after verification.
*
* @var string
*/
protected $redirectTo = '/home';
/**
* Create a new controller instance.
*
* @return void
*/
public function __construct()
{
$this->middleware('auth');
$this->middleware('signed')->only('verify');
$this->middleware('throttle:6,1')->only('verify', 'resend');
}
}
================================================
FILE: app/Http/Controllers/ContactsController.php
================================================
<?php
namespace App\Http\Controllers;
use App\Contact;
use Inertia\Inertia;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Redirect;
class ContactsController extends Controller
{
public function index()
{
return Inertia::render('Contacts/Index', [
'filters' => Request::all('search', 'trashed'),
'contacts' => Auth::user()->account->contacts()
->with('organization')
->orderByName()
->filter(Request::only('search', 'trashed'))
->paginate()
->transform(function ($contact) {
return [
'id' => $contact->id,
'name' => $contact->name,
'phone' => $contact->phone,
'city' => $contact->city,
'deleted_at' => $contact->deleted_at,
'organization' => $contact->organization ? $contact->organization->only('name') : null,
];
}),
]);
}
public function create()
{
return Inertia::render('Contacts/Create', [
'organizations' => Auth::user()->account
->organizations()
->orderBy('name')
->get()
->map
->only('id', 'name'),
]);
}
public function store()
{
Auth::user()->account->contacts()->create(
Request::validate([
'first_name' => ['required', 'max:50'],
'last_name' => ['required', 'max:50'],
'organization_id' => ['nullable', Rule::exists('organizations', 'id')->where(function ($query) {
$query->where('account_id', Auth::user()->account_id);
})],
'email' => ['nullable', 'max:50', 'email'],
'phone' => ['nullable', 'max:50'],
'address' => ['nullable', 'max:150'],
'city' => ['nullable', 'max:50'],
'region' => ['nullable', 'max:50'],
'country' => ['nullable', 'max:2'],
'postal_code' => ['nullable', 'max:25'],
])
);
return Redirect::route('contacts')->with('success', 'Contact created.');
}
public function edit(Contact $contact)
{
return Inertia::render('Contacts/Edit', [
'contact' => [
'id' => $contact->id,
'first_name' => $contact->first_name,
'last_name' => $contact->last_name,
'organization_id' => $contact->organization_id,
'email' => $contact->email,
'phone' => $contact->phone,
'address' => $contact->address,
'city' => $contact->city,
'region' => $contact->region,
'country' => $contact->country,
'postal_code' => $contact->postal_code,
'deleted_at' => $contact->deleted_at,
],
'organizations' => Auth::user()->account->organizations()
->orderBy('name')
->get()
->map
->only('id', 'name'),
]);
}
public function update(Contact $contact)
{
$contact->update(
Request::validate([
'first_name' => ['required', 'max:50'],
'last_name' => ['required', 'max:50'],
'organization_id' => ['nullable', Rule::exists('organizations', 'id')->where(function ($query) {
$query->where('account_id', Auth::user()->account_id);
})],
'email' => ['nullable', 'max:50', 'email'],
'phone' => ['nullable', 'max:50'],
'address' => ['nullable', 'max:150'],
'city' => ['nullable', 'max:50'],
'region' => ['nullable', 'max:50'],
'country' => ['nullable', 'max:2'],
'postal_code' => ['nullable', 'max:25'],
])
);
return Redirect::back()->with('success', 'Contact updated.');
}
public function destroy(Contact $contact)
{
$contact->delete();
return Redirect::back()->with('success', 'Contact deleted.');
}
public function restore(Contact $contact)
{
$contact->restore();
return Redirect::back()->with('success', 'Contact restored.');
}
}
================================================
FILE: app/Http/Controllers/Controller.php
================================================
<?php
namespace App\Http\Controllers;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Routing\Controller as BaseController;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
}
================================================
FILE: app/Http/Controllers/DashboardController.php
================================================
<?php
namespace App\Http\Controllers;
use Inertia\Inertia;
class DashboardController extends Controller
{
public function __invoke()
{
return Inertia::render('Dashboard/Index');
}
}
================================================
FILE: app/Http/Controllers/ImagesController.php
================================================
<?php
namespace App\Http\Controllers;
use League\Glide\Server;
class ImagesController extends Controller
{
public function show(Server $glide)
{
return $glide->fromRequest()->response();
}
}
================================================
FILE: app/Http/Controllers/OrganizationsController.php
================================================
<?php
namespace App\Http\Controllers;
use Inertia\Inertia;
use App\Organization;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Redirect;
class OrganizationsController extends Controller
{
public function index()
{
return Inertia::render('Organizations/Index', [
'filters' => Request::all('search', 'trashed'),
'organizations' => Auth::user()->account->organizations()
->orderBy('name')
->filter(Request::only('search', 'trashed'))
->paginate()
->only('id', 'name', 'phone', 'city', 'deleted_at'),
]);
}
public function create()
{
return Inertia::render('Organizations/Create');
}
public function store()
{
Auth::user()->account->organizations()->create(
Request::validate([
'name' => ['required', 'max:100'],
'email' => ['nullable', 'max:50', 'email'],
'phone' => ['nullable', 'max:50'],
'address' => ['nullable', 'max:150'],
'city' => ['nullable', 'max:50'],
'region' => ['nullable', 'max:50'],
'country' => ['nullable', 'max:2'],
'postal_code' => ['nullable', 'max:25'],
])
);
return Redirect::route('organizations')->with('success', 'Organization created.');
}
public function edit(Organization $organization)
{
return Inertia::render('Organizations/Edit', [
'organization' => [
'id' => $organization->id,
'name' => $organization->name,
'email' => $organization->email,
'phone' => $organization->phone,
'address' => $organization->address,
'city' => $organization->city,
'region' => $organization->region,
'country' => $organization->country,
'postal_code' => $organization->postal_code,
'deleted_at' => $organization->deleted_at,
'contacts' => $organization->contacts()->orderByName()->get()->map->only('id', 'name', 'city', 'phone'),
],
]);
}
public function update(Organization $organization)
{
$organization->update(
Request::validate([
'name' => ['required', 'max:100'],
'email' => ['nullable', 'max:50', 'email'],
'phone' => ['nullable', 'max:50'],
'address' => ['nullable', 'max:150'],
'city' => ['nullable', 'max:50'],
'region' => ['nullable', 'max:50'],
'country' => ['nullable', 'max:2'],
'postal_code' => ['nullable', 'max:25'],
])
);
return Redirect::back()->with('success', 'Organization updated.');
}
public function destroy(Organization $organization)
{
$organization->delete();
return Redirect::back()->with('success', 'Organization deleted.');
}
public function restore(Organization $organization)
{
$organization->restore();
return Redirect::back()->with('success', 'Organization restored.');
}
}
================================================
FILE: app/Http/Controllers/ReportsController.php
================================================
<?php
namespace App\Http\Controllers;
use Inertia\Inertia;
class ReportsController extends Controller
{
public function __invoke()
{
return Inertia::render('Reports/Index');
}
}
================================================
FILE: app/Http/Controllers/UsersController.php
================================================
<?php
namespace App\Http\Controllers;
use App\User;
use Inertia\Inertia;
use Illuminate\Validation\Rule;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Redirect;
use Illuminate\Validation\ValidationException;
class UsersController extends Controller
{
public function index()
{
return Inertia::render('Users/Index', [
'filters' => Request::all('search', 'role', 'trashed'),
'users' => Auth::user()->account->users()
->orderByName()
->filter(Request::only('search', 'role', 'trashed'))
->paginate()
->transform(function ($user) {
return [
'id' => $user->id,
'name' => $user->name,
'email' => $user->email,
'owner' => $user->owner,
'photo' => $user->photoUrl(['w' => 40, 'h' => 40, 'fit' => 'crop']),
'deleted_at' => $user->deleted_at,
];
}),
]);
}
public function create()
{
return Inertia::render('Users/Create');
}
public function store()
{
Request::validate([
'first_name' => ['required', 'max:50'],
'last_name' => ['required', 'max:50'],
'email' => ['required', 'max:50', 'email', Rule::unique('users')],
'password' => ['nullable'],
'owner' => ['required', 'boolean'],
'photo' => ['nullable', 'image'],
]);
Auth::user()->account->users()->create([
'first_name' => Request::get('first_name'),
'last_name' => Request::get('last_name'),
'email' => Request::get('email'),
'password' => Request::get('password'),
'owner' => Request::get('owner'),
'photo_path' => Request::file('photo') ? Request::file('photo')->store('users') : null,
]);
return Redirect::route('users')->with('success', 'User created.');
}
public function edit(User $user)
{
return Inertia::render('Users/Edit', [
'user' => [
'id' => $user->id,
'first_name' => $user->first_name,
'last_name' => $user->last_name,
'email' => $user->email,
'owner' => $user->owner,
'photo' => $user->photoUrl(['w' => 60, 'h' => 60, 'fit' => 'crop']),
'deleted_at' => $user->deleted_at,
],
]);
}
public function update(User $user)
{
if (App::environment('production') && $user->isDemoUser()) {
return Redirect::back()->with('error', 'Updating the demo user is not allowed.');
}
Request::validate([
'first_name' => ['required', 'max:50'],
'last_name' => ['required', 'max:50'],
'email' => ['required', 'max:50', 'email', Rule::unique('users')->ignore($user->id)],
'password' => ['nullable'],
'owner' => ['required', 'boolean'],
'photo' => ['nullable', 'image'],
]);
$user->update(Request::only('first_name', 'last_name', 'email', 'owner'));
if (Request::file('photo')) {
$user->update(['photo_path' => Request::file('photo')->store('users')]);
}
if (Request::get('password')) {
$user->update(['password' => Request::get('password')]);
}
return Redirect::back()->with('success', 'User updated.');
}
public function destroy(User $user)
{
if (App::environment('production') && $user->isDemoUser()) {
return Redirect::back()->with('error', 'Deleting the demo user is not allowed.');
}
$user->delete();
return Redirect::back()->with('success', 'User deleted.');
}
public function restore(User $user)
{
$user->restore();
return Redirect::back()->with('success', 'User restored.');
}
}
================================================
FILE: app/Http/Kernel.php
================================================
<?php
namespace App\Http;
use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array
*/
protected $middleware = [
\App\Http\Middleware\CheckForMaintenanceMode::class,
\Illuminate\Foundation\Http\Middleware\ValidatePostSize::class,
\App\Http\Middleware\TrimStrings::class,
\Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull::class,
\App\Http\Middleware\TrustProxies::class,
];
/**
* The application's route middleware groups.
*
* @var array
*/
protected $middlewareGroups = [
'web' => [
\App\Http\Middleware\EncryptCookies::class,
\Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse::class,
\Illuminate\Session\Middleware\StartSession::class,
// \Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
'api' => [
'throttle:60,1',
'bindings',
],
];
/**
* The application's route middleware.
*
* These middleware may be assigned to groups or used individually.
*
* @var array
*/
protected $routeMiddleware = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'remember' => \Reinink\RememberQueryStrings::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
];
/**
* The priority-sorted list of middleware.
*
* This forces non-global middleware to always be in the given order.
*
* @var array
*/
protected $middlewarePriority = [
\Illuminate\Session\Middleware\StartSession::class,
\Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\Authenticate::class,
\Illuminate\Session\Middleware\AuthenticateSession::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\Illuminate\Auth\Middleware\Authorize::class,
];
}
================================================
FILE: app/Http/Middleware/Authenticate.php
================================================
<?php
namespace App\Http\Middleware;
use Illuminate\Auth\Middleware\Authenticate as Middleware;
class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string
*/
protected function redirectTo($request)
{
if (! $request->expectsJson()) {
return route('login');
}
}
}
================================================
FILE: app/Http/Middleware/CheckForMaintenanceMode.php
================================================
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode as Middleware;
class CheckForMaintenanceMode extends Middleware
{
/**
* The URIs that should be reachable while maintenance mode is enabled.
*
* @var array
*/
protected $except = [
//
];
}
================================================
FILE: app/Http/Middleware/EncryptCookies.php
================================================
<?php
namespace App\Http\Middleware;
use Illuminate\Cookie\Middleware\EncryptCookies as Middleware;
class EncryptCookies extends Middleware
{
/**
* The names of the cookies that should not be encrypted.
*
* @var array
*/
protected $except = [
//
];
}
================================================
FILE: app/Http/Middleware/RedirectIfAuthenticated.php
================================================
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Support\Facades\Auth;
class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure $next
* @param string|null $guard
* @return mixed
*/
public function handle($request, Closure $next, $guard = null)
{
if (Auth::guard($guard)->check()) {
return redirect('/');
}
return $next($request);
}
}
================================================
FILE: app/Http/Middleware/TrimStrings.php
================================================
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\TrimStrings as Middleware;
class TrimStrings extends Middleware
{
/**
* The names of the attributes that should not be trimmed.
*
* @var array
*/
protected $except = [
'password',
'password_confirmation',
];
}
================================================
FILE: app/Http/Middleware/TrustProxies.php
================================================
<?php
namespace App\Http\Middleware;
use Illuminate\Http\Request;
use Fideloper\Proxy\TrustProxies as Middleware;
class TrustProxies extends Middleware
{
/**
* The trusted proxies for this application.
*
* @var array
*/
protected $proxies = '**';
/**
* The headers that should be used to detect proxies.
*
* @var int
*/
protected $headers = Request::HEADER_X_FORWARDED_AWS_ELB;
}
================================================
FILE: app/Http/Middleware/VerifyCsrfToken.php
================================================
<?php
namespace App\Http\Middleware;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken as Middleware;
class VerifyCsrfToken extends Middleware
{
/**
* Indicates whether the XSRF-TOKEN cookie should be set on the response.
*
* @var bool
*/
protected $addHttpCookie = true;
/**
* The URIs that should be excluded from CSRF verification.
*
* @var array
*/
protected $except = [
//
];
}
================================================
FILE: app/Model.php
================================================
<?php
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Database\Eloquent\Model as Eloquent;
abstract class Model extends Eloquent
{
protected $guarded = [];
protected $perPage = 10;
public function resolveRouteBinding($value, $field = null)
{
return in_array(SoftDeletes::class, class_uses($this))
? $this->where($this->getRouteKeyName(), $value)->withTrashed()->first()
: parent::resolveRouteBinding($value, $field);
}
}
================================================
FILE: app/Organization.php
================================================
<?php
namespace App;
use Illuminate\Database\Eloquent\SoftDeletes;
class Organization extends Model
{
use SoftDeletes;
public function contacts()
{
return $this->hasMany(Contact::class);
}
public function scopeFilter($query, array $filters)
{
$query->when($filters['search'] ?? null, function ($query, $search) {
$query->where('name', 'like', '%'.$search.'%');
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
if ($trashed === 'with') {
$query->withTrashed();
} elseif ($trashed === 'only') {
$query->onlyTrashed();
}
});
}
}
================================================
FILE: app/Providers/AppServiceProvider.php
================================================
<?php
namespace App\Providers;
use Inertia\Inertia;
use League\Glide\Server;
use Carbon\CarbonImmutable;
use Illuminate\Support\Collection;
use Illuminate\Pagination\UrlWindow;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Date;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Session;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\ServiceProvider;
use Illuminate\Pagination\LengthAwarePaginator;
class AppServiceProvider extends ServiceProvider
{
public function boot()
{
Date::use(CarbonImmutable::class);
}
public function register()
{
$this->registerInertia();
$this->registerGlide();
$this->registerLengthAwarePaginator();
}
public function registerInertia()
{
Inertia::version(function () {
return md5_file(public_path('mix-manifest.json'));
});
Inertia::share([
'auth' => function () {
return [
'user' => Auth::user() ? [
'id' => Auth::user()->id,
'first_name' => Auth::user()->first_name,
'last_name' => Auth::user()->last_name,
'email' => Auth::user()->email,
'role' => Auth::user()->role,
'account' => [
'id' => Auth::user()->account->id,
'name' => Auth::user()->account->name,
],
] : null,
];
},
'flash' => function () {
return [
'success' => Session::get('success'),
'error' => Session::get('error'),
];
},
'errors' => function () {
return Session::get('errors')
? Session::get('errors')->getBag('default')->getMessages()
: (object) [];
},
]);
}
protected function registerGlide()
{
$this->app->bind(Server::class, function ($app) {
return Server::create([
'source' => Storage::getDriver(),
'cache' => Storage::getDriver(),
'cache_folder' => '.glide-cache',
'base_url' => 'img',
]);
});
}
protected function registerLengthAwarePaginator()
{
$this->app->bind(LengthAwarePaginator::class, function ($app, $values) {
return new class (...array_values($values)) extends LengthAwarePaginator
{
public function only(...$attributes)
{
return $this->transform(function ($item) use ($attributes) {
return $item->only($attributes);
});
}
public function transform($callback)
{
$this->items->transform($callback);
return $this;
}
public function toArray()
{
return [
'data' => $this->items->toArray(),
'links' => $this->links(),
];
}
public function links($view = null, $data = [])
{
$this->appends(Request::all());
$window = UrlWindow::make($this);
$elements = array_filter([
$window['first'],
is_array($window['slider']) ? '...' : null,
$window['slider'],
is_array($window['last']) ? '...' : null,
$window['last'],
]);
return Collection::make($elements)->flatMap(function ($item) {
if (is_array($item)) {
return Collection::make($item)->map(function ($url, $page) {
return [
'url' => $url,
'label' => $page,
'active' => $this->currentPage() === $page,
];
});
} else {
return [
[
'url' => null,
'label' => '...',
'active' => false,
],
];
}
})->prepend([
'url' => $this->previousPageUrl(),
'label' => 'Previous',
'active' => false,
])->push([
'url' => $this->nextPageUrl(),
'label' => 'Next',
'active' => false,
]);
}
};
});
}
}
================================================
FILE: app/Providers/AuthServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
class AuthServiceProvider extends ServiceProvider
{
/**
* The policy mappings for the application.
*
* @var array
*/
protected $policies = [
// 'App\Model' => 'App\Policies\ModelPolicy',
];
/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
{
$this->registerPolicies();
//
}
}
================================================
FILE: app/Providers/BroadcastServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Support\ServiceProvider;
use Illuminate\Support\Facades\Broadcast;
class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
{
Broadcast::routes();
require base_path('routes/channels.php');
}
}
================================================
FILE: app/Providers/EventServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Event;
use Illuminate\Auth\Events\Registered;
use Illuminate\Auth\Listeners\SendEmailVerificationNotification;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
class EventServiceProvider extends ServiceProvider
{
/**
* The event listener mappings for the application.
*
* @var array
*/
protected $listen = [
Registered::class => [
SendEmailVerificationNotification::class,
],
];
/**
* Register any events for your application.
*
* @return void
*/
public function boot()
{
parent::boot();
//
}
}
================================================
FILE: app/Providers/RouteServiceProvider.php
================================================
<?php
namespace App\Providers;
use Illuminate\Support\Facades\Route;
use Illuminate\Foundation\Support\Providers\RouteServiceProvider as ServiceProvider;
class RouteServiceProvider extends ServiceProvider
{
/**
* This namespace is applied to your controller routes.
*
* In addition, it is set as the URL generator's root namespace.
*
* @var string
*/
protected $namespace = 'App\Http\Controllers';
/**
* Define your route model bindings, pattern filters, etc.
*
* @return void
*/
public function boot()
{
//
parent::boot();
}
/**
* Define the routes for the application.
*
* @return void
*/
public function map()
{
$this->mapApiRoutes();
$this->mapWebRoutes();
//
}
/**
* Define the "web" routes for the application.
*
* These routes all receive session state, CSRF protection, etc.
*
* @return void
*/
protected function mapWebRoutes()
{
Route::middleware('web')
->namespace($this->namespace)
->group(base_path('routes/web.php'));
}
/**
* Define the "api" routes for the application.
*
* These routes are typically stateless.
*
* @return void
*/
protected function mapApiRoutes()
{
Route::prefix('api')
->middleware('api')
->namespace($this->namespace)
->group(base_path('routes/api.php'));
}
}
================================================
FILE: app/User.php
================================================
<?php
namespace App;
use League\Glide\Server;
use Illuminate\Support\Facades\App;
use Illuminate\Support\Facades\URL;
use Illuminate\Auth\Authenticatable;
use Illuminate\Support\Facades\Hash;
use Illuminate\Database\Eloquent\SoftDeletes;
use Illuminate\Foundation\Auth\Access\Authorizable;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\Access\Authorizable as AuthorizableContract;
class User extends Model implements AuthenticatableContract, AuthorizableContract
{
use SoftDeletes, Authenticatable, Authorizable;
protected $casts = [
'owner' => 'boolean',
];
public function account()
{
return $this->belongsTo(Account::class);
}
public function getNameAttribute()
{
return $this->first_name.' '.$this->last_name;
}
public function setPasswordAttribute($password)
{
$this->attributes['password'] = Hash::needsRehash($password) ? Hash::make($password) : $password;
}
public function photoUrl(array $attributes)
{
if ($this->photo_path) {
return URL::to(App::make(Server::class)->fromPath($this->photo_path, $attributes));
}
}
public function isDemoUser()
{
return $this->email === 'johndoe@example.com';
}
public function scopeOrderByName($query)
{
$query->orderBy('last_name')->orderBy('first_name');
}
public function scopeWhereRole($query, $role)
{
switch ($role) {
case 'user': return $query->where('owner', false);
case 'owner': return $query->where('owner', true);
}
}
public function scopeFilter($query, array $filters)
{
$query->when($filters['search'] ?? null, function ($query, $search) {
$query->where(function ($query) use ($search) {
$query->where('first_name', 'like', '%'.$search.'%')
->orWhere('last_name', 'like', '%'.$search.'%')
->orWhere('email', 'like', '%'.$search.'%');
});
})->when($filters['role'] ?? null, function ($query, $role) {
$query->whereRole($role);
})->when($filters['trashed'] ?? null, function ($query, $trashed) {
if ($trashed === 'with') {
$query->withTrashed();
} elseif ($trashed === 'only') {
$query->onlyTrashed();
}
});
}
}
================================================
FILE: artisan
================================================
#!/usr/bin/env php
<?php
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader
| for our application. We just need to utilize it! We'll require it
| into the script here so that we do not have to worry about the
| loading of any our classes "manually". Feels great to relax.
|
*/
require __DIR__.'/vendor/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Artisan Application
|--------------------------------------------------------------------------
|
| When we run the console application, the current CLI command will be
| executed in this console and the response sent back to a terminal
| or another output device for the developers. Here goes nothing!
|
*/
$kernel = $app->make(Illuminate\Contracts\Console\Kernel::class);
$status = $kernel->handle(
$input = new Symfony\Component\Console\Input\ArgvInput,
new Symfony\Component\Console\Output\ConsoleOutput
);
/*
|--------------------------------------------------------------------------
| Shutdown The Application
|--------------------------------------------------------------------------
|
| Once Artisan has finished running, we will fire off the shutdown events
| so that any final work may be done by the application before we shut
| down the process. This is the last thing to happen to the request.
|
*/
$kernel->terminate($input, $status);
exit($status);
================================================
FILE: bootstrap/app.php
================================================
<?php
/*
|--------------------------------------------------------------------------
| Create The Application
|--------------------------------------------------------------------------
|
| The first thing we will do is create a new Laravel application instance
| which serves as the "glue" for all the components of Laravel, and is
| the IoC container for the system binding all of the various parts.
|
*/
$app = new Illuminate\Foundation\Application(
$_ENV['APP_BASE_PATH'] ?? dirname(__DIR__)
);
/*
|--------------------------------------------------------------------------
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$app->singleton(
Illuminate\Contracts\Http\Kernel::class,
App\Http\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Console\Kernel::class,
App\Console\Kernel::class
);
$app->singleton(
Illuminate\Contracts\Debug\ExceptionHandler::class,
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
return $app;
================================================
FILE: bootstrap/cache/.gitignore
================================================
*
!.gitignore
================================================
FILE: composer.json
================================================
{
"name": "laravel/laravel",
"description": "The Laravel Framework.",
"keywords": [
"framework",
"laravel"
],
"license": "MIT",
"type": "project",
"require": {
"php": "^7.2",
"ext-exif": "*",
"ext-gd": "*",
"beyondcode/laravel-dump-server": "^1.0",
"facade/ignition": "^2.0",
"fideloper/proxy": "^4.0",
"fzaninotto/faker": "^1.4",
"inertiajs/inertia-laravel": "^0.1",
"laravel/framework": "^7.0",
"laravel/tinker": "^2.0",
"league/glide": "2.0.x-dev",
"mockery/mockery": "^1.0",
"nunomaduro/collision": "^4.1",
"phpunit/phpunit": "^8.5",
"reinink/remember-query-strings": "^0.1.0",
"sentry/sentry-laravel": "^1.5",
"tightenco/ziggy": "^0.8.0",
"wewowweb/laravel-svelte-preset": "^0.1.4"
},
"autoload": {
"classmap": [
"database/seeds",
"database/factories"
],
"psr-4": {
"App\\": "app/"
}
},
"autoload-dev": {
"psr-4": {
"Tests\\": "tests/"
}
},
"extra": {
"laravel": {
"dont-discover": []
}
},
"scripts": {
"compile": [
"npm run prod",
"@php artisan migrate:fresh",
"@php artisan db:seed"
],
"reseed": [
"@php artisan migrate:fresh",
"@php artisan db:seed"
],
"post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\""
],
"post-create-project-cmd": [
"@php artisan key:generate"
],
"post-autoload-dump": [
"Illuminate\\Foundation\\ComposerScripts::postAutoloadDump",
"@php artisan package:discover"
]
},
"config": {
"preferred-install": "dist",
"sort-packages": true,
"optimize-autoloader": true
},
"minimum-stability": "dev",
"prefer-stable": true
}
================================================
FILE: config/app.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Application Name
|--------------------------------------------------------------------------
|
| This value is the name of your application. This value is used when the
| framework needs to place the application's name in a notification or
| any other location as required by the application or its packages.
|
*/
'name' => env('APP_NAME', 'Laravel'),
/*
|--------------------------------------------------------------------------
| Application Environment
|--------------------------------------------------------------------------
|
| This value determines the "environment" your application is currently
| running in. This may determine how you prefer to configure various
| services the application utilizes. Set this in your ".env" file.
|
*/
'env' => env('APP_ENV', 'production'),
/*
|--------------------------------------------------------------------------
| Application Debug Mode
|--------------------------------------------------------------------------
|
| When your application is in debug mode, detailed error messages with
| stack traces will be shown on every error that occurs within your
| application. If disabled, a simple generic error page is shown.
|
*/
'debug' => env('APP_DEBUG', false),
/*
|--------------------------------------------------------------------------
| Application URL
|--------------------------------------------------------------------------
|
| This URL is used by the console to properly generate URLs when using
| the Artisan command line tool. You should set this to the root of
| your application so that it is used when running Artisan tasks.
|
*/
'url' => env('APP_URL', 'http://localhost'),
'asset_url' => env('ASSET_URL', null),
/*
|--------------------------------------------------------------------------
| Application Timezone
|--------------------------------------------------------------------------
|
| Here you may specify the default timezone for your application, which
| will be used by the PHP date and date-time functions. We have gone
| ahead and set this to a sensible default for you out of the box.
|
*/
'timezone' => 'UTC',
/*
|--------------------------------------------------------------------------
| Application Locale Configuration
|--------------------------------------------------------------------------
|
| The application locale determines the default locale that will be used
| by the translation service provider. You are free to set this value
| to any of the locales which will be supported by the application.
|
*/
'locale' => 'en',
/*
|--------------------------------------------------------------------------
| Application Fallback Locale
|--------------------------------------------------------------------------
|
| The fallback locale determines the locale to use when the current one
| is not available. You may change the value to correspond to any of
| the language folders that are provided through your application.
|
*/
'fallback_locale' => 'en',
/*
|--------------------------------------------------------------------------
| Faker Locale
|--------------------------------------------------------------------------
|
| This locale will be used by the Faker PHP library when generating fake
| data for your database seeds. For example, this will be used to get
| localized telephone numbers, street address information and more.
|
*/
'faker_locale' => 'en_US',
/*
|--------------------------------------------------------------------------
| Encryption Key
|--------------------------------------------------------------------------
|
| This key is used by the Illuminate encrypter service and should be set
| to a random, 32 character string, otherwise these encrypted strings
| will not be safe. Please do this before deploying an application!
|
*/
'key' => env('APP_KEY'),
'cipher' => 'AES-256-CBC',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
|--------------------------------------------------------------------------
|
| The service providers listed here will be automatically loaded on the
| request to your application. Feel free to add your own services to
| this array to grant expanded functionality to your applications.
|
*/
'providers' => [
/*
* Laravel Framework Service Providers...
*/
Illuminate\Auth\AuthServiceProvider::class,
Illuminate\Broadcasting\BroadcastServiceProvider::class,
Illuminate\Bus\BusServiceProvider::class,
Illuminate\Cache\CacheServiceProvider::class,
Illuminate\Foundation\Providers\ConsoleSupportServiceProvider::class,
Illuminate\Cookie\CookieServiceProvider::class,
Illuminate\Database\DatabaseServiceProvider::class,
Illuminate\Encryption\EncryptionServiceProvider::class,
Illuminate\Filesystem\FilesystemServiceProvider::class,
Illuminate\Foundation\Providers\FoundationServiceProvider::class,
Illuminate\Hashing\HashServiceProvider::class,
Illuminate\Mail\MailServiceProvider::class,
Illuminate\Notifications\NotificationServiceProvider::class,
Illuminate\Pagination\PaginationServiceProvider::class,
Illuminate\Pipeline\PipelineServiceProvider::class,
Illuminate\Queue\QueueServiceProvider::class,
Illuminate\Redis\RedisServiceProvider::class,
Illuminate\Auth\Passwords\PasswordResetServiceProvider::class,
Illuminate\Session\SessionServiceProvider::class,
Illuminate\Translation\TranslationServiceProvider::class,
Illuminate\Validation\ValidationServiceProvider::class,
Illuminate\View\ViewServiceProvider::class,
/*
* Package Service Providers...
*/
/*
* Application Service Providers...
*/
App\Providers\AppServiceProvider::class,
App\Providers\AuthServiceProvider::class,
// App\Providers\BroadcastServiceProvider::class,
App\Providers\EventServiceProvider::class,
App\Providers\RouteServiceProvider::class,
],
/*
|--------------------------------------------------------------------------
| Class Aliases
|--------------------------------------------------------------------------
|
| This array of class aliases will be registered when this application
| is started. However, feel free to register as many as you wish as
| the aliases are "lazy" loaded so they don't hinder performance.
|
*/
'aliases' => [
'App' => Illuminate\Support\Facades\App::class,
'Arr' => Illuminate\Support\Arr::class,
'Artisan' => Illuminate\Support\Facades\Artisan::class,
'Auth' => Illuminate\Support\Facades\Auth::class,
'Blade' => Illuminate\Support\Facades\Blade::class,
'Broadcast' => Illuminate\Support\Facades\Broadcast::class,
'Bus' => Illuminate\Support\Facades\Bus::class,
'Cache' => Illuminate\Support\Facades\Cache::class,
'Config' => Illuminate\Support\Facades\Config::class,
'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class,
'Gate' => Illuminate\Support\Facades\Gate::class,
'Hash' => Illuminate\Support\Facades\Hash::class,
'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class,
'Notification' => Illuminate\Support\Facades\Notification::class,
'Password' => Illuminate\Support\Facades\Password::class,
'Queue' => Illuminate\Support\Facades\Queue::class,
'Redirect' => Illuminate\Support\Facades\Redirect::class,
'Redis' => Illuminate\Support\Facades\Redis::class,
'Request' => Illuminate\Support\Facades\Request::class,
'Response' => Illuminate\Support\Facades\Response::class,
'Route' => Illuminate\Support\Facades\Route::class,
'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class,
'Str' => Illuminate\Support\Str::class,
'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class,
],
];
================================================
FILE: config/auth.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Authentication Defaults
|--------------------------------------------------------------------------
|
| This option controls the default authentication "guard" and password
| reset options for your application. You may change these defaults
| as required, but they're a perfect start for most applications.
|
*/
'defaults' => [
'guard' => 'web',
'passwords' => 'users',
],
/*
|--------------------------------------------------------------------------
| Authentication Guards
|--------------------------------------------------------------------------
|
| Next, you may define every authentication guard for your application.
| Of course, a great default configuration has been defined for you
| here which uses session storage and the Eloquent user provider.
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| Supported: "session", "token"
|
*/
'guards' => [
'web' => [
'driver' => 'session',
'provider' => 'users',
],
'api' => [
'driver' => 'token',
'provider' => 'users',
'hash' => false,
],
],
/*
|--------------------------------------------------------------------------
| User Providers
|--------------------------------------------------------------------------
|
| All authentication drivers have a user provider. This defines how the
| users are actually retrieved out of your database or other storage
| mechanisms used by this application to persist your user's data.
|
| If you have multiple user tables or models you may configure multiple
| sources which represent each model / table. These sources may then
| be assigned to any extra authentication guards you have defined.
|
| Supported: "database", "eloquent"
|
*/
'providers' => [
'users' => [
'driver' => 'eloquent',
'model' => App\User::class,
],
// 'users' => [
// 'driver' => 'database',
// 'table' => 'users',
// ],
],
/*
|--------------------------------------------------------------------------
| Resetting Passwords
|--------------------------------------------------------------------------
|
| You may specify multiple password reset configurations if you have more
| than one user table or model in the application and you want to have
| separate password reset settings based on the specific user types.
|
| The expire time is the number of minutes that the reset token should be
| considered valid. This security feature keeps tokens short-lived so
| they have less time to be guessed. You may change this as needed.
|
*/
'passwords' => [
'users' => [
'provider' => 'users',
'table' => 'password_resets',
'expire' => 60,
'throttle' => 60,
],
],
/*
|--------------------------------------------------------------------------
| Password Confirmation Timeout
|--------------------------------------------------------------------------
|
| Here you may define the amount of seconds before a password confirmation
| times out and the user is prompted to re-enter their password via the
| confirmation screen. By default, the timeout lasts for three hours.
|
*/
'password_timeout' => 10800,
];
================================================
FILE: config/broadcasting.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Broadcaster
|--------------------------------------------------------------------------
|
| This option controls the default broadcaster that will be used by the
| framework when an event needs to be broadcast. You may set this to
| any of the connections defined in the "connections" array below.
|
| Supported: "pusher", "redis", "log", "null"
|
*/
'default' => env('BROADCAST_DRIVER', 'null'),
/*
|--------------------------------------------------------------------------
| Broadcast Connections
|--------------------------------------------------------------------------
|
| Here you may define all of the broadcast connections that will be used
| to broadcast events to other systems or over websockets. Samples of
| each available type of connection are provided inside this array.
|
*/
'connections' => [
'pusher' => [
'driver' => 'pusher',
'key' => env('PUSHER_APP_KEY'),
'secret' => env('PUSHER_APP_SECRET'),
'app_id' => env('PUSHER_APP_ID'),
'options' => [
'cluster' => env('PUSHER_APP_CLUSTER'),
'useTLS' => true,
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
],
'log' => [
'driver' => 'log',
],
'null' => [
'driver' => 'null',
],
],
];
================================================
FILE: config/cache.php
================================================
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Cache Store
|--------------------------------------------------------------------------
|
| This option controls the default cache connection that gets used while
| using this caching library. This connection is used when another is
| not explicitly specified when executing a given caching function.
|
| Supported: "apc", "array", "database", "file",
| "memcached", "redis", "dynamodb"
|
*/
'default' => env('CACHE_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
| Cache Stores
|--------------------------------------------------------------------------
|
| Here you may define all of the cache "stores" for your application as
| well as their drivers. You may even define multiple stores for the
| same cache driver to group types of items stored in your caches.
|
*/
'stores' => [
'apc' => [
'driver' => 'apc',
],
'array' => [
'driver' => 'array',
],
'database' => [
'driver' => 'database',
'table' => 'cache',
'connection' => null,
],
'file' => [
'driver' => 'file',
'path' => storage_path('framework/cache/data'),
],
'memcached' => [
'driver' => 'memcached',
'persistent_id' => env('MEMCACHED_PERSISTENT_ID'),
'sasl' => [
env('MEMCACHED_USERNAME'),
env('MEMCACHED_PASSWORD'),
],
'options' => [
// Memcached::OPT_CONNECT_TIMEOUT => 2000,
],
'servers' => [
[
'host' => env('MEMCACHED_HOST', '127.0.0.1'),
'port' => env('MEMCACHED_PORT', 11211),
'weight' => 100,
],
],
],
'redis' => [
'driver' => 'redis',
'connection' => 'cache',
],
'dynamodb' => [
'driver' => 'dynamodb',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
'table' => env('DYNAMODB_CACHE_TABLE', 'cache'),
'endpoint' => env('DYNAMODB_ENDPOINT'),
],
],
/*
|--------------------------------------------------------------------------
| Cache Key Prefix
|--------------------------------------------------------------------------
|
| When utilizing a RAM based store such as APC or Memcached, there might
| be other applications utilizing the same cache. So, we'll specify a
| value to get prefixed to all our keys so we can avoid collisions.
|
*/
'prefix' => env('CACHE_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_cache'),
];
================================================
FILE: config/database.php
================================================
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Database Connection Name
|--------------------------------------------------------------------------
|
| Here you may specify which of the database connections below you wish
| to use as your default connection for all database work. Of course
| you may use many connections at once using the Database library.
|
*/
'default' => env('DB_CONNECTION', 'mysql'),
/*
|--------------------------------------------------------------------------
| Database Connections
|--------------------------------------------------------------------------
|
| Here are each of the database connections setup for your application.
| Of course, examples of configuring each database platform that is
| supported by Laravel is shown below to make development simple.
|
|
| All database work in Laravel is done through the PHP PDO facilities
| so make sure you have the driver for your particular database of
| choice installed on your machine before you begin development.
|
*/
'connections' => [
'sqlite' => [
'driver' => 'sqlite',
'url' => env('DATABASE_URL'),
'database' => env('DB_DATABASE', database_path('database.sqlite')),
'prefix' => '',
'foreign_key_constraints' => env('DB_FOREIGN_KEYS', true),
],
'mysql' => [
'driver' => 'mysql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci',
'prefix' => '',
'prefix_indexes' => true,
'strict' => true,
'engine' => null,
'options' => extension_loaded('pdo_mysql') ? array_filter([
PDO::MYSQL_ATTR_SSL_CA => env('MYSQL_ATTR_SSL_CA'),
]) : [],
],
'pgsql' => [
'driver' => 'pgsql',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '5432'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
'schema' => 'public',
'sslmode' => 'prefer',
],
'sqlsrv' => [
'driver' => 'sqlsrv',
'url' => env('DATABASE_URL'),
'host' => env('DB_HOST', 'localhost'),
'port' => env('DB_PORT', '1433'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'prefix_indexes' => true,
],
],
/*
|--------------------------------------------------------------------------
| Migration Repository Table
|--------------------------------------------------------------------------
|
| This table keeps track of all the migrations that have already run for
| your application. Using this information, we can determine which of
| the migrations on disk haven't actually been run in the database.
|
*/
'migrations' => 'migrations',
/*
|--------------------------------------------------------------------------
| Redis Databases
|--------------------------------------------------------------------------
|
| Redis is an open source, fast, and advanced key-value store that also
| provides a richer body of commands than a typical key-value system
| such as APC or Memcached. Laravel makes it easy to dig right in.
|
*/
'redis' => [
'client' => env('REDIS_CLIENT', 'phpredis'),
'options' => [
'cluster' => env('REDIS_CLUSTER', 'redis'),
'prefix' => env('REDIS_PREFIX', Str::slug(env('APP_NAME', 'laravel'), '_').'_database_'),
],
'default' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_DB', 0),
],
'cache' => [
'url' => env('REDIS_URL'),
'host' => env('REDIS_HOST', '127.0.0.1'),
'password' => env('REDIS_PASSWORD', null),
'port' => env('REDIS_PORT', 6379),
'database' => env('REDIS_CACHE_DB', 1),
],
],
];
================================================
FILE: config/filesystems.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Filesystem Disk
|--------------------------------------------------------------------------
|
| Here you may specify the default filesystem disk that should be used
| by the framework. The "local" disk, as well as a variety of cloud
| based disks are available to your application. Just store away!
|
*/
'default' => env('FILESYSTEM_DRIVER', 'local'),
/*
|--------------------------------------------------------------------------
| Default Cloud Filesystem Disk
|--------------------------------------------------------------------------
|
| Many applications store files both locally and in the cloud. For this
| reason, you may specify a default "cloud" driver here. This driver
| will be bound as the Cloud disk implementation in the container.
|
*/
'cloud' => env('FILESYSTEM_CLOUD', 's3'),
/*
|--------------------------------------------------------------------------
| Filesystem Disks
|--------------------------------------------------------------------------
|
| Here you may configure as many filesystem "disks" as you wish, and you
| may even configure multiple disks of the same driver. Defaults have
| been setup for each driver as an example of the required options.
|
| Supported Drivers: "local", "ftp", "sftp", "s3"
|
*/
'disks' => [
'local' => [
'driver' => 'local',
'root' => storage_path('app'),
],
'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL').'/storage',
'visibility' => 'public',
],
's3' => [
'driver' => 's3',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION'),
'bucket' => env('AWS_BUCKET'),
'url' => env('AWS_URL'),
],
],
];
================================================
FILE: config/hashing.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Hash Driver
|--------------------------------------------------------------------------
|
| This option controls the default hash driver that will be used to hash
| passwords for your application. By default, the bcrypt algorithm is
| used; however, you remain free to modify this option if you wish.
|
| Supported: "bcrypt", "argon", "argon2id"
|
*/
'driver' => 'bcrypt',
/*
|--------------------------------------------------------------------------
| Bcrypt Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Bcrypt algorithm. This will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'bcrypt' => [
'rounds' => env('BCRYPT_ROUNDS', 10),
],
/*
|--------------------------------------------------------------------------
| Argon Options
|--------------------------------------------------------------------------
|
| Here you may specify the configuration options that should be used when
| passwords are hashed using the Argon algorithm. These will allow you
| to control the amount of time it takes to hash the given password.
|
*/
'argon' => [
'memory' => 1024,
'threads' => 2,
'time' => 2,
],
];
================================================
FILE: config/logging.php
================================================
<?php
use Monolog\Handler\NullHandler;
use Monolog\Handler\StreamHandler;
use Monolog\Handler\SyslogUdpHandler;
return [
/*
|--------------------------------------------------------------------------
| Default Log Channel
|--------------------------------------------------------------------------
|
| This option defines the default log channel that gets used when writing
| messages to the logs. The name specified in this option should match
| one of the channels defined in the "channels" configuration array.
|
*/
'default' => env('LOG_CHANNEL', 'stack'),
/*
|--------------------------------------------------------------------------
| Log Channels
|--------------------------------------------------------------------------
|
| Here you may configure the log channels for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Drivers: "single", "daily", "slack", "syslog",
| "errorlog", "monolog",
| "custom", "stack"
|
*/
'channels' => [
'stack' => [
'driver' => 'stack',
'channels' => ['single'],
'ignore_exceptions' => false,
],
'single' => [
'driver' => 'single',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
],
'daily' => [
'driver' => 'daily',
'path' => storage_path('logs/laravel.log'),
'level' => 'debug',
'days' => 14,
],
'slack' => [
'driver' => 'slack',
'url' => env('LOG_SLACK_WEBHOOK_URL'),
'username' => 'Laravel Log',
'emoji' => ':boom:',
'level' => 'critical',
],
'papertrail' => [
'driver' => 'monolog',
'level' => 'debug',
'handler' => SyslogUdpHandler::class,
'handler_with' => [
'host' => env('PAPERTRAIL_URL'),
'port' => env('PAPERTRAIL_PORT'),
],
],
'stderr' => [
'driver' => 'monolog',
'handler' => StreamHandler::class,
'formatter' => env('LOG_STDERR_FORMATTER'),
'with' => [
'stream' => 'php://stderr',
],
],
'syslog' => [
'driver' => 'syslog',
'level' => 'debug',
],
'errorlog' => [
'driver' => 'errorlog',
'level' => 'debug',
],
'null' => [
'driver' => 'monolog',
'handler' => NullHandler::class,
],
'emergency' => [
'path' => storage_path('logs/laravel.log'),
],
],
];
================================================
FILE: config/mail.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Mail Driver
|--------------------------------------------------------------------------
|
| Laravel supports both SMTP and PHP's "mail" function as drivers for the
| sending of e-mail. You may specify which one you're using throughout
| your application here. By default, Laravel is setup for SMTP mail.
|
| Supported: "smtp", "sendmail", "mailgun", "ses",
| "postmark", "log", "array"
|
*/
'driver' => env('MAIL_DRIVER', 'smtp'),
/*
|--------------------------------------------------------------------------
| SMTP Host Address
|--------------------------------------------------------------------------
|
| Here you may provide the host address of the SMTP server used by your
| applications. A default option is provided that is compatible with
| the Mailgun mail service which will provide reliable deliveries.
|
*/
'host' => env('MAIL_HOST', 'smtp.mailgun.org'),
/*
|--------------------------------------------------------------------------
| SMTP Host Port
|--------------------------------------------------------------------------
|
| This is the SMTP port used by your application to deliver e-mails to
| users of the application. Like the host we have set this value to
| stay compatible with the Mailgun e-mail application by default.
|
*/
'port' => env('MAIL_PORT', 587),
/*
|--------------------------------------------------------------------------
| Global "From" Address
|--------------------------------------------------------------------------
|
| You may wish for all e-mails sent by your application to be sent from
| the same address. Here, you may specify a name and address that is
| used globally for all e-mails that are sent by your application.
|
*/
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'hello@example.com'),
'name' => env('MAIL_FROM_NAME', 'Example'),
],
/*
|--------------------------------------------------------------------------
| E-Mail Encryption Protocol
|--------------------------------------------------------------------------
|
| Here you may specify the encryption protocol that should be used when
| the application send e-mail messages. A sensible default using the
| transport layer security protocol should provide great security.
|
*/
'encryption' => env('MAIL_ENCRYPTION', 'tls'),
/*
|--------------------------------------------------------------------------
| SMTP Server Username
|--------------------------------------------------------------------------
|
| If your SMTP server requires a username for authentication, you should
| set it here. This will get used to authenticate with your server on
| connection. You may also set the "password" value below this one.
|
*/
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
/*
|--------------------------------------------------------------------------
| Sendmail System Path
|--------------------------------------------------------------------------
|
| When using the "sendmail" driver to send e-mails, we will need to know
| the path to where Sendmail lives on this server. A default path has
| been provided here, which will work well on most of your systems.
|
*/
'sendmail' => '/usr/sbin/sendmail -bs',
/*
|--------------------------------------------------------------------------
| Markdown Mail Settings
|--------------------------------------------------------------------------
|
| If you are using Markdown based email rendering, you may configure your
| theme and component paths here, allowing you to customize the design
| of the emails. Or, you may simply stick with the Laravel defaults!
|
*/
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
/*
|--------------------------------------------------------------------------
| Log Channel
|--------------------------------------------------------------------------
|
| If you are using the "log" driver, you may specify the logging channel
| if you prefer to keep mail messages separate from other log entries
| for simpler reading. Otherwise, the default channel will be used.
|
*/
'log_channel' => env('MAIL_LOG_CHANNEL'),
];
================================================
FILE: config/queue.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Default Queue Connection Name
|--------------------------------------------------------------------------
|
| Laravel's queue API supports an assortment of back-ends via a single
| API, giving you convenient access to each back-end using the same
| syntax for every one. Here you may define a default connection.
|
*/
'default' => env('QUEUE_CONNECTION', 'sync'),
/*
|--------------------------------------------------------------------------
| Queue Connections
|--------------------------------------------------------------------------
|
| Here you may configure the connection information for each server that
| is used by your application. A default configuration has been added
| for each back-end shipped with Laravel. You are free to add more.
|
| Drivers: "sync", "database", "beanstalkd", "sqs", "redis", "null"
|
*/
'connections' => [
'sync' => [
'driver' => 'sync',
],
'database' => [
'driver' => 'database',
'table' => 'jobs',
'queue' => 'default',
'retry_after' => 90,
],
'beanstalkd' => [
'driver' => 'beanstalkd',
'host' => 'localhost',
'queue' => 'default',
'retry_after' => 90,
'block_for' => 0,
],
'sqs' => [
'driver' => 'sqs',
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'prefix' => env('SQS_PREFIX', 'https://sqs.us-east-1.amazonaws.com/your-account-id'),
'queue' => env('SQS_QUEUE', 'your-queue-name'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
'redis' => [
'driver' => 'redis',
'connection' => 'default',
'queue' => env('REDIS_QUEUE', 'default'),
'retry_after' => 90,
'block_for' => null,
],
],
/*
|--------------------------------------------------------------------------
| Failed Queue Jobs
|--------------------------------------------------------------------------
|
| These options configure the behavior of failed queue job logging so you
| can control which database and table are used to store the jobs that
| have failed. You may change them to any database / table you wish.
|
*/
'failed' => [
'driver' => env('QUEUE_FAILED_DRIVER', 'database'),
'database' => env('DB_CONNECTION', 'mysql'),
'table' => 'failed_jobs',
],
];
================================================
FILE: config/sentry.php
================================================
<?php
return [
'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),
// capture release as git sha
// 'release' => trim(exec('git --git-dir ' . base_path('.git') . ' log --pretty="%h" -n1 HEAD')),
'breadcrumbs' => [
// Capture Laravel logs in breadcrumbs
'logs' => true,
// Capture SQL queries in breadcrumbs
'sql_queries' => true,
// Capture bindings on SQL queries logged in breadcrumbs
'sql_bindings' => true,
// Capture queue job information in breadcrumbs
'queue_info' => true,
],
];
================================================
FILE: config/services.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Mailgun, Postmark, AWS and more. This file provides the de facto
| location for this type of information, allowing packages to have
| a conventional file to locate the various service credentials.
|
*/
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
'endpoint' => env('MAILGUN_ENDPOINT', 'api.mailgun.net'),
],
'postmark' => [
'token' => env('POSTMARK_TOKEN'),
],
'ses' => [
'key' => env('AWS_ACCESS_KEY_ID'),
'secret' => env('AWS_SECRET_ACCESS_KEY'),
'region' => env('AWS_DEFAULT_REGION', 'us-east-1'),
],
];
================================================
FILE: config/session.php
================================================
<?php
use Illuminate\Support\Str;
return [
/*
|--------------------------------------------------------------------------
| Default Session Driver
|--------------------------------------------------------------------------
|
| This option controls the default session "driver" that will be used on
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "dynamodb", "array"
|
*/
'driver' => env('SESSION_DRIVER', 'cookie'),
/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/
'lifetime' => env('SESSION_LIFETIME', 120),
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
|--------------------------------------------------------------------------
|
| When using the native session driver, we need a location where session
| files may be stored. A default has been set for you but a different
| location may be specified. This is only needed for file sessions.
|
*/
'files' => storage_path('framework/sessions'),
/*
|--------------------------------------------------------------------------
| Session Database Connection
|--------------------------------------------------------------------------
|
| When using the "database" or "redis" session drivers, you may specify a
| connection that should be used to manage these sessions. This should
| correspond to a connection in your database configuration options.
|
*/
'connection' => env('SESSION_CONNECTION', null),
/*
|--------------------------------------------------------------------------
| Session Database Table
|--------------------------------------------------------------------------
|
| When using the "database" session driver, you may specify the table we
| should use to manage the sessions. Of course, a sensible default is
| provided for you; however, you are free to change this as needed.
|
*/
'table' => 'sessions',
/*
|--------------------------------------------------------------------------
| Session Cache Store
|--------------------------------------------------------------------------
|
| When using the "apc", "memcached", or "dynamodb" session drivers you may
| list a cache store that should be used for these sessions. This value
| must match with one of the application's configured cache "stores".
|
*/
'store' => env('SESSION_STORE', null),
/*
|--------------------------------------------------------------------------
| Session Sweeping Lottery
|--------------------------------------------------------------------------
|
| Some session drivers must manually sweep their storage location to get
| rid of old sessions from storage. Here are the chances that it will
| happen on a given request. By default, the odds are 2 out of 100.
|
*/
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
| Session Cookie Name
|--------------------------------------------------------------------------
|
| Here you may change the name of the cookie used to identify a session
| instance by ID. The name specified here will get used every time a
| new session cookie is created by the framework for every driver.
|
*/
'cookie' => env(
'SESSION_COOKIE',
Str::slug(env('APP_NAME', 'laravel'), '_').'_session'
),
/*
|--------------------------------------------------------------------------
| Session Cookie Path
|--------------------------------------------------------------------------
|
| The session cookie path determines the path for which the cookie will
| be regarded as available. Typically, this will be the root path of
| your application but you are free to change this when necessary.
|
*/
'path' => '/',
/*
|--------------------------------------------------------------------------
| Session Cookie Domain
|--------------------------------------------------------------------------
|
| Here you may change the domain of the cookie used to identify a session
| in your application. This will determine which domains the cookie is
| available to in your application. A sensible default has been set.
|
*/
'domain' => env('SESSION_DOMAIN', null),
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => env('SESSION_SECURE_COOKIE', null),
/*
|--------------------------------------------------------------------------
| HTTP Access Only
|--------------------------------------------------------------------------
|
| Setting this value to true will prevent JavaScript from accessing the
| value of the cookie and the cookie will only be accessible through
| the HTTP protocol. You are free to modify this option if needed.
|
*/
'http_only' => true,
/*
|--------------------------------------------------------------------------
| Same-Site Cookies
|--------------------------------------------------------------------------
|
| This option determines how your cookies behave when cross-site requests
| take place, and can be used to mitigate CSRF attacks. By default, we
| do not enable this as other CSRF protection services are in place.
|
| Supported: "lax", "strict", "none"
|
*/
'same_site' => null,
];
================================================
FILE: config/view.php
================================================
<?php
return [
/*
|--------------------------------------------------------------------------
| View Storage Paths
|--------------------------------------------------------------------------
|
| Most templating systems load templates from disk. Here you may specify
| an array of paths that should be checked for your views. Of course
| the usual Laravel view path has already been registered for you.
|
*/
'paths' => [
resource_path('views'),
],
/*
|--------------------------------------------------------------------------
| Compiled View Path
|--------------------------------------------------------------------------
|
| This option determines where all the compiled Blade templates will be
| stored for your application. Typically, this is within the storage
| directory. However, as usual, you are free to change this value.
|
*/
'compiled' => env(
'VIEW_COMPILED_PATH',
realpath(storage_path('framework/views'))
),
];
================================================
FILE: database/.gitignore
================================================
*.sqlite
================================================
FILE: database/factories/ContactFactory.php
================================================
<?php
use Faker\Generator as Faker;
$factory->define(App\Contact::class, function (Faker $faker) {
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'email' => $faker->unique()->safeEmail,
'phone' => $faker->tollFreePhoneNumber,
'address' => $faker->streetAddress,
'city' => $faker->city,
'region' => $faker->state,
'country' => 'US',
'postal_code' => $faker->postcode,
];
});
================================================
FILE: database/factories/OrganizationFactory.php
================================================
<?php
use Faker\Generator as Faker;
$factory->define(App\Organization::class, function (Faker $faker) {
return [
'name' => $faker->company,
'email' => $faker->companyEmail,
'phone' => $faker->tollFreePhoneNumber,
'address' => $faker->streetAddress,
'city' => $faker->city,
'region' => $faker->state,
'country' => 'US',
'postal_code' => $faker->postcode,
];
});
================================================
FILE: database/factories/UserFactory.php
================================================
<?php
use Faker\Generator as Faker;
use Illuminate\Support\Str;
/*
|--------------------------------------------------------------------------
| Model Factories
|--------------------------------------------------------------------------
|
| This directory should contain each of the model factory definitions for
| your application. Factories provide a convenient way to generate new
| model instances for testing / seeding your application's database.
|
*/
$factory->define(App\User::class, function (Faker $faker) {
return [
'first_name' => $faker->firstName,
'last_name' => $faker->lastName,
'email' => $faker->unique()->safeEmail,
'password' => 'secret',
'remember_token' => Str::random(10),
'owner' => false,
];
});
================================================
FILE: database/migrations/2019_03_05_000000_create_accounts_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateAccountsTable extends Migration
{
public function up()
{
Schema::create('accounts', function (Blueprint $table) {
$table->increments('id');
$table->string('name', 50);
$table->timestamps();
});
}
}
================================================
FILE: database/migrations/2019_03_05_000000_create_contacts_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateContactsTable extends Migration
{
public function up()
{
Schema::create('contacts', function (Blueprint $table) {
$table->increments('id');
$table->integer('account_id')->index();
$table->integer('organization_id')->nullable()->index();
$table->string('first_name', 25);
$table->string('last_name', 25);
$table->string('email', 50)->nullable();
$table->string('phone', 50)->nullable();
$table->string('address', 150)->nullable();
$table->string('city', 50)->nullable();
$table->string('region', 50)->nullable();
$table->string('country', 2)->nullable();
$table->string('postal_code', 25)->nullable();
$table->timestamps();
$table->softDeletes();
});
}
}
================================================
FILE: database/migrations/2019_03_05_000000_create_organizations_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateOrganizationsTable extends Migration
{
public function up()
{
Schema::create('organizations', function (Blueprint $table) {
$table->increments('id');
$table->integer('account_id')->index();
$table->string('name', 100);
$table->string('email', 50)->nullable();
$table->string('phone', 50)->nullable();
$table->string('address', 150)->nullable();
$table->string('city', 50)->nullable();
$table->string('region', 50)->nullable();
$table->string('country', 2)->nullable();
$table->string('postal_code', 25)->nullable();
$table->timestamps();
$table->softDeletes();
});
}
}
================================================
FILE: database/migrations/2019_03_05_000000_create_password_resets_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration
{
public function up()
{
Schema::create('password_resets', function (Blueprint $table) {
$table->string('email')->index();
$table->string('token');
$table->timestamp('created_at')->nullable();
});
}
}
================================================
FILE: database/migrations/2019_03_05_000000_create_users_table.php
================================================
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->integer('account_id')->index();
$table->string('first_name', 25);
$table->string('last_name', 25);
$table->string('email', 50)->unique();
$table->string('password')->nullable();
$table->boolean('owner')->default(false);
$table->string('photo_path', 100)->nullable();
$table->rememberToken();
$table->timestamps();
$table->softDeletes();
});
}
}
================================================
FILE: database/seeds/DatabaseSeeder.php
================================================
<?php
use App\User;
use App\Account;
use App\Contact;
use App\Organization;
use Illuminate\Database\Seeder;
class DatabaseSeeder extends Seeder
{
public function run()
{
$account = Account::create(['name' => 'Acme Corporation']);
factory(User::class)->create([
'account_id' => $account->id,
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'johndoe@example.com',
'owner' => true,
]);
factory(User::class, 5)->create(['account_id' => $account->id]);
$organizations = factory(Organization::class, 100)
->create(['account_id' => $account->id]);
factory(Contact::class, 100)
->create(['account_id' => $account->id])
->each(function ($contact) use ($organizations) {
$contact->update(['organization_id' => $organizations->random()->id]);
});
}
}
================================================
FILE: jsconfig.json
================================================
{
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@/*": ["./resources/js/*"]
}
}
}
================================================
FILE: package.json
================================================
{
"private": true,
"scripts": {
"dev": "npm run development",
"development": "cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js",
"watch": "npm run development -- --watch",
"watch-poll": "npm run watch -- --watch-poll",
"hot": "cross-env NODE_ENV=development node_modules/webpack-dev-server/bin/webpack-dev-server.js --inline --hot --config=node_modules/laravel-mix/setup/webpack.config.js",
"prod": "npm run production",
"production": "cross-env NODE_ENV=production node_modules/webpack/bin/webpack.js --no-progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js"
},
"dependencies": {
"@fullhuman/postcss-purgecss": "^1.3.0",
"@inertiajs/inertia": "^0.1.7",
"@inertiajs/inertia-svelte": "^0.1.0",
"@sentry/browser": "^5.15.0",
"axios": "^0.19.2",
"classnames": "^2.2.6",
"cross-env": "^6.0.3",
"eslint": "^6.8.0",
"laravel-mix": "^5.0.4",
"laravel-mix-svelte": "^0.1.3",
"lodash": "^4.17.15",
"postcss-import": "^12.0.1",
"postcss-nesting": "^7.0.1",
"resolve-url-loader": "^3.1.1",
"tailwindcss": "^1.2.0"
},
"devDependencies": {
"babel-eslint": "^10.1.0",
"eslint-plugin-svelte3": "^2.7.3",
"svelte": "^3.20.1",
"svelte-loader": "^2.13.6",
"vue-template-compiler": "^2.6.11"
}
}
================================================
FILE: phpunit.xml
================================================
<?xml version="1.0" encoding="UTF-8"?>
<phpunit backupGlobals="false"
backupStaticAttributes="false"
bootstrap="vendor/autoload.php"
colors="true"
convertErrorsToExceptions="true"
convertNoticesToExceptions="true"
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false">
<testsuites>
<testsuite name="Unit">
<directory suffix="Test.php">./tests/Unit</directory>
</testsuite>
<testsuite name="Feature">
<directory suffix="Test.php">./tests/Feature</directory>
</testsuite>
</testsuites>
<filter>
<whitelist processUncoveredFilesFromWhitelist="true">
<directory suffix=".php">./app</directory>
</whitelist>
</filter>
<php>
<server name="APP_ENV" value="testing"/>
<server name="BCRYPT_ROUNDS" value="4"/>
<server name="CACHE_DRIVER" value="array"/>
<server name="MAIL_DRIVER" value="array"/>
<server name="QUEUE_CONNECTION" value="sync"/>
<server name="SESSION_DRIVER" value="array"/>
<server name="DB_CONNECTION" value="sqlite"/>
<server name="DB_DATABASE" value=":memory:"/>
</php>
</phpunit>
================================================
FILE: public/.htaccess
================================================
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews -Indexes
</IfModule>
RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
================================================
FILE: public/index.php
================================================
<?php
/**
* Laravel - A PHP Framework For Web Artisans
*
* @package Laravel
* @author Taylor Otwell <taylor@laravel.com>
*/
define('LARAVEL_START', microtime(true));
/*
|--------------------------------------------------------------------------
| Register The Auto Loader
|--------------------------------------------------------------------------
|
| Composer provides a convenient, automatically generated class loader for
| our application. We just need to utilize it! We'll simply require it
| into the script here so that we don't have to worry about manual
| loading any of our classes later on. It feels great to relax.
|
*/
require __DIR__.'/../vendor/autoload.php';
/*
|--------------------------------------------------------------------------
| Turn On The Lights
|--------------------------------------------------------------------------
|
| We need to illuminate PHP development, so let us turn on the lights.
| This bootstraps the framework and gets it ready for use, then it
| will load up this application so that we can run it and send
| the responses back to the browser and delight our users.
|
*/
$app = require_once __DIR__.'/../bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Run The Application
|--------------------------------------------------------------------------
|
| Once we have the application, we can handle the incoming request
| through the kernel, and send the associated response back to
| the client's browser allowing them to enjoy the creative
| and wonderful application we have prepared for them.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
================================================
FILE: public/robots.txt
================================================
User-agent: *
Disallow:
================================================
FILE: public/web.config
================================================
<!--
Rewrites requires Microsoft URL Rewrite Module for IIS
Download: https://www.microsoft.com/en-us/download/details.aspx?id=47337
Debug Help: https://docs.microsoft.com/en-us/iis/extensions/url-rewrite-module/using-failed-request-tracing-to-trace-rewrite-rules
-->
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
================================================
FILE: readme.md
================================================
# Ping CRM Svelte
A demo application to illustrate how [Inertia.js](https://inertiajs.com/) works with [Laravel](https://laravel.com/) and [Svelte](https://svelte.dev/).
> This is a port of the original [Ping CRM](https://github.com/inertiajs/pingcrm) written in Laravel and Vue.

## Installation
Clone the repo locally:
```sh
git clone https://github.com/zgabievi/pingcrm-svelte.git
cd pingcrm-svelte
```
Install PHP dependencies:
```sh
composer install
```
Install NPM dependencies:
```sh
npm install
```
Build assets:
```sh
npm run dev
```
Setup configuration:
```sh
cp .env.example .env
```
Generate application key:
```sh
php artisan key:generate
```
Create an SQLite database. You can also use another database (MySQL, Postgres), simply update your configuration accordingly.
```sh
touch database/database.sqlite
```
Run database migrations:
```sh
php artisan migrate
```
Run database seeder:
```sh
php artisan db:seed
```
Run artisan server:
```sh
php artisan serve
```
You're ready to go! [Visit Ping CRM](http://127.0.0.1:8000/) in your browser, and login with:
- **Username:** johndoe@example.com
- **Password:** secret
## Running tests
To run the Ping CRM tests, run:
```
phpunit
```
## Credits
- Original work by Jonathan Reinink (@reinink) and contributors
- Port to Ruby on Rails by Georg Ledermann (@ledermann)
- Port to React by Lado Lomidze (@landish)
- Port to Svelte by Zura Gabievi (@zgabievi)
================================================
FILE: resources/css/app.css
================================================
/* Reset */
@import 'reset';
@import 'tailwindcss/base';
@import 'tailwindcss/components';
/* Components */
@import 'buttons';
@import 'form';
@import 'nprogress';
/* Utilities */
@import 'tailwindcss/utilities';
================================================
FILE: resources/css/buttons.css
================================================
.btn-indigo {
@apply px-6 py-3 rounded bg-indigo-700 text-white text-sm font-bold whitespace-no-wrap;
&:hover,
&:focus {
@apply bg-orange-500;
}
}
.btn-spinner,
.btn-spinner:after {
border-radius: 50%;
width: 1.5em;
height: 1.5em;
}
.btn-spinner {
font-size: 10px;
position: relative;
text-indent: -9999em;
border-top: 0.2em solid white;
border-right: 0.2em solid white;
border-bottom: 0.2em solid white;
border-left: 0.2em solid transparent;
transform: translateZ(0);
animation: spinning 1s infinite linear;
}
@keyframes spinning {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
================================================
FILE: resources/css/form.css
================================================
.form-label {
@apply .mb-2 .block .text-gray-800 .select-none;
}
.form-input,
.form-textarea,
.form-select {
@apply .p-2 .leading-normal .block .w-full .border .text-gray-800 .bg-white .font-sans .rounded .text-left .appearance-none .relative;
&:focus-within,
&:focus,
&.focus {
@apply .border-indigo-500;
box-shadow: 0 0 0 1px theme('colors.indigo.500');
}
&::placeholder {
@apply .text-gray-600 .opacity-100;
}
}
.form-select {
@apply .pr-6;
background-image: url('data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAQCAYAAAAMJL+VAAAABGdBTUEAALGPC/xhBQAAAQtJREFUOBG1lEEOgjAQRalbGj2OG9caOACn4ALGtfEuHACiazceR1PWOH/CNA3aMiTaBDpt/7zPdBKy7M/DCL9pGkvxxVp7KsvyJftL5rZt1865M+Ucq6pyyF3hNcI7Cuu+728QYn/JQA5yKaempxuZmQngOwEaYx55nu+1lQh8GIatMGi+01NwBcEmhxBqK4nAPZJ78K0KKFAJmR3oPp8+Iwgob0Oa6+TLoeCvRx+mTUYf/FVBGTPRwDkfLxnaSrRwcH0FWhNOmrkWYbE2XEicqgSa1J0LQ+aPCuQgZiLnwewbGuz5MGoAhcIkCQcjaTBjMgtXGURMVHC1wcQEy0J+Zlj8bKAnY1/UzDe2dbAVqfXn6wAAAABJRU5ErkJggg==');
background-size: 0.7rem;
background-repeat: no-repeat;
background-position: right 0.7rem center;
&::-ms-expand {
@apply .opacity-0;
}
}
.form-error {
@apply .text-red-500 .mt-2 .text-sm;
}
.form-input.error,
.form-textarea.error,
.form-select.error {
@apply .border-red-400;
&:focus {
box-shadow: 0 0 0 1px theme('colors.red.400');
}
}
================================================
FILE: resources/css/nprogress.css
================================================
/* Make clicks pass-through */
#nprogress {
pointer-events: none;
}
#nprogress .bar {
background: theme('colors.indigo.500');
position: fixed;
z-index: 1031;
top: 0;
left: 0;
width: 100%;
height: 2px;
}
/* Fancy blur effect */
#nprogress .peg {
display: block;
position: absolute;
right: 0px;
width: 100px;
height: 100%;
box-shadow: 0 0 10px theme('colors.indigo.500'),
0 0 5px theme('colors.indigo.500');
opacity: 1;
-webkit-transform: rotate(3deg) translate(0px, -4px);
-ms-transform: rotate(3deg) translate(0px, -4px);
transform: rotate(3deg) translate(0px, -4px);
}
/* Remove these to get rid of the spinner */
#nprogress .spinner {
display: block;
position: fixed;
z-index: 1031;
top: 15px;
right: 15px;
}
#nprogress .spinner-icon {
width: 18px;
height: 18px;
box-sizing: border-box;
border: solid 2px transparent;
border-top-color: theme('colors.indigo.500');
border-left-color: theme('colors.indigo.500');
border-radius: 50%;
-webkit-animation: nprogress-spinner 400ms linear infinite;
animation: nprogress-spinner 400ms linear infinite;
}
.nprogress-custom-parent {
overflow: hidden;
position: relative;
}
.nprogress-custom-parent #nprogress .spinner,
.nprogress-custom-parent #nprogress .bar {
position: absolute;
}
@-webkit-keyframes nprogress-spinner {
0% {
-webkit-transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
}
}
@keyframes nprogress-spinner {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
================================================
FILE: resources/css/reset.css
================================================
html {
line-height: 1.15;
}
input,
select,
textarea,
button,
div,
a {
&:focus,
&:active {
outline: none;
}
}
================================================
FILE: resources/js/Pages/Auth/Login.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import {page} from '@inertiajs/inertia-svelte';
import Logo from '@/Shared/Logo.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import Helmet from '@/Shared/Helmet.svelte';
$: errors = $page.errors;
let sending = false;
let values = {
email: 'johndoe@example.com',
password: 'secret',
remember: true
};
function handleChange(e) {
const key = e.target.name;
const value =
e.target.type === 'checkbox' ? e.target.checked : e.target.value;
values = {
...values,
[key]: value
};
}
function handleSubmit() {
sending = true;
Inertia.post(route('login.attempt'), values).then(() => sending = false);
}
</script>
<Helmet title="Login"/>
<div class="p-6 bg-indigo-900 min-h-screen flex justify-center items-center">
<div class="w-full max-w-md">
<Logo
class="block mx-auto w-full max-w-xs text-white fill-current"
height={50}
/>
<form
on:submit|preventDefault={handleSubmit}
class="mt-8 bg-white rounded-lg shadow-xl overflow-hidden"
>
<div class="px-10 py-12">
<h1 class="text-center font-bold text-3xl">Welcome Back!</h1>
<div class="mx-auto mt-6 w-24 border-b-2"/>
<TextInput
className="mt-10"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="mt-6"
label="Password"
name="password"
type="password"
errors={errors.password}
value={values.password}
onChange={handleChange}
/>
<label
class="mt-6 select-none flex items-center"
for="remember"
>
<input
name="remember"
id="remember"
class="mr-1"
type="checkbox"
checked={values.remember}
on:change={handleChange}
/>
<span class="text-sm">Remember Me</span>
</label>
</div>
<div class="px-10 py-4 bg-gray-100 border-t border-gray-200 flex justify-between items-center">
<a class="hover:underline" tabindex="-1" href="#reset-password">
Forget password?
</a>
<LoadingButton
type="submit"
loading={sending}
className="btn-indigo"
>
Login
</LoadingButton>
</div>
</form>
</div>
</div>
================================================
FILE: resources/js/Pages/Contacts/Create.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Layout from '@/Shared/Layout.svelte';
import Helmet from '@/Shared/Helmet.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import SelectInput from '@/Shared/SelectInput.svelte';
const route = window.route;
$: organizations = $page.organizations;
$: errors = $page.errors;
let sending = false;
let values = {
first_name: '',
last_name: '',
organization_id: '',
email: '',
phone: '',
address: '',
city: '',
region: '',
country: '',
postal_code: ''
};
function handleChange({ target: { name, value } }) {
values = {
...values,
[name]: value
};
}
function handleSubmit() {
sending = true;
Inertia.post(route('contacts.store'), values).then(() => sending = false);
}
</script>
<Helmet title="Create Contact" />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">
<InertiaLink
href={route('contacts')}
class="text-indigo-600 hover:text-indigo-700"
>
Contacts
</InertiaLink>
<span class="text-indigo-600 font-medium"> /</span> Create
</h1>
<div class="bg-white rounded shadow overflow-hidden max-w-3xl">
<form on:submit|preventDefault={handleSubmit}>
<div class="p-8 -mr-6 -mb-8 flex flex-wrap">
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="First Name"
name="first_name"
errors={errors.first_name}
value={values.first_name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Last Name"
name="last_name"
errors={errors.last_name}
value={values.last_name}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Organization"
name="organization_id"
errors={errors.organization_id}
value={values.organization_id}
onChange={handleChange}
>
<option value=""></option>
{#each organizations as {id, name} (id)}
<option value={`${id}`}>{name}</option>
{/each}
<option value="CA">Canada</option>
<option value="US">United States</option>
</SelectInput>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Phone"
name="phone"
type="text"
errors={errors.phone}
value={values.phone}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Address"
name="address"
type="text"
errors={errors.address}
value={values.address}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="City"
name="city"
type="text"
errors={errors.city}
value={values.city}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Province/State"
name="region"
type="text"
errors={errors.region}
value={values.region}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Country"
name="country"
errors={errors.country}
value={values.country}
onChange={handleChange}
>
<option value=""></option>
<option value="CA">Canada</option>
<option value="US">United States</option>
</SelectInput>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Postal Code"
name="postal_code"
type="text"
errors={errors.postal_code}
value={values.postal_code}
onChange={handleChange}
/>
</div>
<div class="px-8 py-4 bg-gray-100 border-t border-gray-200 flex justify-end items-center">
<LoadingButton
loading={sending}
type="submit"
class="btn-indigo"
>
Create Contact
</LoadingButton>
</div>
</form>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Contacts/Edit.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import DeleteButton from '@/Shared/DeleteButton.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import SelectInput from '@/Shared/SelectInput.svelte';
import TrashedMessage from '@/Shared/TrashedMessage.svelte';
const route = window.route;
let { contact } = $page;
$: contact = $page.contact;
$: organizations = $page.organizations;
$: errors = $page.errors;
let sending = false;
let values = {
first_name: contact.first_name || '',
last_name: contact.last_name || '',
organization_id: contact.organization_id || '',
email: contact.email || '',
phone: contact.phone || '',
address: contact.address || '',
city: contact.city || '',
region: contact.region || '',
country: contact.country || '',
postal_code: contact.postal_code || ''
};
function handleChange({ target: { name, value } }) {
values ={
...values,
[name]: value
};
}
function handleSubmit(e) {
sending = true;
Inertia.put(route('contacts.update', contact.id), values).then(() => sending = false);
}
function destroy() {
if (confirm('Are you sure you want to delete this contact?')) {
Inertia.delete(route('contacts.destroy', contact.id));
}
}
function restore() {
if (confirm('Are you sure you want to restore this contact?')) {
Inertia.put(route('contacts.restore', contact.id));
}
}
</script>
<Helmet title={`${values.first_name} ${values.last_name}`} />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">
<InertiaLink
href={route('contacts')}
class="text-indigo-600 hover:text-indigo-700"
>
Contacts
</InertiaLink>
<span class="text-indigo-600 font-medium mx-2">/</span>
{values.first_name} {values.last_name}
</h1>
{#if contact.deleted_at}
<TrashedMessage onRestore={restore}>This contact has been deleted.</TrashedMessage>
{/if}
<div class="bg-white rounded shadow overflow-hidden max-w-3xl">
<form on:submit|preventDefault={handleSubmit}>
<div class="p-8 -mr-6 -mb-8 flex flex-wrap">
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="First Name"
name="first_name"
errors={errors.first_name}
value={values.first_name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Last Name"
name="last_name"
errors={errors.last_name}
value={values.last_name}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Organization"
name="organization_id"
errors={errors.organization_id}
value={values.organization_id}
onChange={handleChange}
>
<option value=""></option>
{#each organizations as { id, name } (id)}
<option value={`${id}`}>{name}</option>
{/each}
<option value="CA">Canada</option>
<option value="US">United States</option>
</SelectInput>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Phone"
name="phone"
type="text"
errors={errors.phone}
value={values.phone}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Address"
name="address"
type="text"
errors={errors.address}
value={values.address}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="City"
name="city"
type="text"
errors={errors.city}
value={values.city}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Province/State"
name="region"
type="text"
errors={errors.region}
value={values.region}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Country"
name="country"
errors={errors.country}
value={values.country}
onChange={handleChange}
>
<option value=""></option>
<option value="CA">Canada</option>
<option value="US">United States</option>
</SelectInput>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Postal Code"
name="postal_code"
type="text"
errors={errors.postal_code}
value={values.postal_code}
onChange={handleChange}
/>
</div>
<div class="px-8 py-4 bg-gray-100 border-t border-gray-200 flex items-center">
{#if !contact.deleted_at}
<DeleteButton onDelete={destroy}>Delete Contact</DeleteButton>
{/if}
<LoadingButton
loading={sending}
type="submit"
className="btn-indigo ml-auto"
>
Update Contact
</LoadingButton>
</div>
</form>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Contacts/Index.svelte
================================================
<script>
import Helmet from '@/Shared/Helmet.svelte';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Layout from '@/Shared/Layout.svelte';
import Icon from '@/Shared/Icon.svelte';
import Pagination from '@/Shared/Pagination.svelte';
import SearchFilter from '@/Shared/SearchFilter.svelte';
const route = window.route;
$: data = $page.contacts.data;
$: links = $page.contacts.links;
</script>
<Helmet title="Contacts" />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">Contacts</h1>
<div class="mb-6 flex justify-between items-center">
<SearchFilter />
<InertiaLink class="btn-indigo" href={route('contacts.create')}>
<span>Create</span>
<span class="hidden md:inline"> Contact</span>
</InertiaLink>
</div>
<div class="bg-white rounded shadow overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
<tr class="text-left font-bold">
<th class="px-6 pt-5 pb-4">Name</th>
<th class="px-6 pt-5 pb-4">Organization</th>
<th class="px-6 pt-5 pb-4">City</th>
<th class="px-6 pt-5 pb-4" colspan="2">Phone</th>
</tr>
</thead>
<tbody>
{#if !data || data.length === 0}
<tr>
<td class="border-t px-6 py-4" colspan="4">
No contacts found.
</td>
</tr>
{:else}
{#each data as { id, name, city, phone, organization, deleted_at } (id)}
<tr class="hover:bg-gray-100 focus-within:bg-gray-100">
<td class="border-t">
<InertiaLink
href={route('contacts.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo-700"
>
{name}
{#if deleted_at}
<Icon
name="trash"
class="flex-shrink-0 w-3 h-3 text-gray-400 fill-current ml-2"
/>
{/if}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="1"
class="px-6 py-4 flex items-center focus:text-indigo"
href={route('contacts.edit', id)}
>
{organization && organization.name}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('contacts.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{city}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('contacts.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{phone}
</InertiaLink>
</td>
<td class="border-t w-px">
<InertiaLink
tabindex="-1"
href={route('contacts.edit', id)}
class="px-4 flex items-center"
>
<Icon
name="cheveron-right"
className="block w-6 h-6 text-gray-400 fill-current"
/>
</InertiaLink>
</td>
</tr>
{/each}
{/if}
</tbody>
</table>
</div>
<Pagination links={links} />
</div>
</Layout>
================================================
FILE: resources/js/Pages/Dashboard/Index.svelte
================================================
<script>
import {InertiaLink} from '@inertiajs/inertia-svelte';
import Layout from '@/Shared/Layout.svelte';
import Helmet from '@/Shared/Helmet.svelte';
</script>
<Helmet title="Dashboard"/>
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">Dashboard</h1>
<p class="mb-12 leading-normal">
Hey there! Welcome to Ping CRM, a demo app designed to help illustrate
how
<a
class="text-indigo-600 underline hover:text-orange-500 mx-1"
href="https://inertiajs.com"
>
Inertia.js
</a>
works with
<a
class="text-indigo-600 underline hover:text-orange-500 ml-1"
href="https://svelte.dev/"
>
Svelte
</a>
.
</p>
<div>
<InertiaLink class="btn-indigo mr-1" href="/500">
500 error
</InertiaLink>
<InertiaLink class="btn-indigo" href="/404">
404 error
</InertiaLink>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Error.svelte
================================================
<script>
import Helmet from '@/Shared/Helmet.svelte';
export let status;
let title = {
503: '503: Service Unavailable',
500: '500: Server Error',
404: '404: Page Not Found',
403: '403: Forbidden'
}[status];
let description = {
503: 'Sorry, we are doing some maintenance. Please check back soon.',
500: 'Whoops, something went wrong on our servers.',
404: 'Sorry, the page you are looking for could not be found.',
403: 'Sorry, you are forbidden from accessing this page.'
}[status];
</script>
<Helmet title={title} />
<div class="p-5 bg-indigo-800 text-indigo-100 min-h-screen flex justify-center items-center">
<div class="w-full max-w-md">
<h1 class="text-3xl">{title}</h1>
<p class="mt-3 text-lg leading-tight">{description}</p>
</div>
</div>
================================================
FILE: resources/js/Pages/Organizations/Create.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import SelectInput from '@/Shared/SelectInput.svelte';
const route = window.route;
$: errors = $page.errors;
let sending = false;
let values = {
name: '',
email: '',
phone: '',
address: '',
city: '',
region: '',
country: '',
postal_code: ''
};
function handleChange({ target: { name, value } }) {
values = {
...values,
[name]: value
};
}
function handleSubmit() {
sending = true;
Inertia.post(route('organizations.store'), values).then(() => sending = false);
}
</script>
<Helmet title="Create Organization" />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">
<InertiaLink
href={route('organizations')}
class="text-indigo-600 hover:text-indigo-700"
>
Organizations
</InertiaLink>
<span class="text-indigo-600 font-medium"> /</span> Create
</h1>
<div class="bg-white rounded shadow overflow-hidden max-w-3xl">
<form on:submit|preventDefault={handleSubmit}>
<div class="p-8 -mr-6 -mb-8 flex flex-wrap">
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Name"
name="name"
errors={errors.name}
value={values.name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Phone"
name="phone"
type="text"
errors={errors.phone}
value={values.phone}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Address"
name="address"
type="text"
errors={errors.address}
value={values.address}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="City"
name="city"
type="text"
errors={errors.city}
value={values.city}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Province/State"
name="region"
type="text"
errors={errors.region}
value={values.region}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Country"
name="country"
errors={errors.country}
value={values.country}
onChange={handleChange}
>
<option value=""></option>
<option value="CA">Canada</option>
<option value="US">United States</option>
</SelectInput>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Postal Code"
name="postal_code"
type="text"
errors={errors.postal_code}
value={values.postal_code}
onChange={handleChange}
/>
</div>
<div class="px-8 py-4 bg-gray-100 border-t border-gray-200 flex justify-end items-center">
<LoadingButton
loading={sending}
type="submit"
className="btn-indigo"
>
Create Organization
</LoadingButton>
</div>
</form>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Organizations/Edit.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import DeleteButton from '@/Shared/DeleteButton.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import SelectInput from '@/Shared/SelectInput.svelte';
import TrashedMessage from '@/Shared/TrashedMessage.svelte';
import Icon from '@/Shared/Icon.svelte';
const route = window.route;
let { organization } = $page;
$: errors = $page.errors;
$: organization = $page.organization;
let sending = false;
let values = {
name: organization.name || '',
email: organization.email || '',
phone: organization.phone || '',
address: organization.address || '',
city: organization.city || '',
region: organization.region || '',
country: organization.country || '',
postal_code: organization.postal_code || ''
};
function handleChange({ target: { name, value } }) {
values = {
...values,
[name]: value
};
}
function handleSubmit() {
sending = true;
Inertia.put(route('organizations.update', organization.id), values).then(() => sending = false);
}
function destroy() {
if (confirm('Are you sure you want to delete this organization?')) {
Inertia.delete(route('organizations.destroy', organization.id));
}
}
function restore() {
if (confirm('Are you sure you want to restore this organization?')) {
Inertia.put(route('organizations.restore', organization.id));
}
}
</script>
<Helmet title={values.name} />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">
<InertiaLink
href={route('organizations')}
class="text-indigo-600 hover:text-indigo-700"
>
Organizations
</InertiaLink>
<span class="text-indigo-600 font-medium mx-2">/</span>
{values.name}
</h1>
{#if organization.deleted_at}
<TrashedMessage onRestore={restore}>This organization has been deleted.</TrashedMessage>
{/if}
<div class="bg-white rounded shadow overflow-hidden max-w-3xl">
<form on:submit|preventDefault={handleSubmit}>
<div class="p-8 -mr-6 -mb-8 flex flex-wrap">
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Name"
name="name"
errors={errors.name}
value={values.name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Phone"
name="phone"
type="text"
errors={errors.phone}
value={values.phone}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Address"
name="address"
type="text"
errors={errors.address}
value={values.address}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="City"
name="city"
type="text"
errors={errors.city}
value={values.city}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Province/State"
name="region"
type="text"
errors={errors.region}
value={values.region}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Country"
name="country"
errors={errors.country}
value={values.country}
onChange={handleChange}
>
<option value=""></option>
<option value="CA">Canada</option>
<option value="US">United States</option>
</SelectInput>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Postal Code"
name="postal_code"
type="text"
errors={errors.postal_code}
value={values.postal_code}
onChange={handleChange}
/>
</div>
<div class="px-8 py-4 bg-gray-100 border-t border-gray-200 flex items-center">
{#if !organization.deleted_at}
<DeleteButton onDelete={destroy}>Delete Organization</DeleteButton>
{/if}
<LoadingButton
loading={sending}
type="submit"
className="btn-indigo ml-auto"
>
Update Organization
</LoadingButton>
</div>
</form>
</div>
<h2 class="mt-12 font-bold text-2xl">Contacts</h2>
<div class="mt-6 bg-white rounded shadow overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
<tr class="text-left font-bold">
<th class="px-6 pt-5 pb-4">Name</th>
<th class="px-6 pt-5 pb-4">City</th>
<th class="px-6 pt-5 pb-4" colspan="2">Phone</th>
</tr>
</thead>
<tbody>
{#if !organization.contacts || organization.contacts.length === 0}
<tr>
<td class="border-t px-6 py-4" colspan="4">
No contacts found.
</td>
</tr>
{:else}
{#each organization.contacts as { id, name, phone, city, deleted_at } (id)}
<tr class="hover:bg-gray-100 focus-within:bg-gray-100">
<td class="border-t">
<InertiaLink
href={route('contacts.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{name}
{#if deleted_at}
<Icon
name="trash"
className="flex-shrink-0 w-3 h-3 text-gray-400 fill-current ml-2"
/>
{/if}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('contacts.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{city}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('contacts.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{phone}
</InertiaLink>
</td>
<td class="border-t w-px">
<InertiaLink
tabindex="-1"
href={route('contacts.edit', id)}
class="px-4 flex items-center"
>
<Icon
name="cheveron-right"
className="block w-6 h-6 text-gray-400 fill-current"
/>
</InertiaLink>
</td>
</tr>
{/each}
{/if}
</tbody>
</table>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Organizations/Index.svelte
================================================
<script>
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import Icon from '@/Shared/Icon.svelte';
import SearchFilter from '@/Shared/SearchFilter.svelte';
import Pagination from '@/Shared/Pagination.svelte';
const route = window.route;
$: links = $page.organizations.links;
$: data = $page.organizations.data;
</script>
<Helmet title="Organizations" />
<Layout>
<div>
<div>
<h1 class="mb-8 font-bold text-3xl">Organizations</h1>
<div class="mb-6 flex justify-between items-center">
<SearchFilter />
<InertiaLink
class="btn-indigo"
href={route('organizations.create')}
>
<span>Create</span>
<span class="hidden md:inline"> Organization</span>
</InertiaLink>
</div>
<div class="bg-white rounded shadow overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
<tr class="text-left font-bold">
<th class="px-6 pt-5 pb-4">Name</th>
<th class="px-6 pt-5 pb-4">City</th>
<th class="px-6 pt-5 pb-4" colspan="2">Phone</th>
</tr>
</thead>
<tbody>
{#if !data || data.length === 0}
<tr>
<td class="border-t px-6 py-4" colspan="4">
No organizations found.
</td>
</tr>
{:else}
{#each data as { id, name, city, phone, deleted_at } (id)}
<tr class="hover:bg-gray-100 focus-within:bg-gray-100">
<td class="border-t">
<InertiaLink
href={route('organizations.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo-700"
>
{name}
{#if deleted_at}
<Icon
name="trash"
className="flex-shrink-0 w-3 h-3 text-gray-400 fill-current ml-2"
/>
{/if}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('organizations.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{city}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('organizations.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{phone}
</InertiaLink>
</td>
<td class="border-t w-px">
<InertiaLink
tabindex="-1"
href={route('organizations.edit', id)}
class="px-4 flex items-center"
>
<Icon
name="cheveron-right"
className="block w-6 h-6 text-gray-400 fill-current"
/>
</InertiaLink>
</td>
</tr>
{/each}
{/if}
</tbody>
</table>
</div>
<Pagination links={links} />
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Reports/Index.svelte
================================================
<script>
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
</script>
<Helmet title="Reports" />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">Reports</h1>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Users/Create.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import SelectInput from '@/Shared/SelectInput.svelte';
import FileInput from '@/Shared/FileInput.svelte';
import { toFormData } from '@/utils';
const route = window.route;
$: errors = $page.errors;
let sending = false;
let values = {
first_name: '',
last_name: '',
email: '',
password: '',
owner: '0',
photo: ''
};
function handleChange({ target: { name, value } }) {
values = {
...values,
[key]: value
};
}
function handleFileChange(file) {
values = {
...values,
photo: file
};
}
function handleSubmit() {
sending = true;
// since we are uploading an image
// we need to use FormData object
// for more info check utils.js
const formData = toFormData(values);
Inertia.post(route('users.store'), formData).then(() => sending = false);
}
</script>
<Helmet title="Create User" />
<Layout>
<div>
<div>
<h1 class="mb-8 font-bold text-3xl">
<InertiaLink
href={route('users')}
class="text-indigo-600 hover:text-indigo-700"
>
Users
</InertiaLink>
<span class="text-indigo-600 font-medium"> /</span> Create
</h1>
</div>
<div class="bg-white rounded shadow overflow-hidden max-w-3xl">
<form name="createForm" on:submit|preventDefault={handleSubmit}>
<div class="p-8 -mr-6 -mb-8 flex flex-wrap">
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="First Name"
name="first_name"
errors={errors.first_name}
value={values.first_name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Last Name"
name="last_name"
errors={errors.last_name}
value={values.last_name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Password"
name="password"
type="password"
errors={errors.password}
value={values.password}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Owner"
name="owner"
errors={errors.owner}
value={values.owner}
onChange={handleChange}
>
<option value="1">Yes</option>
<option value="0">No</option>
</SelectInput>
<FileInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Photo"
name="photo"
accept="image/*"
errors={errors.photo}
value={values.photo}
onChange={handleFileChange}
/>
</div>
<div class="px-8 py-4 bg-gray-100 border-t border-gray-200 flex justify-end items-center">
<LoadingButton
loading={sending}
type="submit"
className="btn-indigo"
>
Create User
</LoadingButton>
</div>
</form>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Users/Edit.svelte
================================================
<script>
import { Inertia } from '@inertiajs/inertia';
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import DeleteButton from '@/Shared/DeleteButton.svelte';
import LoadingButton from '@/Shared/LoadingButton.svelte';
import TextInput from '@/Shared/TextInput.svelte';
import SelectInput from '@/Shared/SelectInput.svelte';
import FileInput from '@/Shared/FileInput.svelte';
import TrashedMessage from '@/Shared/TrashedMessage.svelte';
import { toFormData } from '@/utils';
const route = window.route;
let { user } = $page;
$: user = $page.user;
$: errors = $page.errors;
let sending = false;
let values = {
first_name: user.first_name || '',
last_name: user.last_name || '',
email: user.email || '',
password: user.password || '',
owner: user.owner ? '1' : '0' || '0'
// photo: '',
};
function handleChange({ target: { name, value } }) {
values = {
...values,
[name]: value
};
}
function handleFileChange(file) {
values = {
...values,
photo: file
};
}
function handleSubmit() {
sending = true;
// since we are uploading an image
// we need to use FormData object
// NOTE: When working with Laravel PUT/PATCH requests and FormData
// you SHOULD send POST request and fake the PUT request like this.
// For more info check utils.jf file
const formData = toFormData(values, 'PUT');
Inertia.post(route('users.update', user.id), formData).then(() => sending = false);
}
function destroy() {
if (confirm('Are you sure you want to delete this user?')) {
Inertia.delete(route('users.destroy', user.id));
}
}
function restore() {
if (confirm('Are you sure you want to restore this user?')) {
Inertia.put(route('users.restore', user.id));
}
}
</script>
<Helmet title={`${values.first_name} ${values.last_name}`} />
<Layout>
<div>
<div class="mb-8 flex justify-start max-w-lg">
<h1 class="font-bold text-3xl">
<InertiaLink
href={route('users')}
class="text-indigo-600 hover:text-indigo-700"
>
Users
</InertiaLink>
<span class="text-indigo-600 font-medium mx-2">/</span>
{values.first_name} {values.last_name}
</h1>
{#if user.photo}
<img class="block w-8 h-8 rounded-full ml-4" src={user.photo} alt={user.name} />
{/if}
</div>
{#if user.deleted_at}
<TrashedMessage onRestore={restore}>
This contact has been deleted.
</TrashedMessage>
{/if}
<div class="bg-white rounded shadow overflow-hidden max-w-3xl">
<form on:submit|preventDefault={handleSubmit}>
<div class="p-8 -mr-6 -mb-8 flex flex-wrap">
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="First Name"
name="first_name"
errors={errors.first_name}
value={values.first_name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Last Name"
name="last_name"
errors={errors.last_name}
value={values.last_name}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Email"
name="email"
type="email"
errors={errors.email}
value={values.email}
onChange={handleChange}
/>
<TextInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Password"
name="password"
type="password"
errors={errors.password}
value={values.password}
onChange={handleChange}
/>
<SelectInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Owner"
name="owner"
errors={errors.owner}
value={values.owner}
onChange={handleChange}
>
<option value="1">Yes</option>
<option value="0">No</option>
</SelectInput>
<FileInput
className="pr-6 pb-8 w-full lg:w-1/2"
label="Photo"
name="photo"
accept="image/*"
errors={errors.photo}
value={values.photo}
onChange={handleFileChange}
/>
</div>
<div class="px-8 py-4 bg-gray-100 border-t border-gray-200 flex items-center">
{#if !user.deleted_at}
<DeleteButton onDelete={destroy}>Delete User</DeleteButton>
{/if}
<LoadingButton
loading={sending}
type="submit"
className="btn-indigo ml-auto"
>
Update User
</LoadingButton>
</div>
</form>
</div>
</div>
</Layout>
================================================
FILE: resources/js/Pages/Users/Index.svelte
================================================
<script>
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Helmet from '@/Shared/Helmet.svelte';
import Layout from '@/Shared/Layout.svelte';
import Icon from '@/Shared/Icon.svelte';
import SearchFilter from '@/Shared/SearchFilter.svelte';
import Pagination from '@/Shared/Pagination.svelte';
const route = window.route;
$: data = $page.users.data;
$: links = $page.users.links;
</script>
<Helmet title="Users" />
<Layout>
<div>
<h1 class="mb-8 font-bold text-3xl">Users</h1>
<div class="mb-6 flex justify-between items-center">
<SearchFilter />
<InertiaLink class="btn-indigo" href={route('users.create')}>
<span>Create</span>
<span class="hidden md:inline"> User</span>
</InertiaLink>
</div>
<div class="bg-white rounded shadow overflow-x-auto">
<table class="w-full whitespace-no-wrap">
<thead>
<tr class="text-left font-bold">
<th class="px-6 pt-5 pb-4">Name</th>
<th class="px-6 pt-5 pb-4">Email</th>
<th class="px-6 pt-5 pb-4" colspan="2">Role</th>
</tr>
</thead>
<tbody>
{#if !data || data.length === 0}
<tr>
<td class="border-t px-6 py-4" colspan="4">
No users found.
</td>
</tr>
{:else}
{#each data as { id, name, photo, email, owner, deleted_at } (id)}
<tr class="hover:bg-gray-100 focus-within:bg-gray-100">
<td class="border-t">
<InertiaLink
href={route('users.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo-700"
>
{#if photo}
<img
src={photo}
class="block w-5 h-5 rounded-full mr-2 -my-2"
alt={name}
/>
{/if}
{name}
{#if deleted_at}
<Icon
name="trash"
className="flex-shrink-0 w-3 h-3 text-gray-400 fill-current ml-2"
/>
{/if}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('users.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{email}
</InertiaLink>
</td>
<td class="border-t">
<InertiaLink
tabindex="-1"
href={route('users.edit', id)}
class="px-6 py-4 flex items-center focus:text-indigo"
>
{owner ? 'Owner' : 'User'}
</InertiaLink>
</td>
<td class="border-t w-px">
<InertiaLink
tabindex="-1"
href={route('users.edit', id)}
class="px-4 flex items-center"
>
<Icon
name="cheveron-right"
className="block w-6 h-6 text-gray-400 fill-current"
/>
</InertiaLink>
</td>
</tr>
{/each}
{/if}
</tbody>
</table>
</div>
<Pagination links={links} />
</div>
</Layout>
================================================
FILE: resources/js/Shared/BottomHeader.svelte
================================================
<script>
import { InertiaLink, page } from '@inertiajs/inertia-svelte';
import Icon from '@/Shared/Icon.svelte';
const route = window.route;
let { auth } = $page;
$: auth = $page.auth;
let menuOpened = false;
</script>
<div class="bg-white border-b w-full p-4 md:py-0 md:px-12 text-sm d:text-md flex justify-between items-center">
<div class="mt-1 mr-4">{auth.user.account.name}</div>
<div class="relative">
<div
class="flex items-center cursor-pointer select-none group"
on:click={() => menuOpened = true}
>
<div class="text-gray-800 group-hover:text-indigo-600 focus:text-indigo-600 mr-1 whitespace-no-wrap">
<span>{auth.user.first_name}</span>
<span class="ml-1 hidden md:inline">{auth.user.last_name}</span>
</div>
<Icon
className="w-5 h-5 fill-current text-gray-800 group-hover:text-indigo-600 focus:text-indigo-600"
name="cheveron-down"
/>
</div>
<div class:hidden={!menuOpened}>
<div
class="whitespace-no-wrap absolute z-20 mt-8 left-auto top-0 right-0 py-2 shadow-xl bg-white rounded text-sm">
<InertiaLink
href={route('users.edit', auth.user.id)}
class="block px-6 py-2 hover:bg-indigo-600 hover:text-white"
>
My Profile
</InertiaLink>
<InertiaLink
href={route('users')}
class="block px-6 py-2 hover:bg-indigo-600 hover:text-white"
>
Manage Users
</InertiaLink>
<InertiaLink
href={route('logout')}
class="block px-6 py-2 hover:bg-indigo-600 hover:text-white"
method="post"
>
Logout
</InertiaLink>
</div>
<div
on:click={() => menuOpened = false}
class="bg-black opacity-25 fixed inset-0 z-10"
/>
</div>
</div>
</div>
================================================
FILE: resources/js/Shared/DeleteButton.svelte
================================================
<script>
export let onDelete;
</script>
<button
class="text-red-600 focus:outline-none hover:underline"
tabindex="-1"
type="button"
on:click={onDelete}
>
<slot />
</button>
================================================
FILE: resources/js/Shared/FileInput.svelte
================================================
<script>
import { filesize } from '@/utils';
export let className = '';
export let name;
export let label;
export let accept;
export let errors = [];
export let onChange;
export let value;
// unused value for now
console.log(value);
let fileInput;
let file = null;
function browse() {
fileInput.click();
}
function remove() {
file = null;
onChange(null);
fileInput.value = null;
}
function handleFileChange(e) {
file = e.target.files[0];
onChange(file);
}
</script>
<div class={className}>
{#if label}
<label class="form-label" for={name}>{label}:</label>
{/if}
<div class="form-input p-0" class:error={errors && errors.length}>
<input
id={name}
bind:this={fileInput}
accept={accept}
type="file"
class="hidden"
on:change={handleFileChange}
/>
{#if file}
<div class="flex items-center justify-between p-2">
<div class="flex-1 pr-1">
{file.name}
<span class="text-gray-600 text-xs ml-1">
({filesize(file.size)})
</span>
</div>
<button
type="button"
class="focus:outline-none px-4 py-1 bg-gray-600 hover:bg-gray-700 rounded-sm text-xs font-medium text-white"
on:click={remove}
>
Remove
</button>
</div>
{:else}
<div class="p-2">
<button
type="button"
class="focus:outline-none px-4 py-1 bg-gray-600 hover:bg-gray-700 rounded-sm text-xs font-medium text-white"
on:click={browse}
>
Browse
</button>
</div>
{/if}
</div>
{#if errors && errors.length > 0}
<div class="form-error">{errors[0]}</div>
{/if}
</div>
================================================
FILE: resources/js/Shared/FlashMessages.svelte
================================================
<script>
import {page} from '@inertiajs/inertia-svelte';
let { flash, errors } = $page;
$: flash = $page.flash;
$: errors = $page.errors;
let numOfErrors = Object.keys(errors).length;
let visible = true;
$: (flash || errors) && (visible = true);
</script>
<div>
{#if flash.success && visible}
<div class="mb-8 flex items-center justify-between bg-green-500 rounded max-w-3xl">
<div class="flex items-center">
<svg
class="ml-4 mr-2 flex-shrink-0 w-4 h-4 text-white fill-current"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<polygon points="0 11 2 9 7 14 18 3 20 5 7 18"/>
</svg>
<div class="py-4 text-white text-sm font-medium">
{flash.success}
</div>
</div>
<button
on:click={() => visible = false}
type="button"
class="focus:outline-none group mr-2 p-2"
>
<svg
class="block w-2 h-2 fill-current text-green-700 group-hover:text-green-800"
xmlns="http://www.w3.org/2000/svg"
width="235.908"
height="235.908"
viewBox="278.046 126.846 235.908 235.908"
>
<path
d="M506.784 134.017c-9.56-9.56-25.06-9.56-34.62 0L396 210.18l-76.164-76.164c-9.56-9.56-25.06-9.56-34.62 0-9.56 9.56-9.56 25.06 0 34.62L361.38 244.8l-76.164 76.165c-9.56 9.56-9.56 25.06 0 34.62 9.56 9.56 25.06 9.56 34.62 0L396 279.42l76.164 76.165c9.56 9.56 25.06 9.56 34.62 0 9.56-9.56 9.56-25.06 0-34.62L430.62 244.8l76.164-76.163c9.56-9.56 9.56-25.06 0-34.62z"/>
</svg>
</button>
</div>
{/if}
{#if (flash.error || numOfErrors > 0) && visible}
<div class="mb-8 flex items-center justify-between bg-red-500 rounded max-w-3xl">
<div class="flex items-center">
<svg
class="ml-4 mr-2 flex-shrink-0 w-4 h-4 text-white fill-current"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M2.93 17.07A10 10 0 1 1 17.07 2.93 10 10 0 0 1 2.93 17.07zm1.41-1.41A8 8 0 1 0 15.66 4.34 8 8 0 0 0 4.34 15.66zm9.9-8.49L11.41 10l2.83 2.83-1.41 1.41L10 11.41l-2.83 2.83-1.41-1.41L8.59 10 5.76 7.17l1.41-1.41L10 8.59l2.83-2.83 1.41 1.41z"/>
</svg>
<div class="py-4 text-white text-sm font-medium">
{flash.error && flash.error}
{numOfErrors === 1 && 'There is one form error'}
{numOfErrors > 1 && `There are ${numOfErrors} form errors.`}
</div>
</div>
<button
on:click={() => visible = false}
type="button"
class="focus:outline-none group mr-2 p-2"
>
<svg
class="block w-2 h-2 fill-current text-red-700 group-hover:text-red-800"
xmlns="http://www.w3.org/2000/svg"
width="235.908"
height="235.908"
viewBox="278.046 126.846 235.908 235.908"
>
<path
d="M506.784 134.017c-9.56-9.56-25.06-9.56-34.62 0L396 210.18l-76.164-76.164c-9.56-9.56-25.06-9.56-34.62 0-9.56 9.56-9.56 25.06 0 34.62L361.38 244.8l-76.164 76.165c-9.56 9.56-9.56 25.06 0 34.62 9.56 9.56 25.06 9.56 34.62 0L396 279.42l76.164 76.165c9.56 9.56 25.06 9.56 34.62 0 9.56-9.56 9.56-25.06 0-34.62L430.62 244.8l76.164-76.163c9.56-9.56 9.56-25.06 0-34.62z"/>
</svg>
</button>
</div>
{/if}
</div>
================================================
FILE: resources/js/Shared/Helmet.svelte
================================================
<script>
export let title;
</script>
<svelte:head>
<title>{title ? `${title} | Ping CRM` : 'Ping CRM'}</title>
</svelte:head>
================================================
FILE: resources/js/Shared/Icon.svelte
================================================
<script>
export let name;
export let className = '';
</script>
{#if name === 'apple'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
width="100"
height="100"
viewBox="0 0 100 100"
>
<g fill-rule="nonzero">
<path
d="M46.173 19.967C49.927-1.838 19.797-.233 14.538.21c-.429.035-.648.4-.483.8 2.004 4.825 14.168 31.66 32.118 18.957zm13.18 1.636c1.269-.891 1.35-1.614.047-2.453l-2.657-1.71c-.94-.607-1.685-.606-2.532.129-5.094 4.42-7.336 9.18-8.211 15.24 1.597.682 3.55.79 5.265.328 1.298-4.283 3.64-8.412 8.088-11.534z"/>
<path
d="M88.588 67.75c9.65-27.532-13.697-45.537-35.453-32.322-1.84 1.118-4.601 1.118-6.441 0-21.757-13.215-45.105 4.79-35.454 32.321 5.302 15.123 17.06 39.95 37.295 29.995.772-.38 1.986-.38 2.758 0 20.235 9.955 31.991-14.872 37.295-29.995z"/>
</g>
</svg>
{:else if name === 'book'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M6 4H5a1 1 0 1 1 0-2h11V1a1 1 0 0 0-1-1H4a2 2 0 0 0-2 2v16c0 1.1.9 2 2 2h12a2 2 0 0 0 2-2V5a1 1 0 0 0-1-1h-7v8l-2-2-2 2V4z"/>
</svg>
{:else if name === 'cheveron-down'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/>
</svg>
{:else if name === 'cheveron-right'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<polygon points="12.95 10.707 13.657 10 8 4.343 6.586 5.757 10.828 10 6.586 14.243 8 15.657 12.95 10.707"/>
</svg>
{:else if name === 'dashboard'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M10 20a10 10 0 1 1 0-20 10 10 0 0 1 0 20zm-5.6-4.29a9.95 9.95 0 0 1 11.2 0 8 8 0 1 0-11.2 0zm6.12-7.64l3.02-3.02 1.41 1.41-3.02 3.02a2 2 0 1 1-1.41-1.41z"/>
</svg>
{:else if name === 'location'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path d="M10 20S3 10.87 3 7a7 7 0 1 1 14 0c0 3.87-7 13-7 13zm0-11a2 2 0 1 0 0-4 2 2 0 0 0 0 4z"/>
</svg>
{:else if name === 'office'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
width="100"
height="100"
viewBox="0 0 100 100"
>
<path
fill-rule="evenodd"
d="M7 0h86v100H57.108V88.418H42.892V100H7V0zm9 64h11v15H16V64zm57 0h11v15H73V64zm-19 0h11v15H54V64zm-19 0h11v15H35V64zM16 37h11v15H16V37zm57 0h11v15H73V37zm-19 0h11v15H54V37zm-19 0h11v15H35V37zM16 11h11v15H16V11zm57 0h11v15H73V11zm-19 0h11v15H54V11zm-19 0h11v15H35V11z"
/>
</svg>
{:else if name === 'printer'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path d="M4 16H0V6h20v10h-4v4H4v-4zm2-4v6h8v-6H6zM4 0h12v5H4V0zM2 8v2h2V8H2zm4 0v2h2V8H6z"/>
</svg>
{:else if name === 'shopping-cart'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M4 2h16l-3 9H4a1 1 0 1 0 0 2h13v2H4a3 3 0 0 1 0-6h.33L3 5 2 2H0V0h3a1 1 0 0 1 1 1v1zm1 18a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm10 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z"/>
</svg>
{:else if name === 'store-front'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M18 9.87V20H2V9.87a4.25 4.25 0 0 0 3-.38V14h10V9.5a4.26 4.26 0 0 0 3 .37zM3 0h4l-.67 6.03A3.43 3.43 0 0 1 3 9C1.34 9 .42 7.73.95 6.15L3 0zm5 0h4l.7 6.3c.17 1.5-.91 2.7-2.42 2.7h-.56A2.38 2.38 0 0 1 7.3 6.3L8 0zm5 0h4l2.05 6.15C19.58 7.73 18.65 9 17 9a3.42 3.42 0 0 1-3.33-2.97L13 0z"/>
</svg>
{:else if name === 'trash'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path d="M6 2l2-2h4l2 2h4v2H2V2h4zM3 6h14l-1 14H4L3 6zm5 2v10h1V8H8zm3 0v10h1V8h-1z"/>
</svg>
{:else if name === 'users'}
<svg
class={className}
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 20 20"
>
<path
d="M7 8a4 4 0 1 1 0-8 4 4 0 0 1 0 8zm0 1c2.15 0 4.2.4 6.1 1.09L12 16h-1.25L10 20H4l-.75-4H2L.9 10.09A17.93 17.93 0 0 1 7 9zm8.31.17c1.32.18 2.59.48 3.8.92L18 16h-1.25L16 20h-3.96l.37-2h1.25l1.65-8.83zM13 0a4 4 0 1 1-1.33 7.76 5.96 5.96 0 0 0 0-7.52C12.1.1 12.53 0 13 0z"/>
</svg>
{/if}
================================================
FILE: resources/js/Shared/Layout.svelte
================================================
<script>
import MainMenu from '@/Shared/MainMenu.svelte';
import FlashMessages from '@/Shared/FlashMessages.svelte';
import TopHeader from '@/Shared/TopHeader.svelte';
import BottomHeader from '@/Shared/BottomHeader.svelte';
</script>
<div class="flex flex-col">
<div class="h-screen flex flex-col">
<div class="md:flex">
<TopHeader />
<BottomHeader />
</div>
<div class="flex flex-grow overflow-hidden">
<MainMenu className="bg-indigo-800 flex-shrink-0 w-56 p-12 hidden md:block overflow-y-auto" />
<!-- To reset scroll region (https://inertiajs.com/pages#scroll-regions) add `scro
gitextract_loyfmr9_/ ├── .editorconfig ├── .eslintrc.js ├── .gitattributes ├── .gitignore ├── .prettierrc ├── LICENSE ├── Procfile ├── app/ │ ├── Account.php │ ├── Console/ │ │ └── Kernel.php │ ├── Contact.php │ ├── Exceptions/ │ │ └── Handler.php │ ├── Http/ │ │ ├── Controllers/ │ │ │ ├── Auth/ │ │ │ │ ├── ForgotPasswordController.php │ │ │ │ ├── LoginController.php │ │ │ │ ├── RegisterController.php │ │ │ │ ├── ResetPasswordController.php │ │ │ │ └── VerificationController.php │ │ │ ├── ContactsController.php │ │ │ ├── Controller.php │ │ │ ├── DashboardController.php │ │ │ ├── ImagesController.php │ │ │ ├── OrganizationsController.php │ │ │ ├── ReportsController.php │ │ │ └── UsersController.php │ │ ├── Kernel.php │ │ └── Middleware/ │ │ ├── Authenticate.php │ │ ├── CheckForMaintenanceMode.php │ │ ├── EncryptCookies.php │ │ ├── RedirectIfAuthenticated.php │ │ ├── TrimStrings.php │ │ ├── TrustProxies.php │ │ └── VerifyCsrfToken.php │ ├── Model.php │ ├── Organization.php │ ├── Providers/ │ │ ├── AppServiceProvider.php │ │ ├── AuthServiceProvider.php │ │ ├── BroadcastServiceProvider.php │ │ ├── EventServiceProvider.php │ │ └── RouteServiceProvider.php │ └── User.php ├── artisan ├── bootstrap/ │ ├── app.php │ └── cache/ │ └── .gitignore ├── composer.json ├── config/ │ ├── app.php │ ├── auth.php │ ├── broadcasting.php │ ├── cache.php │ ├── database.php │ ├── filesystems.php │ ├── hashing.php │ ├── logging.php │ ├── mail.php │ ├── queue.php │ ├── sentry.php │ ├── services.php │ ├── session.php │ └── view.php ├── database/ │ ├── .gitignore │ ├── factories/ │ │ ├── ContactFactory.php │ │ ├── OrganizationFactory.php │ │ └── UserFactory.php │ ├── migrations/ │ │ ├── 2019_03_05_000000_create_accounts_table.php │ │ ├── 2019_03_05_000000_create_contacts_table.php │ │ ├── 2019_03_05_000000_create_organizations_table.php │ │ ├── 2019_03_05_000000_create_password_resets_table.php │ │ └── 2019_03_05_000000_create_users_table.php │ └── seeds/ │ └── DatabaseSeeder.php ├── jsconfig.json ├── package.json ├── phpunit.xml ├── public/ │ ├── .htaccess │ ├── index.php │ ├── robots.txt │ └── web.config ├── readme.md ├── resources/ │ ├── css/ │ │ ├── app.css │ │ ├── buttons.css │ │ ├── form.css │ │ ├── nprogress.css │ │ └── reset.css │ ├── js/ │ │ ├── Pages/ │ │ │ ├── Auth/ │ │ │ │ └── Login.svelte │ │ │ ├── Contacts/ │ │ │ │ ├── Create.svelte │ │ │ │ ├── Edit.svelte │ │ │ │ └── Index.svelte │ │ │ ├── Dashboard/ │ │ │ │ └── Index.svelte │ │ │ ├── Error.svelte │ │ │ ├── Organizations/ │ │ │ │ ├── Create.svelte │ │ │ │ ├── Edit.svelte │ │ │ │ └── Index.svelte │ │ │ ├── Reports/ │ │ │ │ └── Index.svelte │ │ │ └── Users/ │ │ │ ├── Create.svelte │ │ │ ├── Edit.svelte │ │ │ └── Index.svelte │ │ ├── Shared/ │ │ │ ├── BottomHeader.svelte │ │ │ ├── DeleteButton.svelte │ │ │ ├── FileInput.svelte │ │ │ ├── FlashMessages.svelte │ │ │ ├── Helmet.svelte │ │ │ ├── Icon.svelte │ │ │ ├── Layout.svelte │ │ │ ├── LoadingButton.svelte │ │ │ ├── Logo.svelte │ │ │ ├── MainMenu.svelte │ │ │ ├── MainMenuItem.svelte │ │ │ ├── Pagination.svelte │ │ │ ├── SearchFilter.svelte │ │ │ ├── SelectInput.svelte │ │ │ ├── TextInput.svelte │ │ │ ├── TopHeader.svelte │ │ │ └── TrashedMessage.svelte │ │ ├── app.js │ │ └── utils.js │ ├── lang/ │ │ └── en/ │ │ ├── auth.php │ │ ├── pagination.php │ │ ├── passwords.php │ │ └── validation.php │ └── views/ │ └── app.blade.php ├── routes/ │ ├── api.php │ ├── channels.php │ ├── console.php │ └── web.php ├── server.php ├── storage/ │ ├── app/ │ │ └── .gitignore │ ├── debugbar/ │ │ └── .gitignore │ ├── framework/ │ │ ├── .gitignore │ │ ├── cache/ │ │ │ └── .gitignore │ │ ├── sessions/ │ │ │ └── .gitignore │ │ ├── testing/ │ │ │ └── .gitignore │ │ └── views/ │ │ └── .gitignore │ └── logs/ │ └── .gitignore ├── tailwind.config.js ├── tests/ │ ├── CreatesApplication.php │ ├── Feature/ │ │ ├── ContactsTest.php │ │ └── OrganizationsTest.php │ └── TestCase.php └── webpack.mix.js
SYMBOL INDEX (129 symbols across 43 files)
FILE: app/Account.php
class Account (line 7) | class Account extends Model
method users (line 9) | public function users()
method organizations (line 14) | public function organizations()
method contacts (line 19) | public function contacts()
FILE: app/Console/Kernel.php
class Kernel (line 8) | class Kernel extends ConsoleKernel
method schedule (line 25) | protected function schedule(Schedule $schedule)
method commands (line 36) | protected function commands()
FILE: app/Contact.php
class Contact (line 7) | class Contact extends Model
method organization (line 11) | public function organization()
method getNameAttribute (line 16) | public function getNameAttribute()
method scopeOrderByName (line 21) | public function scopeOrderByName($query)
method scopeFilter (line 26) | public function scopeFilter($query, array $filters)
FILE: app/Exceptions/Handler.php
class Handler (line 10) | class Handler extends ExceptionHandler
method report (line 37) | public function report(Throwable $exception)
method render (line 54) | public function render($request, Throwable $exception)
FILE: app/Http/Controllers/Auth/ForgotPasswordController.php
class ForgotPasswordController (line 8) | class ForgotPasswordController extends Controller
method __construct (line 28) | public function __construct()
FILE: app/Http/Controllers/Auth/LoginController.php
class LoginController (line 14) | class LoginController extends Controller
method showLoginForm (line 36) | public function showLoginForm()
FILE: app/Http/Controllers/Auth/RegisterController.php
class RegisterController (line 11) | class RegisterController extends Controller
method __construct (line 38) | public function __construct()
method validator (line 49) | protected function validator(array $data)
method create (line 64) | protected function create(array $data)
FILE: app/Http/Controllers/Auth/ResetPasswordController.php
class ResetPasswordController (line 8) | class ResetPasswordController extends Controller
method __construct (line 35) | public function __construct()
FILE: app/Http/Controllers/Auth/VerificationController.php
class VerificationController (line 8) | class VerificationController extends Controller
method __construct (line 35) | public function __construct()
FILE: app/Http/Controllers/ContactsController.php
class ContactsController (line 12) | class ContactsController extends Controller
method index (line 14) | public function index()
method create (line 36) | public function create()
method store (line 48) | public function store()
method edit (line 70) | public function edit(Contact $contact)
method update (line 95) | public function update(Contact $contact)
method destroy (line 117) | public function destroy(Contact $contact)
method restore (line 124) | public function restore(Contact $contact)
FILE: app/Http/Controllers/Controller.php
class Controller (line 10) | class Controller extends BaseController
FILE: app/Http/Controllers/DashboardController.php
class DashboardController (line 7) | class DashboardController extends Controller
method __invoke (line 9) | public function __invoke()
FILE: app/Http/Controllers/ImagesController.php
class ImagesController (line 7) | class ImagesController extends Controller
method show (line 9) | public function show(Server $glide)
FILE: app/Http/Controllers/OrganizationsController.php
class OrganizationsController (line 11) | class OrganizationsController extends Controller
method index (line 13) | public function index()
method create (line 25) | public function create()
method store (line 30) | public function store()
method edit (line 48) | public function edit(Organization $organization)
method update (line 67) | public function update(Organization $organization)
method destroy (line 85) | public function destroy(Organization $organization)
method restore (line 92) | public function restore(Organization $organization)
FILE: app/Http/Controllers/ReportsController.php
class ReportsController (line 7) | class ReportsController extends Controller
method __invoke (line 9) | public function __invoke()
FILE: app/Http/Controllers/UsersController.php
class UsersController (line 14) | class UsersController extends Controller
method index (line 16) | public function index()
method create (line 37) | public function create()
method store (line 42) | public function store()
method edit (line 65) | public function edit(User $user)
method update (line 80) | public function update(User $user)
method destroy (line 108) | public function destroy(User $user)
method restore (line 119) | public function restore(User $user)
FILE: app/Http/Kernel.php
class Kernel (line 7) | class Kernel extends HttpKernel
FILE: app/Http/Middleware/Authenticate.php
class Authenticate (line 7) | class Authenticate extends Middleware
method redirectTo (line 15) | protected function redirectTo($request)
FILE: app/Http/Middleware/CheckForMaintenanceMode.php
class CheckForMaintenanceMode (line 7) | class CheckForMaintenanceMode extends Middleware
FILE: app/Http/Middleware/EncryptCookies.php
class EncryptCookies (line 7) | class EncryptCookies extends Middleware
FILE: app/Http/Middleware/RedirectIfAuthenticated.php
class RedirectIfAuthenticated (line 8) | class RedirectIfAuthenticated
method handle (line 18) | public function handle($request, Closure $next, $guard = null)
FILE: app/Http/Middleware/TrimStrings.php
class TrimStrings (line 7) | class TrimStrings extends Middleware
FILE: app/Http/Middleware/TrustProxies.php
class TrustProxies (line 8) | class TrustProxies extends Middleware
FILE: app/Http/Middleware/VerifyCsrfToken.php
class VerifyCsrfToken (line 7) | class VerifyCsrfToken extends Middleware
FILE: app/Model.php
class Model (line 8) | abstract class Model extends Eloquent
method resolveRouteBinding (line 14) | public function resolveRouteBinding($value, $field = null)
FILE: app/Organization.php
class Organization (line 7) | class Organization extends Model
method contacts (line 11) | public function contacts()
method scopeFilter (line 16) | public function scopeFilter($query, array $filters)
FILE: app/Providers/AppServiceProvider.php
class AppServiceProvider (line 18) | class AppServiceProvider extends ServiceProvider
method boot (line 20) | public function boot()
method register (line 25) | public function register()
method registerInertia (line 32) | public function registerInertia()
method registerGlide (line 68) | protected function registerGlide()
method registerLengthAwarePaginator (line 80) | protected function registerLengthAwarePaginator()
FILE: app/Providers/AuthServiceProvider.php
class AuthServiceProvider (line 8) | class AuthServiceProvider extends ServiceProvider
method boot (line 24) | public function boot()
FILE: app/Providers/BroadcastServiceProvider.php
class BroadcastServiceProvider (line 8) | class BroadcastServiceProvider extends ServiceProvider
method boot (line 15) | public function boot()
FILE: app/Providers/EventServiceProvider.php
class EventServiceProvider (line 10) | class EventServiceProvider extends ServiceProvider
method boot (line 28) | public function boot()
FILE: app/Providers/RouteServiceProvider.php
class RouteServiceProvider (line 8) | class RouteServiceProvider extends ServiceProvider
method boot (line 24) | public function boot()
method map (line 36) | public function map()
method mapWebRoutes (line 52) | protected function mapWebRoutes()
method mapApiRoutes (line 66) | protected function mapApiRoutes()
FILE: app/User.php
class User (line 15) | class User extends Model implements AuthenticatableContract, Authorizabl...
method account (line 23) | public function account()
method getNameAttribute (line 28) | public function getNameAttribute()
method setPasswordAttribute (line 33) | public function setPasswordAttribute($password)
method photoUrl (line 38) | public function photoUrl(array $attributes)
method isDemoUser (line 45) | public function isDemoUser()
method scopeOrderByName (line 50) | public function scopeOrderByName($query)
method scopeWhereRole (line 55) | public function scopeWhereRole($query, $role)
method scopeFilter (line 63) | public function scopeFilter($query, array $filters)
FILE: database/migrations/2019_03_05_000000_create_accounts_table.php
class CreateAccountsTable (line 7) | class CreateAccountsTable extends Migration
method up (line 9) | public function up()
FILE: database/migrations/2019_03_05_000000_create_contacts_table.php
class CreateContactsTable (line 7) | class CreateContactsTable extends Migration
method up (line 9) | public function up()
FILE: database/migrations/2019_03_05_000000_create_organizations_table.php
class CreateOrganizationsTable (line 7) | class CreateOrganizationsTable extends Migration
method up (line 9) | public function up()
FILE: database/migrations/2019_03_05_000000_create_password_resets_table.php
class CreatePasswordResetsTable (line 7) | class CreatePasswordResetsTable extends Migration
method up (line 9) | public function up()
FILE: database/migrations/2019_03_05_000000_create_users_table.php
class CreateUsersTable (line 7) | class CreateUsersTable extends Migration
method up (line 9) | public function up()
FILE: database/seeds/DatabaseSeeder.php
class DatabaseSeeder (line 9) | class DatabaseSeeder extends Seeder
method run (line 11) | public function run()
FILE: resources/js/utils.js
function filesize (line 1) | function filesize(size) {
function toFormData (line 11) | function toFormData(values = {}, method = 'POST') {
FILE: tests/CreatesApplication.php
type CreatesApplication (line 7) | trait CreatesApplication
method createApplication (line 14) | public function createApplication()
FILE: tests/Feature/ContactsTest.php
class ContactsTest (line 12) | class ContactsTest extends TestCase
method setUp (line 16) | protected function setUp(): void
method test_can_view_contacts (line 31) | public function test_can_view_contacts()
method test_can_search_for_contacts (line 50) | public function test_can_search_for_contacts()
method test_cannot_view_deleted_contacts (line 69) | public function test_cannot_view_deleted_contacts()
method test_can_filter_to_view_deleted_contacts (line 81) | public function test_can_filter_to_view_deleted_contacts()
FILE: tests/Feature/OrganizationsTest.php
class OrganizationsTest (line 11) | class OrganizationsTest extends TestCase
method setUp (line 15) | protected function setUp(): void
method test_can_view_organizations (line 30) | public function test_can_view_organizations()
method test_can_search_for_organizations (line 48) | public function test_can_search_for_organizations()
method test_cannot_view_deleted_organizations (line 64) | public function test_cannot_view_deleted_organizations()
method test_can_filter_to_view_deleted_organizations (line 76) | public function test_can_filter_to_view_deleted_organizations()
FILE: tests/TestCase.php
class TestCase (line 10) | abstract class TestCase extends BaseTestCase
method setUp (line 14) | protected function setUp(): void
Condensed preview — 136 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (243K chars).
[
{
"path": ".editorconfig",
"chars": 213,
"preview": "root = true\n\n[*]\ncharset = utf-8\nend_of_line = lf\ninsert_final_newline = true\nindent_style = space\nindent_size = 4\ntrim_"
},
{
"path": ".eslintrc.js",
"chars": 272,
"preview": "module.exports = {\n extends: ['eslint:recommended'],\n parser: 'babel-eslint',\n parserOptions: {\n sourceType: 'modu"
},
{
"path": ".gitattributes",
"chars": 111,
"preview": "* text=auto\n*.css linguist-vendored\n*.scss linguist-vendored\n*.js linguist-vendored\nCHANGELOG.md export-ignore\n"
},
{
"path": ".gitignore",
"chars": 248,
"preview": "/node_modules\n/public/css\n/public/hot\n/public/js\n/public/mix-manifest.json\n/public/storage\n/storage/*.key\n/database/*.sq"
},
{
"path": ".prettierrc",
"chars": 63,
"preview": "{\n \"printWidth\": 80,\n \"singleQuote\": true,\n \"tabWidth\": 2\n}\n"
},
{
"path": "LICENSE",
"chars": 1090,
"preview": "MIT License\n\nCopyright (c) Jonathan Reinink <jonathan@reinink.ca>\n\nPermission is hereby granted, free of charge, to any "
},
{
"path": "Procfile",
"chars": 43,
"preview": "web: vendor/bin/heroku-php-apache2 public/\n"
},
{
"path": "app/Account.php",
"chars": 378,
"preview": "<?php\n\nnamespace App;\n\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\n\nclass Account extends Model\n{\n public function "
},
{
"path": "app/Console/Kernel.php",
"chars": 848,
"preview": "<?php\n\nnamespace App\\Console;\n\nuse Illuminate\\Console\\Scheduling\\Schedule;\nuse Illuminate\\Foundation\\Console\\Kernel as C"
},
{
"path": "app/Contact.php",
"chars": 1318,
"preview": "<?php\n\nnamespace App;\n\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\n\nclass Contact extends Model\n{\n use SoftDeletes;"
},
{
"path": "app/Exceptions/Handler.php",
"chars": 1654,
"preview": "<?php\n\nnamespace App\\Exceptions;\n\nuse Throwable;\nuse Inertia\\Inertia;\nuse Illuminate\\Support\\Facades\\App;\nuse Illuminate"
},
{
"path": "app/Http/Controllers/Auth/ForgotPasswordController.php",
"chars": 834,
"preview": "<?php\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse App\\Http\\Controllers\\Controller;\nuse Illuminate\\Foundation\\Auth\\SendsPa"
},
{
"path": "app/Http/Controllers/Auth/LoginController.php",
"chars": 1057,
"preview": "<?php\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse Inertia\\Inertia;\nuse Illuminate\\Http\\Request;\nuse Illuminate\\Support\\Fa"
},
{
"path": "app/Http/Controllers/Auth/RegisterController.php",
"chars": 1891,
"preview": "<?php\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse App\\User;\nuse App\\Http\\Controllers\\Controller;\nuse Illuminate\\Support\\F"
},
{
"path": "app/Http/Controllers/Auth/ResetPasswordController.php",
"chars": 952,
"preview": "<?php\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse App\\Http\\Controllers\\Controller;\nuse Illuminate\\Foundation\\Auth\\ResetsP"
},
{
"path": "app/Http/Controllers/Auth/VerificationController.php",
"chars": 1071,
"preview": "<?php\n\nnamespace App\\Http\\Controllers\\Auth;\n\nuse App\\Http\\Controllers\\Controller;\nuse Illuminate\\Foundation\\Auth\\Verifie"
},
{
"path": "app/Http/Controllers/ContactsController.php",
"chars": 4559,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse App\\Contact;\nuse Inertia\\Inertia;\nuse Illuminate\\Validation\\Rule;\nuse Illumi"
},
{
"path": "app/Http/Controllers/Controller.php",
"chars": 361,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Illuminate\\Foundation\\Bus\\DispatchesJobs;\nuse Illuminate\\Routing\\Controller "
},
{
"path": "app/Http/Controllers/DashboardController.php",
"chars": 205,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Inertia\\Inertia;\n\nclass DashboardController extends Controller\n{\n public "
},
{
"path": "app/Http/Controllers/ImagesController.php",
"chars": 214,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse League\\Glide\\Server;\n\nclass ImagesController extends Controller\n{\n public"
},
{
"path": "app/Http/Controllers/OrganizationsController.php",
"chars": 3289,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Inertia\\Inertia;\nuse App\\Organization;\nuse Illuminate\\Support\\Facades\\Auth;\n"
},
{
"path": "app/Http/Controllers/ReportsController.php",
"chars": 201,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse Inertia\\Inertia;\n\nclass ReportsController extends Controller\n{\n public fu"
},
{
"path": "app/Http/Controllers/UsersController.php",
"chars": 4120,
"preview": "<?php\n\nnamespace App\\Http\\Controllers;\n\nuse App\\User;\nuse Inertia\\Inertia;\nuse Illuminate\\Validation\\Rule;\nuse Illuminat"
},
{
"path": "app/Http/Kernel.php",
"chars": 2883,
"preview": "<?php\n\nnamespace App\\Http;\n\nuse Illuminate\\Foundation\\Http\\Kernel as HttpKernel;\n\nclass Kernel extends HttpKernel\n{\n "
},
{
"path": "app/Http/Middleware/Authenticate.php",
"chars": 464,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Auth\\Middleware\\Authenticate as Middleware;\n\nclass Authenticate ex"
},
{
"path": "app/Http/Middleware/CheckForMaintenanceMode.php",
"chars": 335,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\CheckForMaintenanceMode as Middleware;\n"
},
{
"path": "app/Http/Middleware/EncryptCookies.php",
"chars": 294,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Cookie\\Middleware\\EncryptCookies as Middleware;\n\nclass EncryptCook"
},
{
"path": "app/Http/Middleware/RedirectIfAuthenticated.php",
"chars": 519,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Closure;\nuse Illuminate\\Support\\Facades\\Auth;\n\nclass RedirectIfAuthenticated\n"
},
{
"path": "app/Http/Middleware/TrimStrings.php",
"chars": 340,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\TrimStrings as Middleware;\n\nclass TrimS"
},
{
"path": "app/Http/Middleware/TrustProxies.php",
"chars": 440,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Http\\Request;\nuse Fideloper\\Proxy\\TrustProxies as Middleware;\n\ncla"
},
{
"path": "app/Http/Middleware/VerifyCsrfToken.php",
"chars": 463,
"preview": "<?php\n\nnamespace App\\Http\\Middleware;\n\nuse Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken as Middleware;\n\nclass V"
},
{
"path": "app/Model.php",
"chars": 506,
"preview": "<?php\n\nnamespace App;\n\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\nuse Illuminate\\Database\\Eloquent\\Model as Eloquent;"
},
{
"path": "app/Organization.php",
"chars": 690,
"preview": "<?php\n\nnamespace App;\n\nuse Illuminate\\Database\\Eloquent\\SoftDeletes;\n\nclass Organization extends Model\n{\n use SoftDel"
},
{
"path": "app/Providers/AppServiceProvider.php",
"chars": 5131,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Inertia\\Inertia;\nuse League\\Glide\\Server;\nuse Carbon\\CarbonImmutable;\nuse Illuminat"
},
{
"path": "app/Providers/AuthServiceProvider.php",
"chars": 578,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Gate;\nuse Illuminate\\Foundation\\Support\\Providers\\AuthSe"
},
{
"path": "app/Providers/BroadcastServiceProvider.php",
"chars": 380,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\ServiceProvider;\nuse Illuminate\\Support\\Facades\\Broadcast;\n\nclas"
},
{
"path": "app/Providers/EventServiceProvider.php",
"chars": 710,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Event;\nuse Illuminate\\Auth\\Events\\Registered;\nuse Illumi"
},
{
"path": "app/Providers/RouteServiceProvider.php",
"chars": 1529,
"preview": "<?php\n\nnamespace App\\Providers;\n\nuse Illuminate\\Support\\Facades\\Route;\nuse Illuminate\\Foundation\\Support\\Providers\\Route"
},
{
"path": "app/User.php",
"chars": 2454,
"preview": "<?php\n\nnamespace App;\n\nuse League\\Glide\\Server;\nuse Illuminate\\Support\\Facades\\App;\nuse Illuminate\\Support\\Facades\\URL;\n"
},
{
"path": "artisan",
"chars": 1686,
"preview": "#!/usr/bin/env php\n<?php\n\ndefine('LARAVEL_START', microtime(true));\n\n/*\n|-----------------------------------------------"
},
{
"path": "bootstrap/app.php",
"chars": 1620,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Create The Application\n|--------"
},
{
"path": "bootstrap/cache/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "composer.json",
"chars": 1779,
"preview": "{\n \"name\": \"laravel/laravel\",\n \"description\": \"The Laravel Framework.\",\n \"keywords\": [\n \"framework\",\n \"laravel\""
},
{
"path": "config/app.php",
"chars": 9174,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Applicatio"
},
{
"path": "config/auth.php",
"chars": 3796,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Authentica"
},
{
"path": "config/broadcasting.php",
"chars": 1601,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Br"
},
{
"path": "config/cache.php",
"chars": 3066,
"preview": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n /*\n |--------------------------------------------------------------"
},
{
"path": "config/database.php",
"chars": 5046,
"preview": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n /*\n |--------------------------------------------------------------"
},
{
"path": "config/filesystems.php",
"chars": 2120,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Fi"
},
{
"path": "config/hashing.php",
"chars": 1571,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Ha"
},
{
"path": "config/logging.php",
"chars": 2896,
"preview": "<?php\n\nuse Monolog\\Handler\\NullHandler;\nuse Monolog\\Handler\\StreamHandler;\nuse Monolog\\Handler\\SyslogUdpHandler;\n\nreturn"
},
{
"path": "config/mail.php",
"chars": 4676,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Mail Drive"
},
{
"path": "config/queue.php",
"chars": 2717,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Default Qu"
},
{
"path": "config/sentry.php",
"chars": 582,
"preview": "<?php\n\nreturn [\n\n 'dsn' => env('SENTRY_LARAVEL_DSN', env('SENTRY_DSN')),\n\n // capture release as git sha\n // 'r"
},
{
"path": "config/services.php",
"chars": 950,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Third Part"
},
{
"path": "config/session.php",
"chars": 6981,
"preview": "<?php\n\nuse Illuminate\\Support\\Str;\n\nreturn [\n\n /*\n |--------------------------------------------------------------"
},
{
"path": "config/view.php",
"chars": 1053,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | View Stora"
},
{
"path": "database/.gitignore",
"chars": 9,
"preview": "*.sqlite\n"
},
{
"path": "database/factories/ContactFactory.php",
"chars": 486,
"preview": "<?php\n\nuse Faker\\Generator as Faker;\n\n$factory->define(App\\Contact::class, function (Faker $faker) {\n return [\n "
},
{
"path": "database/factories/OrganizationFactory.php",
"chars": 435,
"preview": "<?php\n\nuse Faker\\Generator as Faker;\n\n$factory->define(App\\Organization::class, function (Faker $faker) {\n return [\n "
},
{
"path": "database/factories/UserFactory.php",
"chars": 780,
"preview": "<?php\n\nuse Faker\\Generator as Faker;\nuse Illuminate\\Support\\Str;\n\n/*\n|--------------------------------------------------"
},
{
"path": "database/migrations/2019_03_05_000000_create_accounts_table.php",
"chars": 409,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2019_03_05_000000_create_contacts_table.php",
"chars": 997,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2019_03_05_000000_create_organizations_table.php",
"chars": 888,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2019_03_05_000000_create_password_resets_table.php",
"chars": 450,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/migrations/2019_03_05_000000_create_users_table.php",
"chars": 794,
"preview": "<?php\n\nuse Illuminate\\Support\\Facades\\Schema;\nuse Illuminate\\Database\\Schema\\Blueprint;\nuse Illuminate\\Database\\Migratio"
},
{
"path": "database/seeds/DatabaseSeeder.php",
"chars": 939,
"preview": "<?php\n\nuse App\\User;\nuse App\\Account;\nuse App\\Contact;\nuse App\\Organization;\nuse Illuminate\\Database\\Seeder;\n\nclass Data"
},
{
"path": "jsconfig.json",
"chars": 106,
"preview": "{\n \"compilerOptions\": {\n \"baseUrl\": \".\",\n \"paths\": {\n \"@/*\": [\"./resources/js/*\"]\n }\n }\n}\n"
},
{
"path": "package.json",
"chars": 1431,
"preview": "{\n \"private\": true,\n \"scripts\": {\n \"dev\": \"npm run development\",\n \"development\": \"cross-env NODE_ENV=development"
},
{
"path": "phpunit.xml",
"chars": 1264,
"preview": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<phpunit backupGlobals=\"false\"\n backupStaticAttributes=\"false\"\n b"
},
{
"path": "public/.htaccess",
"chars": 593,
"preview": "<IfModule mod_rewrite.c>\n <IfModule mod_negotiation.c>\n Options -MultiViews -Indexes\n </IfModule>\n\n Rewr"
},
{
"path": "public/index.php",
"chars": 1823,
"preview": "<?php\n\n/**\n * Laravel - A PHP Framework For Web Artisans\n *\n * @package Laravel\n * @author Taylor Otwell <taylor@lara"
},
{
"path": "public/robots.txt",
"chars": 24,
"preview": "User-agent: *\nDisallow:\n"
},
{
"path": "public/web.config",
"chars": 1194,
"preview": "<!--\n Rewrites requires Microsoft URL Rewrite Module for IIS\n Download: https://www.microsoft.com/en-us/download/d"
},
{
"path": "readme.md",
"chars": 1529,
"preview": "# Ping CRM Svelte\n\nA demo application to illustrate how [Inertia.js](https://inertiajs.com/) works with [Laravel](https:"
},
{
"path": "resources/css/app.css",
"chars": 215,
"preview": "/* Reset */\n@import 'reset';\n@import 'tailwindcss/base';\n@import 'tailwindcss/components';\n\n/* Components */\n@import 'bu"
},
{
"path": "resources/css/buttons.css",
"chars": 659,
"preview": ".btn-indigo {\n @apply px-6 py-3 rounded bg-indigo-700 text-white text-sm font-bold whitespace-no-wrap;\n\n &:hover,\n &:"
},
{
"path": "resources/css/form.css",
"chars": 1352,
"preview": ".form-label {\n @apply .mb-2 .block .text-gray-800 .select-none;\n}\n\n.form-input,\n.form-textarea,\n.form-select {\n @apply"
},
{
"path": "resources/css/nprogress.css",
"chars": 1569,
"preview": "/* Make clicks pass-through */\n#nprogress {\n pointer-events: none;\n}\n\n#nprogress .bar {\n background: theme('colors.ind"
},
{
"path": "resources/css/reset.css",
"chars": 122,
"preview": "html {\n line-height: 1.15;\n}\n\ninput,\nselect,\ntextarea,\nbutton,\ndiv,\na {\n &:focus,\n &:active {\n outline: none;\n }\n"
},
{
"path": "resources/js/Pages/Auth/Login.svelte",
"chars": 3198,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import {page} from '@inertiajs/inertia-svelte';\n impor"
},
{
"path": "resources/js/Pages/Contacts/Create.svelte",
"chars": 6352,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import { InertiaLink, page } from '@inertiajs/inertia-sve"
},
{
"path": "resources/js/Pages/Contacts/Edit.svelte",
"chars": 7491,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import { InertiaLink, page } from '@inertiajs/inertia-sve"
},
{
"path": "resources/js/Pages/Contacts/Index.svelte",
"chars": 5131,
"preview": "<script>\n import Helmet from '@/Shared/Helmet.svelte';\n import { InertiaLink, page } from '@inertiajs/inertia-svel"
},
{
"path": "resources/js/Pages/Dashboard/Index.svelte",
"chars": 1136,
"preview": "<script>\n import {InertiaLink} from '@inertiajs/inertia-svelte';\n import Layout from '@/Shared/Layout.svelte';\n "
},
{
"path": "resources/js/Pages/Error.svelte",
"chars": 863,
"preview": "<script>\n import Helmet from '@/Shared/Helmet.svelte';\n\n export let status;\n\n let title = {\n 503: '503: "
},
{
"path": "resources/js/Pages/Organizations/Create.svelte",
"chars": 5162,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import { InertiaLink, page } from '@inertiajs/inertia-sve"
},
{
"path": "resources/js/Pages/Organizations/Edit.svelte",
"chars": 10043,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import { InertiaLink, page } from '@inertiajs/inertia-sve"
},
{
"path": "resources/js/Pages/Organizations/Index.svelte",
"chars": 4977,
"preview": "<script>\n import { InertiaLink, page } from '@inertiajs/inertia-svelte';\n import Helmet from '@/Shared/Helmet.svel"
},
{
"path": "resources/js/Pages/Reports/Index.svelte",
"chars": 243,
"preview": "<script>\n import Helmet from '@/Shared/Helmet.svelte';\n import Layout from '@/Shared/Layout.svelte';\n</script>\n\n<H"
},
{
"path": "resources/js/Pages/Users/Create.svelte",
"chars": 4744,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import { InertiaLink, page } from '@inertiajs/inertia-sve"
},
{
"path": "resources/js/Pages/Users/Edit.svelte",
"chars": 6102,
"preview": "<script>\n import { Inertia } from '@inertiajs/inertia';\n import { InertiaLink, page } from '@inertiajs/inertia-sve"
},
{
"path": "resources/js/Pages/Users/Index.svelte",
"chars": 4869,
"preview": "<script>\n import { InertiaLink, page } from '@inertiajs/inertia-svelte';\n import Helmet from '@/Shared/Helmet.svel"
},
{
"path": "resources/js/Shared/BottomHeader.svelte",
"chars": 2186,
"preview": "<script>\n import { InertiaLink, page } from '@inertiajs/inertia-svelte';\n import Icon from '@/Shared/Icon.svelte';"
},
{
"path": "resources/js/Shared/DeleteButton.svelte",
"chars": 198,
"preview": "<script>\n export let onDelete;\n</script>\n\n<button\n class=\"text-red-600 focus:outline-none hover:underline\"\n tab"
},
{
"path": "resources/js/Shared/FileInput.svelte",
"chars": 2082,
"preview": "<script>\n import { filesize } from '@/utils';\n\n export let className = '';\n export let name;\n export let lab"
},
{
"path": "resources/js/Shared/FlashMessages.svelte",
"chars": 3922,
"preview": "<script>\n import {page} from '@inertiajs/inertia-svelte';\n\n let { flash, errors } = $page;\n $: flash = $page.fl"
},
{
"path": "resources/js/Shared/Helmet.svelte",
"chars": 135,
"preview": "<script>\n export let title;\n</script>\n\n<svelte:head>\n <title>{title ? `${title} | Ping CRM` : 'Ping CRM'}</title>\n"
},
{
"path": "resources/js/Shared/Icon.svelte",
"chars": 4666,
"preview": "<script>\n export let name;\n export let className = '';\n</script>\n\n{#if name === 'apple'}\n <svg\n class={c"
},
{
"path": "resources/js/Shared/Layout.svelte",
"chars": 906,
"preview": "<script>\n import MainMenu from '@/Shared/MainMenu.svelte';\n import FlashMessages from '@/Shared/FlashMessages.svel"
},
{
"path": "resources/js/Shared/LoadingButton.svelte",
"chars": 342,
"preview": "<script>\n export let loading;\n export let className = '';\n\n $: props = (({loading, className, ...rest}) => rest"
},
{
"path": "resources/js/Shared/Logo.svelte",
"chars": 3396,
"preview": "<svg {...$$props} viewBox=\"0 0 1131 266\" xmlns=\"http://www.w3.org/2000/svg\">\n <g fill=\"currentColor\" fill-rule=\"nonze"
},
{
"path": "resources/js/Shared/MainMenu.svelte",
"chars": 421,
"preview": "<script>\n export let className = '';\n\n import MainMenuItem from '@/Shared/MainMenuItem.svelte';\n</script>\n\n<div cl"
},
{
"path": "resources/js/Shared/MainMenuItem.svelte",
"chars": 638,
"preview": "<script>\n import {InertiaLink} from '@inertiajs/inertia-svelte';\n import Icon from '@/Shared/Icon.svelte';\n\n ex"
},
{
"path": "resources/js/Shared/Pagination.svelte",
"chars": 995,
"preview": "<script>\n import { InertiaLink } from '@inertiajs/inertia-svelte';\n import classNames from 'classnames';\n\n expo"
},
{
"path": "resources/js/Shared/SearchFilter.svelte",
"chars": 3967,
"preview": "<script>\n import { onMount } from 'svelte';\n import { Inertia } from '@inertiajs/inertia';\n import { page } fro"
},
{
"path": "resources/js/Shared/SelectInput.svelte",
"chars": 711,
"preview": "<script>\n export let label;\n export let name;\n export let className = '';\n export let onChange;\n export l"
},
{
"path": "resources/js/Shared/TextInput.svelte",
"chars": 631,
"preview": "<script>\n export let onChange;\n export let label;\n export let name;\n export let className = '';\n export l"
},
{
"path": "resources/js/Shared/TopHeader.svelte",
"chars": 1144,
"preview": "<script>\n import {InertiaLink} from '@inertiajs/inertia-svelte';\n import Logo from '@/Shared/Logo.svelte';\n imp"
},
{
"path": "resources/js/Shared/TrashedMessage.svelte",
"chars": 648,
"preview": "<script>\n import Icon from '@/Shared/Icon.svelte';\n\n export let onRestore;\n</script>\n\n<div class=\"max-w-3xl mb-6 p"
},
{
"path": "resources/js/app.js",
"chars": 404,
"preview": "import { InertiaApp } from '@inertiajs/inertia-svelte';\nimport * as Sentry from '@sentry/browser';\n\nSentry.init({\n dsn:"
},
{
"path": "resources/js/utils.js",
"chars": 738,
"preview": "export function filesize(size) {\n const i = Math.floor(Math.log(size) / Math.log(1024));\n return (\n (size / Math.po"
},
{
"path": "resources/lang/en/auth.php",
"chars": 617,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Authentica"
},
{
"path": "resources/lang/en/pagination.php",
"chars": 534,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Pagination"
},
{
"path": "resources/lang/en/passwords.php",
"chars": 788,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Password R"
},
{
"path": "resources/lang/en/validation.php",
"chars": 7511,
"preview": "<?php\n\nreturn [\n\n /*\n |--------------------------------------------------------------------------\n | Validation"
},
{
"path": "resources/views/app.blade.php",
"chars": 408,
"preview": "<!DOCTYPE html>\n<html class=\"h-full bg-gray-200\">\n<head>\n <meta charset=\"utf-8\">\n <meta name=\"viewport\" content=\"w"
},
{
"path": "routes/api.php",
"chars": 528,
"preview": "<?php\n\nuse Illuminate\\Http\\Request;\n\n/*\n|--------------------------------------------------------------------------\n| AP"
},
{
"path": "routes/channels.php",
"chars": 508,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Broadcast Channels\n|------------"
},
{
"path": "routes/console.php",
"chars": 553,
"preview": "<?php\n\nuse Illuminate\\Foundation\\Inspiring;\n\n/*\n|-----------------------------------------------------------------------"
},
{
"path": "routes/web.php",
"chars": 3499,
"preview": "<?php\n\n/*\n|--------------------------------------------------------------------------\n| Web Routes\n|--------------------"
},
{
"path": "server.php",
"chars": 563,
"preview": "<?php\n\n/**\n * Laravel - A PHP Framework For Web Artisans\n *\n * @package Laravel\n * @author Taylor Otwell <taylor@lara"
},
{
"path": "storage/app/.gitignore",
"chars": 23,
"preview": "*\n!public/\n!.gitignore\n"
},
{
"path": "storage/debugbar/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "storage/framework/.gitignore",
"chars": 103,
"preview": "config.php\nroutes.php\nschedule-*\ncompiled.php\nservices.json\nevents.scanned.php\nroutes.scanned.php\ndown\n"
},
{
"path": "storage/framework/cache/.gitignore",
"chars": 21,
"preview": "*\n!data/\n!.gitignore\n"
},
{
"path": "storage/framework/sessions/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "storage/framework/testing/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "storage/framework/views/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "storage/logs/.gitignore",
"chars": 14,
"preview": "*\n!.gitignore\n"
},
{
"path": "tailwind.config.js",
"chars": 390,
"preview": "module.exports = {\n theme: {\n extend: {\n boxShadow: theme => ({\n outline: '0 0 0 2px ' + theme('colors.i"
},
{
"path": "tests/CreatesApplication.php",
"chars": 380,
"preview": "<?php\n\nnamespace Tests;\n\nuse Illuminate\\Contracts\\Console\\Kernel;\n\ntrait CreatesApplication\n{\n /**\n * Creates the"
},
{
"path": "tests/Feature/ContactsTest.php",
"chars": 2708,
"preview": "<?php\n\nnamespace Tests\\Feature;\n\nuse App\\User;\nuse App\\Account;\nuse App\\Contact;\nuse Tests\\TestCase;\nuse Illuminate\\Foun"
},
{
"path": "tests/Feature/OrganizationsTest.php",
"chars": 2780,
"preview": "<?php\n\nnamespace Tests\\Feature;\n\nuse App\\User;\nuse App\\Account;\nuse Tests\\TestCase;\nuse App\\Organization;\nuse Illuminate"
},
{
"path": "tests/TestCase.php",
"chars": 1367,
"preview": "<?php\n\nnamespace Tests;\n\nuse Illuminate\\Support\\Arr;\nuse PHPUnit\\Framework\\Assert;\nuse Illuminate\\Foundation\\Testing\\Tes"
},
{
"path": "webpack.mix.js",
"chars": 1768,
"preview": "const cssImport = require('postcss-import');\nconst cssNesting = require('postcss-nesting');\nconst mix = require('laravel"
}
]
About this extraction
This page contains the full source code of the zgabievi/pingcrm-svelte GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 136 files (220.4 KB), approximately 54.0k tokens, and a symbol index with 129 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.