How to Implement Pusher Note for Laravel 5 project.? - laravel

Hello Laravel vue.js Developers, please help me, i try to implement Laravel note sharing with others by Pusher but when i try to edit the note i cant retrieve my olders on, juste FYI i want to create a note and share it with another user for correction.
Please i have implement this package from this site: https://pusher.com/tutorials/collaborative-note-app-laravel.
Thank you a lot for your help.
Edit.blade.php
#extends('layouts.admin')
#section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<edit-note :note="{{ $note }}"></edit-note>
</div>
</div>
</div>
#endsection
My problem is when i click to edit the note i can't call the EditNote.vue.

Related

Changes are not showing in the website Vue Js?

<!-- Service Policy Modal -->
<!-- <div class="modal modal-landing fade" id="servicePolicyModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-dialog-scrollable" role="document">
<div class="modal-content">
<div class="modal-body justify-content-center">
<h4 class="modal-title text-center mb-4" id="exampleModalLabel">
{{ trans('lang.service_policy') }}
</h4>
<img :src="publicPath+'/images/service-policy.png'" class="img-fluid mx-auto d-block mb-4" width="50%" alt="">
<div class="text-justify mb-4" v-html="custom_content"/>
<div class="row justify-content-center">
<div class="col-4">
<button type="button" class="btn btn-block btn-landing" data-dismiss="modal">
{{ trans('lang.close_btn') }}
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div> -->
I commented down this code in Vue JS, Laravel application but the problem is the section is still showing on the website. The changes are not reflected on the website.
Can you please help me out with this?
Simply making changes to the Vue files won't actually affect anything on the site, because the actual code that is rendered is in the public folder (most probably the public/app.js file). In order to compile the Vue files to the public folder, you need to run a command after making the changes. npm run dev or npm run prod are used for this. You could also run npm run watch to continuously watch for changes and automatically compile the assets instead of running a command manually each time you make a change.
You should see that each time you make a change and run one of those commands, the change appears also in a file in the public folder of the project. Do not edit the files inside the public folder directly, since if those commands are run /they are likely to be a part of the deploy procedure/, those changes will be overwritten by the newly compiled files from the source ones (those in resources folder).
I could bet that it's related to page chache. Open the Chrome de tools, under Network tab check "disable cache" and try again. Vue js precompiles the js code by chunking vendor files in small js files such as 1.js, 2.js, etc, which are loaded on demand while you navigate your app.
Your new change may be located in 1.js, so no matter the code change, if this file is loaded from cache and not from Network, you won't see the updates until cache refresh.

Laravel and Vue: How do I get images from my public folder in a Vue component?

I am trying to get a logo image from my public folder in my laravel and Vue application. The file is called index.vue and have the following structure:
<template>
<div>
<div class="header-container">
<div class="header-content">
<div class="logo-container">
<img :src="'/public/images/logo/black.png'" alt="logo">
</div>
</div>
</div>
<!-- Tell Vue where to render components -->
<router-view></router-view>
</div>
</template>
Here is the file structure and you can see that file exists and the path is correct:
But when I switch back to the view it looks like this:
I have also tried to call it the way I would in a blade template using {{ asset() }}, but this doesn't work and gives me a compiler error.
How do I get this image to load in my Vue file?
Not sure about vue + laravel. But, since its a relative path I dont think you need to bind anything.
<img src="/images/logo/black.png" alt="logo">

how to hit an api on button click using laravel

i am new to working with API ,i have 2 buttons in my view file and i want to print the sheet which is available as an API ,
<div class="card">
<div class="card-body">
#include('admin.inc.messages')
<div class="row justify-content-center">
<div class="col-md-4">
<button type="button" class="btn btn-primary btn-block">Back</button>
<button type="button" class="btn btn-primary btn-block">Print Airway Bill</button>
<button type="button" class="btn btn-primary btn-block">Print Invoice</button>
</div>
</div>
</div>
</div>
i have got the path , i want to ask where should i define the path for that , in the web.php or api.php
and second thing how should i give the path in the buttons
any help will be appreciated !
You will need to consume your own api, most likely, or use ajax request. This can be done via passport, seen here in the documentation. If you want you can always bypass, however you will not have the ability to utilize middleware with those requests. Meaning, that your project will be subjected to potential security risk as the request will not be subjected to route middleware. Which protect and assist you in some regards.
For example, if you cannot authenticate against a middleware you will not have the ability to determine which/what user is requesting data. Another comparison one might make would be the ability to login against a user, but then not have the ability through out the application pages to know which user was authenticated. This is comparable to when you log in to stackoverflow you can obviously see you user information/profile in the top right with your picture etc... If you by pass you will not have that ability.
Therefore, I would highly recommend visiting the link posted above and consider consuming your own api or creating a service to do so.

How can i create new blade in laravel 5.1

I just started using laravel and created a new login page. My issue is how can i create new blade.php file. When I copy the old one, my CSS file is used in the body. I want to make a new blade file. Also, can anyone suggest the best way to make login page.
<html>
<head>
{!! HTML::style('css/main.css') !!}
</head>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300,300italic,400italic,600' rel='stylesheet' type='text/css'>
<link href="//netdna.bootstrapcdn.com/font-awesome/3.1.1/css/font-awesome.css" rel="stylesheet">
<body>
<div class="form">
<ul class="tab-group">
<li class="tab active">Sign Up</li>
<li class="tab">Log In</li>
</ul>
<div class="tab-content">
<div id="signup">
<h1>Sign Up for Free</h1>
<form action="/" method="post">
<div class="top-row">
<div class="field-wrap">
<label>
First Name<span class="req">*</span>
</label>
<input type="text" required autocomplete="off" />
</div>
Blade templates are found on Resources/views folder. As suggested in the comment you just create a new file then add .blade.php extension to it.
blade files use html and if your comfortable with html5 tackle task as if you were writing plain html.
To get you started check this out http://laravel.com/docs/5.1/blade
Make sure you have installed laravelcollective/html
Follow the below steps,
add "laravelcollective/html": "5.1.*" in the require feild inside composer.json file in the root of the project.
Run composer update from root of your project. This will install the package required for blade templating by laravel.
In config/app.php, under providers add Collective\Html\HtmlServiceProvider::class.
In config/app.php, under aliases add 'Form'=>Collective\Html\FormFacade::class and
'Html'=>Collective\Html\HtmlFacade::class.
Thankyou :)

In Magento site ,My checkout button is broken

not sure why my magento site
all links broken, My check out button link showing me like this error
<form "="" getformkey="" varnishcache="" www.alphacateringequipment.com.au="" https:="" action="https://www.alphacateringequipment.com.au/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuYWxwaGFjYXRlcmluZ2VxdWlwbWVudC5jb20uYXUvYmV2ZXJhZ2UvYWNjZXNzb3JpZXM,/product/3704/form_key/<esi:include src=">/" method="post" id="product_addtocart_form_3704">
<button onclick="productAddToCartForm_3704.submit()" class="form-button listing_cart-btn">ADD TO Cart</button>
</form>
and also my site drop down menu not working more
if any one know this
Please help me out.
thank you
Try below code.
<form name="text" getformkey="<?php echo Mage::getSingleton('core/session')->getFormKey(); ?>" varnishcache="" www.alphacateringequipment.com.au="" https:="" action="https://www.alphacateringequipment.com.au/checkout/cart/add/uenc/aHR0cHM6Ly93d3cuYWxwaGFjYXRlcmluZ2VxdWlwbWVudC5jb20uYXUvYmV2ZXJhZ2UvYWNjZXNzb3JpZXM,/product/3704/form_key/<esi:include src=">/" method="post" id="product_addtocart_form_3704">
<button onclick="productAddToCartForm_3704.submit()" class="form-button listing_cart-btn">ADD TO Cart</button>
</form>
It will broken due to form key not passed by In Version of Magento.

Resources