generator-folklore 3.0.5 → 3.0.7
Sign up to get free protection for your applications and to get access to all the features.
- package/lib/generators/build/index.js +1 -1
- package/lib/generators/eslint/index.js +1 -1
- package/lib/generators/intl/index.js +93 -0
- package/lib/generators/laravel-mediatheque/index.js +151 -0
- package/lib/generators/laravel-mediatheque/instructions/ServiceProvider.php +26 -0
- package/lib/generators/laravel-mediatheque/templates/app/Models/Media.php +9 -0
- package/lib/generators/laravel-mediatheque/templates/app/Models/MediaFile.php +9 -0
- package/lib/generators/laravel-panneau/index.js +89 -28
- package/lib/generators/laravel-panneau/instructions/ServiceProvider.php +21 -0
- package/lib/generators/laravel-panneau/instructions/config.php +13 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Repositories/Pages.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Image.php +15 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Blocks/Text.php +12 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Page.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Contracts/Resources/Pages/Home.php +9 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlockResource.php +37 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/BlocksCollection.php +8 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/PageResource.php +47 -0
- package/lib/generators/laravel-panneau/templates/app/Http/Resources/PagesCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Models/Block.php +4 -13
- package/lib/generators/laravel-panneau/templates/app/Models/Page.php +3 -60
- package/lib/generators/laravel-panneau/templates/app/Panneau/Composers/AppComposer.php +50 -0
- package/lib/generators/laravel-panneau/templates/app/{Schemas → Panneau}/Fields/.gitkeep +0 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/AccountController.php +41 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/Controller.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/HomeController.php +16 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/PagesController.php +24 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/UploadController.php +27 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Controllers/UsersController.php +32 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Requests/AccountUpdateRequest.php +29 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Requests/UploadRequest.php +29 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlockResource.php +39 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/BlocksCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/PageResource.php +56 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/PagesCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/UserResource.php +24 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Http/Resources/UsersCollection.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/PanneauServiceProvider.php +74 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Policies/PanneauPolicy.php +32 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/ImageBlock.php +30 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks/TextBlock.php +28 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Blocks.php +45 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages/Page.php +28 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Pages.php +92 -0
- package/lib/generators/laravel-panneau/templates/app/Panneau/Resources/Users.php +57 -0
- package/lib/generators/laravel-panneau/templates/app/Repositories/Pages.php +42 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/ImageBlock.php +27 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Blocks/TextBlock.php +19 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Page.php +10 -0
- package/lib/generators/laravel-panneau/templates/app/Resources/Pages/HomePage.php +10 -0
- package/lib/generators/laravel-panneau/templates/app.blade.php +8 -0
- package/lib/generators/laravel-panneau/templates/config.php +29 -0
- package/lib/generators/laravel-panneau/templates/index.js +32 -0
- package/lib/generators/laravel-panneau/templates/lang/en/panneau.php +66 -0
- package/lib/generators/laravel-panneau/templates/lang/fr/panneau.php +66 -0
- package/lib/generators/laravel-panneau/templates/layout.blade.php +17 -48
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/Panneau.jsx +68 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlug.jsx +68 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/PageSlugLocalized.jsx +43 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/js/components/panneau/fields/index.js +2 -0
- package/lib/generators/laravel-panneau/templates/resources/assets/styles/panneau.scss +2 -0
- package/lib/generators/laravel-panneau/templates/routes.php +30 -0
- package/lib/generators/laravel-project/index.js +519 -0
- package/lib/generators/laravel-project/templates/env +41 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/AppComposer.php +48 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/IntlComposer.php +10 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/MetaComposer.php +48 -0
- package/lib/generators/laravel-project/templates/laravel/app/Composers/RoutesComposer.php +19 -0
- package/lib/generators/laravel-project/templates/laravel/app/Contracts/Repositories/Users.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/app/Contracts/Resources/User.php +10 -0
- package/lib/generators/laravel-project/templates/laravel/app/Http/Controllers/HomeController.php +18 -0
- package/lib/generators/laravel-project/templates/laravel/app/Http/Middleware/TrustProxies.php +28 -0
- package/lib/generators/laravel-project/templates/laravel/app/Http/Resources/UserResource.php +21 -0
- package/lib/generators/laravel-project/templates/laravel/app/Models/User.php +20 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/AppServiceProvider.php +120 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/RouteServiceProvider.php +64 -0
- package/lib/generators/laravel-project/templates/laravel/app/Providers/ViewServiceProvider.php +33 -0
- package/lib/generators/laravel-project/templates/laravel/app/Repositories/Users.php +37 -0
- package/lib/generators/laravel-project/templates/laravel/app/Resources/User.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/config/app.php +216 -0
- package/lib/generators/laravel-project/templates/laravel/config/auth.php +116 -0
- package/lib/generators/laravel-project/templates/laravel/config/image.php +204 -0
- package/lib/generators/laravel-project/templates/laravel/config/services.php +39 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/content.php +5 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/errors.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/meta.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/lang/en/routes.php +4 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/auth.php +19 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/content.php +5 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/errors.php +17 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/meta.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/pagination.php +19 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/passwords.php +22 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/routes.php +12 -0
- package/lib/generators/laravel-project/templates/laravel/lang/fr/validation.php +146 -0
- package/lib/generators/laravel-project/templates/laravel/resources/assets/fonts/.gitkeep +0 -0
- package/lib/generators/laravel-project/templates/laravel/resources/assets/img/.gitkeep +0 -0
- package/lib/generators/laravel-project/templates/laravel/resources/assets/img/folklore.png +0 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/body.blade.php +3 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/gpt.blade.php +16 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/analytics/head.blade.php +1 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/app.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/401.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/403.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/404.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/errors/500.blade.php +8 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/layout.blade.php +33 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/all.blade.php +4 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/base.blade.php +11 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/facebook.blade.php +4 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/opengraph.blade.php +9 -0
- package/lib/generators/laravel-project/templates/laravel/resources/views/meta/twitter.blade.php +5 -0
- package/lib/generators/laravel-project/templates/laravel/routes/web.php +12 -0
- package/lib/generators/prettier/index.js +1 -1
- package/lib/generators/react-app/index.js +2 -2
- package/lib/generators/react-app/templates/src/components/App.jsx +3 -2
- package/lib/generators/react-app/templates/src/components/pages/Error.jsx +2 -2
- package/lib/generators/stylelint/index.js +1 -1
- package/lib/lib/generator.js +9 -0
- package/package.json +5 -4
- package/lib/generators/laravel-panneau/templates/_composer.json +0 -6
- package/lib/generators/laravel-panneau/templates/_package.json +0 -11
- package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/HomeController.php +0 -14
- package/lib/generators/laravel-panneau/templates/app/Http/Controllers/Panneau/PagesController.php +0 -11
- package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/File.php +0 -13
- package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/Picture.php +0 -13
- package/lib/generators/laravel-panneau/templates/app/Models/Mediatheque/Video.php +0 -34
- package/lib/generators/laravel-panneau/templates/app/Providers/PanneauServiceProvider.php +0 -23
- package/lib/generators/laravel-panneau/templates/app/Reducers/SlugExtractReducer.php +0 -18
- package/lib/generators/laravel-panneau/templates/app/Resources/Pages.php +0 -54
- package/lib/generators/laravel-panneau/templates/app/Schemas/Blocks/Base.php +0 -22
- package/lib/generators/laravel-panneau/templates/app/Schemas/Bubbles/Base.php +0 -22
- package/lib/generators/laravel-panneau/templates/app/Schemas/Pages/Base.php +0 -36
- package/lib/generators/laravel-panneau/templates/resources/lang/en/panneau.php +0 -12
- package/lib/generators/laravel-panneau/templates/resources/lang/fr/panneau.php +0 -12
@@ -4,58 +4,27 @@
|
|
4
4
|
<head>
|
5
5
|
<meta charset="utf-8">
|
6
6
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
7
|
-
<meta name="
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
<meta name="csrf-token" content="{{ csrf_token() }}">
|
16
|
-
|
17
|
-
@section('head:scripts')
|
18
|
-
<!-- Head Javascript -->
|
19
|
-
<script src="https://cdn.polyfill.io/v2/polyfill.min.js?features=WeakMap,Object.values,Object.entries,Intl,Intl.~locale.fr,Intl.~locale.en"></script>
|
20
|
-
<script type="text/javascript">
|
21
|
-
var PANNEAU_ASSETS_PATH = '{{ asset('vendor/panneau') }}/';
|
22
|
-
window._panneau_config=window._panneau_config||{};
|
23
|
-
function panneau_config(a,b){
|
24
|
-
if("undefined"===typeof a)return window._panneau_config;
|
25
|
-
if("undefined"===typeof b)return window._panneau_config[a];
|
26
|
-
window._panneau_config[a]=b
|
27
|
-
};
|
28
|
-
</script>
|
29
|
-
@stack('scripts:head')
|
30
|
-
@show
|
31
|
-
|
32
|
-
@section('head:styles')
|
33
|
-
<link href="{{asset('vendor/panneau/panneau.css')}}?version={{config('app.version')}}" rel="stylesheet" type="text/css" />
|
34
|
-
@if (app()->environment() === 'production')
|
35
|
-
<link href="{{asset('panneau/main.css')}}?version={{config('app.version')}}" rel="stylesheet" type="text/css" />
|
36
|
-
@endif
|
37
|
-
@stack('styles:head')
|
38
|
-
@show
|
39
|
-
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1">
|
8
|
+
<meta name="csrf-token" content="{{ csrf_token() }}">
|
9
|
+
|
10
|
+
<!-- Head Assets -->
|
11
|
+
@if(!isset($inWebpack) || !$inWebpack)
|
12
|
+
@include('assets_head')
|
13
|
+
@endif
|
14
|
+
@stack('assets:head')
|
40
15
|
</head>
|
41
16
|
<body>
|
17
|
+
<!-- Body -->
|
42
18
|
@section('body')
|
43
|
-
|
44
|
-
@show
|
45
|
-
|
46
|
-
@section('body:scripts')
|
47
|
-
@stack('scripts:footer')
|
48
|
-
@show
|
49
|
-
|
50
|
-
@section('body:styles')
|
51
|
-
<script type="text/javascript">
|
52
|
-
panneau_config('locale', '{{ $locale }}');
|
53
|
-
panneau_config('messages', {!! json_encode($messages) !!});
|
54
|
-
panneau_config('definition', {!! json_encode($definition) !!});
|
55
|
-
</script>
|
56
|
-
<script src="{{asset('panneau/main.js')}}?version={{config('app.version')}}" type="text/javascript"></script>
|
57
|
-
@stack('styles:footer')
|
19
|
+
@yield('content')
|
58
20
|
@show
|
59
21
|
|
22
|
+
@if(isset($inWebpack) && $inWebpack)
|
23
|
+
<script type="text/javascript" src="/static/js/bundle.js"></script>
|
24
|
+
<script type="text/javascript" src="/static/js/main.chunk.js"></script>
|
25
|
+
@else
|
26
|
+
@include('assets_body')
|
27
|
+
@endif
|
28
|
+
@stack('assets:body')
|
60
29
|
</body>
|
61
30
|
</html>
|
@@ -0,0 +1,68 @@
|
|
1
|
+
import React, { useState, useEffect } from 'react';
|
2
|
+
import PropTypes from 'prop-types';
|
3
|
+
import Panneau from '@panneau/app';
|
4
|
+
import { getCSRFHeaders } from '@folklore/fetch';
|
5
|
+
|
6
|
+
import { FIELDS_NAMESPACE } from '@panneau/core/contexts';
|
7
|
+
import * as fieldsComponents from './panneau/fields';
|
8
|
+
import * as AppPropTypes from '../lib/PropTypes';
|
9
|
+
|
10
|
+
import '../../styles/panneau.scss';
|
11
|
+
|
12
|
+
const propTypes = {
|
13
|
+
definition: PropTypes.object.isRequired, // eslint-disable-line react/forbid-prop-types
|
14
|
+
baseUrl: PropTypes.string.isRequired,
|
15
|
+
uploadEndpoint: PropTypes.string,
|
16
|
+
user: AppPropTypes.user,
|
17
|
+
statusCode: AppPropTypes.statusCode,
|
18
|
+
};
|
19
|
+
|
20
|
+
const defaultProps = {
|
21
|
+
user: null,
|
22
|
+
uploadEndpoint: '/panneau/upload',
|
23
|
+
statusCode: null,
|
24
|
+
};
|
25
|
+
|
26
|
+
const PanneauContainer = ({ definition, user, baseUrl, uploadEndpoint, statusCode }) => {
|
27
|
+
const { routes = {} } = definition;
|
28
|
+
const isAuthorized = statusCode !== 401 && statusCode !== 403;
|
29
|
+
|
30
|
+
const [localeLoaded, setLocaleLoaded] = useState(false);
|
31
|
+
|
32
|
+
useEffect(() => {
|
33
|
+
let canceled = false;
|
34
|
+
import(`@panneau/intl/locale/${definition.intl.locale}`).then(() => {
|
35
|
+
if (!canceled) {
|
36
|
+
setLocaleLoaded(true);
|
37
|
+
}
|
38
|
+
});
|
39
|
+
return () => {
|
40
|
+
canceled = true;
|
41
|
+
};
|
42
|
+
}, [definition]);
|
43
|
+
|
44
|
+
return localeLoaded ? (
|
45
|
+
<Panneau
|
46
|
+
definition={definition}
|
47
|
+
routes={routes}
|
48
|
+
user={isAuthorized ? user : null}
|
49
|
+
baseUrl={baseUrl}
|
50
|
+
uppy={{
|
51
|
+
transport: 'xhr',
|
52
|
+
xhr: {
|
53
|
+
endpoint: uploadEndpoint,
|
54
|
+
headers: getCSRFHeaders(),
|
55
|
+
timeout: 0,
|
56
|
+
},
|
57
|
+
}}
|
58
|
+
components={{
|
59
|
+
[FIELDS_NAMESPACE]: fieldsComponents,
|
60
|
+
}}
|
61
|
+
/>
|
62
|
+
) : null;
|
63
|
+
};
|
64
|
+
|
65
|
+
PanneauContainer.propTypes = propTypes;
|
66
|
+
PanneauContainer.defaultProps = defaultProps;
|
67
|
+
|
68
|
+
export default PanneauContainer;
|
@@ -0,0 +1,68 @@
|
|
1
|
+
/* eslint-disable react/jsx-props-no-spreading */
|
2
|
+
import { useFormValue } from '@panneau/core/contexts';
|
3
|
+
import TextField from '@panneau/field-text';
|
4
|
+
import classNames from 'classnames';
|
5
|
+
import PropTypes from 'prop-types';
|
6
|
+
import React from 'react';
|
7
|
+
import { generatePath } from 'react-router';
|
8
|
+
|
9
|
+
const propTypes = {
|
10
|
+
fieldLocale: PropTypes.string,
|
11
|
+
value: PropTypes.string,
|
12
|
+
className: PropTypes.string,
|
13
|
+
routes: PropTypes.objectOf(PropTypes.string).isRequired,
|
14
|
+
};
|
15
|
+
|
16
|
+
const defaultProps = {
|
17
|
+
fieldLocale: null,
|
18
|
+
value: null,
|
19
|
+
className: null,
|
20
|
+
};
|
21
|
+
|
22
|
+
const PageSlugField = ({ routes, fieldLocale, className, value, ...props }) => {
|
23
|
+
const page = useFormValue();
|
24
|
+
const { parent = null, handle = null } = page || {};
|
25
|
+
const { slug: parentSlug } = parent || {};
|
26
|
+
const { page: pageRoute = null, page_with_parent: pageWithParentRoute = null } = routes || {};
|
27
|
+
let url =
|
28
|
+
pageRoute !== null
|
29
|
+
? generatePath(pageRoute, {
|
30
|
+
page: 'REPLACE',
|
31
|
+
})
|
32
|
+
: null;
|
33
|
+
if (parent !== null && pageWithParentRoute !== null) {
|
34
|
+
url = generatePath(pageWithParentRoute, {
|
35
|
+
parent: parentSlug !== null ? parentSlug[fieldLocale] || null : null,
|
36
|
+
page: 'REPLACE',
|
37
|
+
});
|
38
|
+
}
|
39
|
+
if (handle === 'home') {
|
40
|
+
url = `/${fieldLocale}`;
|
41
|
+
}
|
42
|
+
|
43
|
+
return (
|
44
|
+
<TextField
|
45
|
+
prepend={
|
46
|
+
url !== null
|
47
|
+
? `${window.location.protocol}//${window.location.host}${url.replace(
|
48
|
+
'REPLACE',
|
49
|
+
'',
|
50
|
+
)}`
|
51
|
+
: null
|
52
|
+
}
|
53
|
+
className={classNames([
|
54
|
+
'flex-nowrap',
|
55
|
+
{
|
56
|
+
[className]: className !== null,
|
57
|
+
},
|
58
|
+
])}
|
59
|
+
value={handle === 'home' ? null : value}
|
60
|
+
{...props}
|
61
|
+
/>
|
62
|
+
);
|
63
|
+
};
|
64
|
+
|
65
|
+
PageSlugField.propTypes = propTypes;
|
66
|
+
PageSlugField.defaultProps = defaultProps;
|
67
|
+
|
68
|
+
export default PageSlugField;
|
@@ -0,0 +1,43 @@
|
|
1
|
+
/* eslint-disable react/jsx-props-no-spreading */
|
2
|
+
import React, { useMemo } from 'react';
|
3
|
+
import PropTypes from 'prop-types';
|
4
|
+
import get from 'lodash/get';
|
5
|
+
import isEmpty from 'lodash/isEmpty';
|
6
|
+
import slugify from 'slugify';
|
7
|
+
import LocalizedField from '@panneau/field-localized';
|
8
|
+
import { useFormValue } from '@panneau/core/contexts';
|
9
|
+
|
10
|
+
const propTypes = {
|
11
|
+
value: PropTypes.objectOf(PropTypes.string),
|
12
|
+
locales: PropTypes.arrayOf(PropTypes.string),
|
13
|
+
};
|
14
|
+
|
15
|
+
const defaultProps = {
|
16
|
+
value: null,
|
17
|
+
locales: null,
|
18
|
+
};
|
19
|
+
|
20
|
+
const PageSlugField = ({ value, locales, ...props }) => {
|
21
|
+
const page = useFormValue();
|
22
|
+
const { title = null } = page || {};
|
23
|
+
const finalValue = useMemo(
|
24
|
+
() =>
|
25
|
+
locales.reduce(
|
26
|
+
(newValue, key) =>
|
27
|
+
newValue === null || isEmpty(newValue[key])
|
28
|
+
? {
|
29
|
+
...newValue,
|
30
|
+
[key]: slugify(get(title, key, '')),
|
31
|
+
}
|
32
|
+
: newValue,
|
33
|
+
value,
|
34
|
+
),
|
35
|
+
[locales, value, title],
|
36
|
+
);
|
37
|
+
return <LocalizedField value={finalValue} locales={locales} {...props} />;
|
38
|
+
};
|
39
|
+
|
40
|
+
PageSlugField.propTypes = propTypes;
|
41
|
+
PageSlugField.defaultProps = defaultProps;
|
42
|
+
|
43
|
+
export default PageSlugField;
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<?php
|
2
|
+
|
3
|
+
use Illuminate\Support\Facades\Route;
|
4
|
+
use Panneau\Support\Facade as Panneau;
|
5
|
+
|
6
|
+
Panneau::router()->group(function () {
|
7
|
+
$namePrefix = config('panneau.routes.name_prefix', config('panneau.routes.prefix') . '.');
|
8
|
+
|
9
|
+
Route::any('tus/{any?}', function () {
|
10
|
+
return app('tus-server')->serve();
|
11
|
+
})->where('any', '.*');
|
12
|
+
|
13
|
+
Panneau::router()->auth();
|
14
|
+
|
15
|
+
Route::namespace('\App\Panneau\Http\Controllers')
|
16
|
+
->middleware(['web', 'auth', 'can:view,' . \Panneau\Panneau::class])
|
17
|
+
->group(function () use ($namePrefix) {
|
18
|
+
Route::get('/', 'HomeController@index')->name($namePrefix . 'home');
|
19
|
+
|
20
|
+
Route::post('upload', 'UploadController@upload')->name($namePrefix . 'upload');
|
21
|
+
|
22
|
+
// Account
|
23
|
+
Route::get('account', 'AccountController@index')->name($namePrefix . 'account');
|
24
|
+
Route::post('account', 'AccountController@update')->name(
|
25
|
+
$namePrefix . 'account.update'
|
26
|
+
);
|
27
|
+
|
28
|
+
Panneau::router()->resources();
|
29
|
+
});
|
30
|
+
});
|