The default language is set by the `DEFAULT_LANGUAGE` variable in the `.env` file. This will be the language used until it is changed, which can be done using the `/language/{lang}` route or directly using `Language::setSessionLanguage($lang)` where in both cases `lang` is the language code for a given language.
In the view, a block of text can be configured with multiple languages using the following syntax:
```php
@lang([
'en' => "This is a sentence",
'fr' => "C'est une phrase"
])
```
or
```php
{{ Language::select([ 'en' => "This is a sentence", 'fr' => "C'est une phrase" ]) }}
The default public facing website uses vue.js. To configure a non-SPA traditional website, look at the files in `traditional-bootstrap`.
The following list of files and directories are where various pieces of the public website are located:
*`resources/views/templates/base.blade.php`: The outer template for the entire website
*`resources/views/templates/public.blade.php`: The inner template for the public site
*`resources/assets/fonts`: The folder containing website fonts (these get loaded into `public/fonts/` by the gulpfile)
*`resources/assets/js/app.js`: The main javascript file that loads the public site
*`resources/assets/js/mixins`: The folder containing vue.js mixins that can be applied globally in `resources/assets/js/app.js` or in individual components
*`resources/assets/js/mixins/base-page.js`: The base-page mixin with page functionality that should be imported into all page components
*`resources/components`: The folder containing vue.js components
*`resources/components/pages`: Page components that should be imported into vue-router in `resources/assets/js/app.js`
*`resources/components/sections`: Section components (single-use per page) that should be imported into mixins or page components
*`resources/components/partials`: Partial components (multi-use per page or section) that should be imported into mixins and/or page and section components
*`resources/assets/sass/app.scss`: The main sass file for the public site
*`resources/assets/sass/_fonts.scss`: Stylesheet containing font declarations and mixins declared to use those fonts in other stylesheets
*`resources/assets/sass/_var.scss`: Stylesheet containing variables to be used in other stylesheets
*`resources/assets/sass/pages`: Stylesheets for page-specific styles wrapped in the respective page component class
*`resources/assets/sass/sections`: Stylesheets for section-specific styles wrapped in the respective section component class
*`resources/assets/sass/partials`: Stylessheets for partial-specific styles wrapped in the respective partial component class
*`resources/assets/sass/classes`: General stylesheets for classes that can be used anywhere
*`resources/assets/sass/mixins`: Stylesheets declaring SCSS mixins for use in other stylesheets
Dependencies can be included with bower or npm and loaded either into the `jsPublicLibs` array in the gulpfile or imported in the javascript.
Other information about database interaction, routing, controllers, etc can be viewed in the [Laravel Documentation](https://laravel.com/docs).
*`button`: Add a button with a title, confirmation, success and error messages, and a post request path that takes an id and returns `success` on success
Editable models must have an entry in the switch statement of the `postEdit` function to make create and edit functionality work:
```php
switch ($request['model']) {
case 'shows':
$item = $id == 'new' ? new Shows : Shows::find($id);
break;
case 'news':
$item = $id == 'new' ? new News : News::find($id);
break;
default:
return 'model-access-fail';
}
```
#### Additional Requirement for Sortable Models
Sortable models must have an entry in the switch statement of the `postReorder` function to make sorting functionality work:
```php
switch ($request['model']) {
case 'news':
$items = new News();
break;
default:
return 'model-access-fail';
}
```
#### Additional Requirements for Image Upload
If the value of `imgup` has been set to `true`, ensure `public/uploads/model_name` exists (where `model_name` is the name of the given model) and contains a `.gitkeep` that exists in version control.
By default, uploaded images are saved in JPEG format with the value of the `id` column of the respective row as its name and `.jpg` as its file extension.
When a row is deleted, its respective image will be deleted as well if it exists.
Edit the `$menu` array in `app/Models/DashboardMenu.php` where the first column of each item is the title and the second is either a path, or an array of submenu items.
#### Additional Requirement for Delete Functionality
Editable models with `delete` set to `true` must have an entry in the switch statement of the `deleteDelete` function to make deletion functionality work:
#### Additional Requirement for Export Functionality
Viewable models and editable models with `export` set to `true` must have an entry in the switch statement of the `getExport` function to make the export button work: