How can i create new blade in laravel 5.1 - laravel

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 :)

Related

Logo on Navbar Won't Show in Laravel Jetstream

So I learn Laravel Jetstream using Inertia Stack. While I was doing some changing on Logo in the Navbar on Dashboard view it's still showing.
But when I go to profile view, it's just gone, I don't know why, but if I try using blade function which is asset function, it'll be gone in dashboard view too.
This is my code on ApplicationMark.vue:
<template>
<img class="block h-9 w-auto" src="favicon.png" alt="Logo">
<!-- <img class="block h-9 w-auto" src="{{ asset('favicon.png') }}" alt="Logo"> -->
</template>

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 Implement Pusher Note for Laravel 5 project.?

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.

Turbolink is not working in Livewire version 2

i am working on my new project and technology stack is: laravel 8 + Livewire V2 + Jetstream, to create a single page application (SPA). but I am still confused if its possible SPA in my selected technology stack or not.
I know Livewire no longer supports Turbolinks out of the box so they provided Turbolinks adapter. I have followed the documentation but seems like its not working. please help me to understand the issue and let me know if SPA is possible or not in Livewire version 2.
here is my code:
<div class="min-h-screen bg-gray-100">
#livewire('navigation-menu')
<!-- Page Heading -->
#if (isset($header))
<header class="bg-white shadow">
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
{{ $header }}
</div>
</header>
#endif
<!-- Page Content -->
<main>
{{ $slot }}
</main>
</div>
#stack('modals')
#livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false"></script>
Livewire Version 1 supported Turbolinks internally. Livewire Version 2 has removed internal support and extracted it into this plugin.
The goal of this livewire version 2 is to provide full Turbolinks/Turbo support in Livewire.
add hotwired/turbo package on your layout below #livewireScripts
add livewire/turbolinks package on your layout below hotwired/turbo package
#livewireScripts
<script type="module">
import hotwiredTurbo from 'https://cdn.skypack.dev/#hotwired/turbo';
</script>
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>
You need to install Turbolink module first, Please go Turbolinks documentation Here.
Support for Turbolink has been removed in Livewire 2. So you need to add an extra JS script to make it work.
More here => https://github.com/livewire/turbolinks
Just add this after your livewire script:
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>
Example:
#livewireScripts
<script src="https://cdn.jsdelivr.net/gh/livewire/turbolinks#v0.1.x/dist/livewire-turbolinks.js" data-turbolinks-eval="false" data-turbo-eval="false"></script>

Godoc stylesheet and javascript

I know Godoc -html generates HTML only without stylesheets and javascript, but once generated where can I get those from?
I got css and js from godoc.org but it seems the js doesn't work with the html markup that is generated by godoc
I just want to try this out without using godoc server
Example markup:
<div id="pkg-overview" class="toggleVisible">
<div class="collapsed">
<h2 class="toggleButton" title="Click to show Overview section">Overview ▹</h2>
</div>
<div class="expanded">
<h2 class="toggleButton" title="Click to hide Overview section">Overview ▾</h2>
<p>Hello World
</p>
</div>
</div>
You can try and have a look in tools#hg/godoc/static
You will find a godoc/static/godocs.js which might help.
It is used by godoc/static/godoc.html anyway.
godoc.html also uses:
godoc/static/style.css
godoc/static/jquery.treeview.css

Resources