#1 – Install Flag library via NPM
npm install flag-icon-css
#2 – Import css to your library
import 'flag-icon-css/css/flag-icon.css'
#3 – in your blade
<li > <a href="/en"> <i class=" flag-icon flag-icon-us"></i></a> </li>
#1 – Install Flag library via NPM
npm install flag-icon-css
#2 – Import css to your library
import 'flag-icon-css/css/flag-icon.css'
#3 – in your blade
<li > <a href="/en"> <i class=" flag-icon flag-icon-us"></i></a> </li>
use this command php artisan migrate --path=/database/migrations/my_migration.php
For star rating npm install vue-star-rating For Nice modal npm i vue-simple-alert
/** * First we will load all of this project's JavaScript dependencies which * includes Vue and other libraries. It is a great starting point when * building robust, powerful web applications using Vue and Laravel. */ require('./bootstrap'); import StarRating from 'vue-star-rating' import VueSimpleAlert from "vue-simple-alert"; Vue.use(VueSimpleAlert); Vue.component('reviewbusiness', require('./components/ReviewBusiness.vue').default); /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application * or customize the JavaScript scaffolding to fit your unique needs. */ new Vue({ el: '#app', components : { StarRating, VueSimpleAlert } });
<template> <div class="block-body"> <div class="giv-averg-rate"> <div class="row"> <div class="col-lg-8 col-md-8 col-sm-12"> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12"> <label>Service?</label> <div class="rate-stars"> <star-rating :star-size="25" @rating-selected="setRatingService" ></star-rating> </div> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label>Value for Money?</label> <div class="rate-stars"> <star-rating :star-size="25" @rating-selected="setRatingValueformoney" ></star-rating> </div> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label>Cleanliness?</label> <div class="rate-stars"> <star-rating :star-size="25" @rating-selected="setRatingCleanliness" ></star-rating> </div> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <label>Location?</label> <div class="rate-stars"> <star-rating :star-size="25" @rating-selected="setRatingLocation" ></star-rating> </div> </div> </div> </div> <div class="col-lg-4 col-md-4 col-sm-12"> <div class="avg-total-pilx"> <h4 class="high">{{ averageNumber }}</h4> <span>Average Rating</span> </div> </div> </div> </div> <div class="review-form-box form-submit"> <div class="row"> <div class="col-lg-6 col-md-6 col-sm-12"> <div class="form-group"> <label>Name</label> <input id="name" v-model="name" class="form-control @error('name') is-invalid @enderror" name="name" placeholder="Your Name" type="text"> </div> </div> <div class="col-lg-6 col-md-6 col-sm-12"> <div class="form-group"> <label>Email</label> <input id="email" v-model="email" class="form-control @error('email') is-invalid @enderror" name="email" placeholder="Your Email" type="email"> </div> </div> <div class="col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <label>Review</label> <textarea id="message" v-model="message" class="form-control @error('message') is-invalid @enderror ht-140" name="message" placeholder="Review"></textarea> </div> </div> <div class="col-lg-12 col-md-12 col-sm-12"> <div class="form-group"> <button class="btn btn-theme" type="submit" @click="addReview">Submit Review</button> </div> </div> </div> </div> </div> </template> <script> import StarRating from 'vue-star-rating' import VueSimpleAlert from "vue-simple-alert"; export default { components: { StarRating, VueSimpleAlert }, props: ['businessname', 'user'], mounted() { console.log('Component mounted.') // alert( JSON.stringify( (this.user))); console.log('JSON.stringify( (this.user)) ' + JSON.stringify((this.user))); console.log('businessname ' + JSON.stringify((this.businessname))); }, data() { return { average: 0, ratingLocation: 0, ratingCleanliness: 0, ratingValueForMoney: 0, ratingService: 0, formsent: false, email: '', name: '', subject: 'Customer ' + this.businessname.BUSINESSNAME + ' Business ID ' + this.businessname.["LOCATIONACCOUNT#"], message: '', }; }, computed: { // a computed getter averageNumber: { get: function () { this.average = (this.ratingLocation + this.ratingCleanliness + this.ratingValueForMoney + this.ratingService) / 4 return `${this.average}` }, // setter set(neValue) { alert('toto') } } }, methods: { setRatingLocation: function (rating) { this.ratingLocation = rating; }, setRatingCleanliness: function (rating) { this.ratingCleanliness = rating; }, setRatingValueformoney: function (rating) { this.ratingValueForMoney = rating; }, setRatingService: function (rating) { this.ratingService = rating; }, addReview() { axios.post('/reviewform', { email: this.email, name: this.name, subject: this.subject, useridentification: this.user, businessid: this.businessname.["LOCATIONACCOUNT#"], message: this.message, service: this.ratingService, valueformoney: this.ratingValueForMoney, cleanliness: this.ratingCleanliness, location: this.ratingLocation, average: this.average, }) .then(({data}) => { console.log(data); this.body = ''; this.formsent = true; this.$alert(data) flash(data); this.$emit('created', data); window.location.reload() location.reload() }) .catch(error => { console.log('Error'); console.log(error.response); console.log(error.response.message); let messageToSendBack = ''; if (typeof error.response.data.message != "undefined") { let errorMessage = error.response.data.message.toString(); messageToSendBack = errorMessage; for (var key in error.response.data.errors) { if (error.response.data.errors.hasOwnProperty(key)) { messageToSendBack += error.response.data.errors[key]; } } if (errorMessage.search('given')) { messageToSendBack = 'Email field is not properly entered '; } if (errorMessage.search('duplicate')) { messageToSendBack = "You have already posted a Review <br>"; } this.$alert(messageToSendBack); } flash(messageToSendBack, 'danger'); } ) .finally(() => this.loading = false) ; } } } </script>
const mix = require('laravel-mix'); /* |-------------------------------------------------------------------------- | Mix Asset Management |-------------------------------------------------------------------------- | | Mix provides a clean, fluent API for defining some Webpack build steps | for your Laravel application. By default, we are compiling the Sass | file for the application as well as bundling up all the JS files. | */ mix.js('resources/js/app.js', 'public/js') .sass('resources/sass/app.scss', 'public/css').version(); mix.version();
php artisan nova:resource Businesses php artisan make:model Businesses
<?php namespace App; use Illuminate\Database\Eloquent\Model; class Thetable extends Model { protected $connection = 'pgsql-api'; protected $table = 'mapi_admin_tool.THETABLE'; protected $primaryKey = 'id'; protected $dateFormat = 'Y-m-d H:i:sO'; public function __construct(array $attributes = []) { parent::__construct($attributes); } protected $dates = [ 'created_at', 'updated_at', 'deleted_at' ]; }
<?php namespace App\Nova; use Illuminate\Http\Request; use Laravel\Nova\Fields\Date; use Laravel\Nova\Fields\ID; use Laravel\Nova\Fields\Text; use Laravel\Nova\Http\Requests\NovaRequest; class Thetable extends Resource { /** * The model the resource corresponds to. * * @var string */ public static $model = 'App\M2TrackFileSubmissionToWindsurfer'; /** * The single value that should be used to represent the resource when being displayed. * * @var string */ public static $title = 'id'; /** * The columns that should be searched. * * @var array */ public static $search = [ 'id', ]; /** * Get the fields displayed by the resource. * * @param \Illuminate\Http\Request $request * @return array */ public function fields(Request $request) { return [ ID::make('id')->sortable(), Text::make('file_uuid')->sortable(), Text::make('set_uuid')->sortable(), Text::make('windsurfer_job_id')->sortable(), Text::make('cust_filename')->sortable(), Text::make('artwork_info')->sortable(), Date::make('created_at')->sortable(), Date::make('update_at')->sortable(), ]; }
Laravel – Versionning your app.js to cache bust for deploying
1 – Modify following file webpack.mix.js
mix.js('resources/js/app.js', 'public/js')
.sass('resources/sass/app.scss', 'public/css').version();
mix.version();
2 – Modify your blade
<script src="{{ env('APP_URL') }}{{ mix('js/app.js') }}"></script>
3 – you will see the following generation
<script src="https://xxxxx.raleche.com.test/js/app.js?id=a8305a8c81a6359c3c7b"></script>
You can undo git add
before commit with
git reset <file>
or
git reset <directory>
It will not delete any of your files
touch .gitignore
.DS_Store /vendor
That means space/memory issue on your server
Free space !
du -skh .
df
#1 – sudo lsblk -f
#2 – [ec2-user ~]$ sudo mount /dev/xvdf /data
After you attach an Amazon EBS volume to your instance, it is exposed as a block device. You can format the volume with any file system and then mount it. After you make the EBS volume available for use, you can access it in the same ways that you access any other volume. Any data written to this file system is written to the EBS volume and is transparent to applications using the device.
You can take snapshots of your EBS volume for backup purposes or to use as a baseline when you create another volume. For more information, see Amazon EBS snapshots.
You can get directions for volumes on a Windows instance from Make a volume available for use on Windows in the Amazon EC2 User Guide for Windows Instances.
Suppose that you have an EC2 instance with an EBS volume for the root device, /dev/xvda
, and that you have just attached an empty EBS volume to the instance using /dev/sdf
. Use the following procedure to make the newly attached volume available for use.
To format and mount an EBS volume on Linux
/dev/
prefix from full device paths.The following is example output for an instance built on the Nitro System, which exposes EBS volumes as NVMe block devices. The root device is /dev/nvme0n1
. The attached volume is /dev/nvme1n1
, which is not yet mounted.[ec2-user ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
nvme1n1 259:0 0 10G 0 disk
nvme0n1 259:1 0 8G 0 disk
-nvme0n1p1 259:2 0 8G 0 part /
-nvme0n1p128 259:3 0 1M 0 part
The following is example output for a T2 instance. The root device is /dev/xvda
. The attached volume is /dev/xvdf
, which is not yet mounted.[ec2-user ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
-xvda1 202:1 0 8G 0 part /
xvdf 202:80 0 10G 0 disk
data
, as in the following example output, there is no file system on the device[ec2-user ~]$ sudo file -s /dev/xvdf
/dev/xvdf: data
If the device has a file system, the command shows information about the file system type. For example, the following output shows a root device with the XFS file system.[ec2-user ~]$ sudo file -s /dev/xvda1
/dev/xvda1: SGI XFS filesystem data (blksz 4096, inosz 512, v2 dirs)
[ec2-user ~]$ sudo lsblk -f
For example, the following output shows that there are three devices attached to the instances—nvme1n1
, nvme0n1
, and nvme2n1
. The first column lists the devices and their partitions. The FSTYPE
column shows the file system type for each device. If the column is empty for a specific device, it means that the device does not have a file system. In this case, nvme1n1
, nvme0n1
are both formatted using the XFS file system, while nvme2n1
does not have a file system.NAME FSTYPE LABEL UUID MOUNTPOINT
nvme1n1 xfs 7f939f28-6dcc-4315-8c42-6806080b94dd
nvme0n1
├─nvme0n1p1 xfs / 90e29211-2de8-4967-b0fb-16f51a6e464c /
└─nvme0n1p128
nvme2n1
[ec2-user ~]$ sudo mkfs -t xfs /dev/xvdf
If you get an error that mkfs.xfs
is not found, use the following command to install the XFS tools and then repeat the previous command:[ec2-user ~]$ sudo yum install xfsprogs
/data
.[ec2-user ~]$ sudo mkdir /data
[ec2-user ~]$ sudo mount /dev/xvdf /data
To mount an attached EBS volume on every system reboot, add an entry for the device to the /etc/fstab
file.
You can use the device name, such as /dev/xvdf
, in /etc/fstab
, but we recommend using the device’s 128-bit universally unique identifier (UUID) instead. Device names can change, but the UUID persists throughout the life of the partition. By using the UUID, you reduce the chances that the system becomes unbootable after a hardware reconfiguration. For more information, see Identify the EBS device.
To mount an attached volume automatically after reboot
/etc/fstab
file that you can use if you accidentally destroy or delete this file while editing it.[ec2-user ~]$ sudo cp /etc/fstab /etc/fstab.orig
[ec2-user ~]$ sudo blkid
/dev/xvda1: LABEL="/" UUID="ca774df7-756d-4261-a3f1-76038323e572" TYPE="xfs" PARTLABEL="Linux" PARTUUID="02dcd367-e87c-4f2e-9a72-a3cf8f299c10"
/dev/xvdf: UUID="aebf131c-6957-451e-8d34-ec978d9581ae" TYPE="xfs"
For Ubuntu 18.04 use the lsblk command.[ec2-user ~]$ sudo lsblk -o +UUID
/etc/fstab
file using any text editor, such as nano or vim.[ec2-user ~]$ sudo vim /etc/fstab
/etc/fstab
to mount the device at the specified mount point. The fields are the UUID value returned by blkid (or lsblk for Ubuntu 18.04), the mount point, the file system, and the recommended file system mount options. For more information, see the manual page for fstab (run man fstab).UUID=aebf131c-6957-451e-8d34-ec978d9581ae /data xfs defaults,nofail 0 2
NoteIf you ever boot your instance without this volume attached (for example, after moving the volume to another instance), the nofail
mount option enables the instance to boot even if there are errors mounting the volume. Debian derivatives, including Ubuntu versions earlier than 16.04, must also add the nobootwait
mount option./etc/fstab
. If there are no errors, the /etc/fstab
file is OK and your file system will mount automatically after it is rebooted.[ec2-user ~]$ sudo umount /data
[ec2-user ~]$ sudo mount -a
If you receive an error message, address the errors in the file.WarningErrors in the /etc/fstab
file can render a system unbootable. Do not shut down a system that has errors in the /etc/fstab
file.If you are unsure how to correct errors in /etc/fstab
and you created a backup file in the first step of this procedure, you can restore from your backup file using the following command.[ec2-user ~]$ sudo mv /etc/fstab.orig /etc/fstab
<script type="application/javascript">
window.scrollTo(0,document.body.scrollHeight);
</script>