-
Notifications
You must be signed in to change notification settings - Fork 33
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #334 from ilhm344/2.0
Update home.blade.php
- Loading branch information
Showing
9 changed files
with
1,081 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,184 @@ | ||
<x-page | ||
title="Configuration" | ||
:sectionMenu="[ | ||
'Sections' => [ | ||
['url' => '#config', 'label' => 'Config'], | ||
['url' => '#home-page', 'label' => 'Home page'], | ||
] | ||
]" | ||
> | ||
|
||
<x-sub-title id="config">Config</x-sub-title> | ||
|
||
<x-code language="php"> | ||
use MoonShine\Exceptions\MoonShineNotFoundException; // [tl! focus:start] | ||
use MoonShine\Forms\LoginForm; | ||
use MoonShine\Http\Middleware\Authenticate; | ||
use MoonShine\Http\Middleware\SecurityHeadersMiddleware; | ||
use MoonShine\Models\MoonshineUser; | ||
use MoonShine\MoonShineLayout; | ||
use MoonShine\Pages\ProfilePage; // [tl! focus:end] | ||
|
||
return [ // [tl! focus] | ||
# The directory where the resources are located | ||
'dir' => 'app/MoonShine', // [tl! focus] | ||
# If the directory is changed, the namespace must also be changed according to the psr-4 | ||
'namespace' => 'App\MoonShine', // [tl! focus] | ||
|
||
# Admin panel header | ||
'title' => env('MOONSHINE_TITLE', 'MoonShine'), // [tl! focus] | ||
# You can change the logo by specifying a path (example - /images/logo.svg) | ||
'logo' => env('MOONSHINE_LOGO'), // [tl! focus] | ||
'logo_small' => env('MOONSHINE_LOGO_SMALL'), // [tl! focus] | ||
|
||
'route' => [ // [tl! focus] | ||
# If the domain is different from the site domain | ||
'domain' => env('MOONSHINE_URL', ''), | ||
# Which path will be used to access the control panel | ||
# If the value is left blank, the panel will be accessible from / | ||
'prefix' => env('MOONSHINE_ROUTE_PREFIX', 'admin'), // [tl! focus] | ||
# Home Page Routing Name | ||
'index' => 'moonshine.index', // [tl! focus] | ||
# Prefix of url formation for pages | ||
'single_page_prefix' => 'page', // [tl! focus] | ||
# Middlewares groups in the panel | ||
'middlewares' => [ // [tl! focus] | ||
SecurityHeadersMiddleware::class, // [tl! focus] | ||
], // [tl! focus] | ||
# You can change the exception for 404 (for ModelNotFound you need to implement it yourself) | ||
'notFoundHandler' => MoonShineNotFoundException::class, // [tl! focus] | ||
], | ||
|
||
# If you want to replace MoonshineUser with your model, you can disable the default migrations | ||
'use_migrations' => true, // [tl! focus] | ||
# Notification On/Off | ||
'use_notifications' => true, // [tl! focus] | ||
|
||
# Class for rendering the main page template | ||
'layout' => MoonShineLayout::class, // [tl! focus] | ||
|
||
# Default Filesystem Disk | ||
'disk' => 'public', // [tl! focus] | ||
|
||
'forms' => [ // [tl! focus] | ||
# form of authentication | ||
'login' => LoginForm::class // [tl! focus] | ||
], // [tl! focus] | ||
|
||
'pages' => [ // [tl! focus] | ||
# Dashboard page, the default page is created when MoonShine is installed | ||
'dashboard' => App\MoonShine\Pages\Dashboard::class, // [tl! focus] | ||
# Profile page | ||
'profile' => ProfilePage::class // [tl! focus] | ||
], // [tl! focus] | ||
|
||
# Default import and export from ModelResource | ||
'model_resources' => [ // [tl! focus] | ||
'default_with_import' => true, // [tl! focus] | ||
'default_with_export' => true, // [tl! focus] | ||
], // [tl! focus] | ||
|
||
'auth' => [ // [tl! focus] | ||
# On/Off Authentication. If false, the panel will be available to everyone | ||
'enable' => true, // [tl! focus] | ||
'middleware' => Authenticate::class, // [tl! focus] | ||
'fields' => [ // [tl! focus:start] | ||
'username' => 'email', | ||
'password' => 'password', | ||
'name' => 'name', | ||
'avatar' => 'avatar', | ||
], // [tl! focus:end] | ||
# If you use your own guard, the provider | ||
'guard' => 'moonshine', // [tl! focus:start] | ||
'guards' => [ | ||
'moonshine' => [ | ||
'driver' => 'session', | ||
'provider' => 'moonshine', | ||
], | ||
], | ||
'providers' => [ | ||
'moonshine' => [ | ||
'driver' => 'eloquent', | ||
'model' => MoonshineUser::class, | ||
], | ||
], // [tl! focus:end] | ||
], // [tl! focus] | ||
# Possible translation options | ||
'locales' => [ // [tl! focus:start] | ||
'en', | ||
'ru', | ||
], // [tl! focus:end] | ||
|
||
'tinymce' => [ // [tl! focus] | ||
# File Manager Root, details in the Fields section | ||
'file_manager' => false, // [tl! focus] | ||
'token' => env('MOONSHINE_TINYMCE_TOKEN', ''), // [tl! focus] | ||
'version' => env('MOONSHINE_TINYMCE_VERSION', '6'), // [tl! focus] | ||
], // [tl! focus] | ||
|
||
# Authentication via social networks and socialite, list the drivers and specify the logo | ||
'socialite' => [ // [tl! focus:start] | ||
// 'driver' => 'path_to_image_for_button' | ||
], // [tl! focus:end] | ||
]; // [tl! focus] | ||
</x-code> | ||
|
||
<x-p> | ||
For basic use it is sufficient to edit the parameters below: | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
// ... | ||
|
||
return [ | ||
// ... | ||
|
||
'title' => env('MOONSHINE_TITLE', 'MoonShine'), // [tl! focus] | ||
'logo' => env('MOONSHINE_LOGO', ''), // [tl! focus] | ||
'logo_small' => env('MOONSHINE_LOGO_SMALL'), // [tl! focus] | ||
|
||
'route' => [ | ||
'prefix' => env('MOONSHINE_ROUTE_PREFIX', 'admin'), // [tl! focus] | ||
], | ||
|
||
// ... | ||
]; | ||
</x-code> | ||
|
||
<x-sub-title id="home-page">Home page</x-sub-title> | ||
|
||
<x-p> | ||
If you need to override the home page in the <strong>MoonShine admin panel</strong>, | ||
this can be done using the static method <code>home()</code> of the class <em>MoonShine</em> | ||
at the service provider <code>MoonShineServiceProvider</code>. | ||
</x-p> | ||
|
||
<x-code language="php"> | ||
home(string|Closure $homeClass) | ||
</x-code> | ||
|
||
<x-code language="php"> | ||
use App\MoonShine\Pages\CustomPage; | ||
use App\MoonShine\Resources\PostResource; | ||
use MoonShine\Providers\MoonShineApplicationServiceProvider; | ||
use MoonShine\MoonShine; | ||
|
||
class MoonShineServiceProvider extends MoonShineApplicationServiceProvider | ||
{ | ||
public function register(): void | ||
{ | ||
MoonShine::home(CustomPage::class); // [tl! focus] | ||
// or | ||
MoonShine::home(PostResource::class); // [tl! focus] | ||
// or | ||
MoonShine::home(function () { | ||
return PostResource::class; | ||
}); // [tl! focus:-2] | ||
} | ||
|
||
//... | ||
|
||
} | ||
</x-code> | ||
|
||
</x-page> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,148 @@ | ||
<x-page title="Contribution Guide" :sectionMenu="[ | ||
'Sections' => [ | ||
['url' => '#dev-guide', 'label' => 'Instructions for developers'], | ||
['url' => '#pr', 'label' => 'How to make a pull request'], | ||
] | ||
]"> | ||
|
||
<x-sub-title>What can I do to help?</x-sub-title> | ||
|
||
<x-p> | ||
The community needs active users. You can help in many ways: | ||
</x-p> | ||
|
||
<x-ul :items="[ | ||
'Complementing code', | ||
'Front-end development', | ||
'Submit bug reports', | ||
'Help other users understand the details', | ||
'Supplement documentation', | ||
'Publicize the project'. | ||
]"></x-ul> | ||
|
||
<x-sub-title>Let's use</x-sub-title> | ||
|
||
<x-ul :items="[ | ||
'Blade', | ||
'TailwindCSS', | ||
'AlpineJs', | ||
]"></x-ul> | ||
|
||
<x-sub-title>Where do we start?</x-sub-title> | ||
|
||
<x-p> | ||
There is a product that is already functioning, fully functional and testable. Functional doesn't mean great, | ||
so our job is to make it better. | ||
</x-p> | ||
|
||
<x-sub-title>Pull requests</x-sub-title> | ||
|
||
<x-p> | ||
You can suggest new features or improvements for <strong>MoonShine</strong>! Errors and bugs - all this can be fixed and sent for revision. | ||
I am also glad to have new specialists for open source project development. | ||
</x-p> | ||
|
||
<x-sub-title>Where to discuss the development?</x-sub-title> | ||
|
||
<x-p> | ||
A separate chat in telegram has been created for active participants of the project. If you are ready to take part in the development, | ||
then join - <x-link link="https://t.me/laravel_chat/24568">MoonShine</x-link>. | ||
</x-p> | ||
|
||
|
||
<x-sub-title>If you find a mistake</x-sub-title> | ||
|
||
<x-p> | ||
1. You have enough experience to offer a solution. | ||
I will be extremely glad to have your PR with a description of the error and an option to fix it.<br /> | ||
2. If you don't know how to solve the problem - create GitHub issues and we will fix the problem soon. | ||
|
||
</x-p> | ||
|
||
<x-moonshine::alert type="warning" icon="heroicons.information-circle"> | ||
It is important that your pr passes all platform tests and has a detailed description, | ||
so that it is clear to everyone involved in the development what exactly happened. | ||
</x-moonshine::alert> | ||
|
||
|
||
<x-sub-title>Main branch</x-sub-title> | ||
|
||
<x-p> | ||
At the moment, the main branch <code>2.x</code> | ||
</x-p> | ||
|
||
<x-sub-title>Coding style</x-sub-title> | ||
|
||
<x-p> | ||
<strong>MoonShine</strong> adheres to PSR-12 standard and PSR-4 autoload standard. | ||
</x-p> | ||
|
||
<x-sub-title id="dev-guide">Instructions for developers</x-sub-title> | ||
|
||
<x-moonshine::badge color="green">1</x-moonshine::badge> Create a directory for the project and clone the demo. | ||
|
||
<x-code language="shell"> | ||
git clone [email protected]:moonshine-software/demo-project.git . | ||
</x-code> | ||
|
||
<x-moonshine::badge color="green">2</x-moonshine::badge> Add the <code>packages</code> directory and run the command below. | ||
|
||
<x-code language="shell"> | ||
cd packages && git clone [email protected]:moonshine-software/moonshine.git && cd moonshine && composer install && npm install | ||
</x-code> | ||
|
||
<x-moonshine::badge color="green">3</x-moonshine::badge> Go back to the project directory and in <code>composer.json</code> change the moonshine/moonshine dependency. | ||
|
||
<x-code language="shell"> | ||
"moonshine/moonshine": "2.*.*-dev", | ||
</x-code> | ||
|
||
<x-moonshine::badge color="green">4</x-moonshine::badge> Add in <code>composer.json</code>. | ||
|
||
<x-code language="shell"> | ||
"repositories": [ | ||
{ | ||
"type": "path", | ||
"url": "packages/moonshine", | ||
"options": { | ||
"versions": { | ||
"moonshine/moonshine": "2.*.*-dev" | ||
}, | ||
"symlink": true | ||
} | ||
} | ||
] | ||
</x-code> | ||
|
||
<x-moonshine::badge color="green">5</x-moonshine::badge> Create <code>.env</code> from <code>.env.example</code> (don't forget to create a database) and perform the installation below. | ||
|
||
<x-code language="shell"> | ||
php artisan key:generate | ||
php artisan storage:link | ||
php artisan migrate --seed | ||
php artisan moonshine:user | ||
php artisan serve | ||
</x-code> | ||
|
||
<x-moonshine::badge color="green">#</x-moonshine::badge> Create something useful! | ||
|
||
<x-sub-title id="pr">How do I make a pull request?</x-sub-title> | ||
|
||
<ul class="tree-list"> | ||
<li>Go to the MoonShine repository and click on "Fork"</li> | ||
<li>Make a git clone of your fork</li> | ||
<li>Create a new branch for your changes</li> | ||
<li>Do commits relying on convention <x-link link="https://www.conventionalcommits.org">https://www.conventionalcommits.org</x-link></li> | ||
<li>Make push your changes to your fork</li> | ||
<li>Go to the MoonShine repository again and click "New pull request"</li> | ||
<li>Comment in detail on the changes made in the "Description" field</li> | ||
<li>Expect a review!</li> | ||
</ul> | ||
|
||
<x-sub-title>Any questions?</x-sub-title> | ||
|
||
<x-p> | ||
My name is Danil! Write to me on e-mail <x-link link="mailto:[email protected]">[email protected]</x-link> | ||
</x-p> | ||
|
||
</x-page> |
Oops, something went wrong.