blade

Exclude a view from master layout?

折月煮酒 提交于 2019-11-29 18:00:34
I have login.blade.php in views/users/ that I would like to exclude from the master layout that I have. Instead I want the login page to be a standalone page with just the login form on it. How may I achieve that? Use a different layout for login page: File app/views/login.blade.php : @extends('layouts.standalone') @section('content') ... @stop And for your other pages: File app/views/home.blade.php : @extends('layouts.master') @section('content') ... @stop And here your layouts: File app/views/layouts/standalone.blade.php : <html> <body> This is a master layout @yield('content') </body> <

How to add a custom file extension that has a dot (blade.php) in NetBeans?

Deadly 提交于 2019-11-29 17:21:41
问题 I need to assign a custom extension to be recognized as a twig file in netbeans ('blade.php' as 'twig' file and give me syntax highlighting and code completion appropriately). The problem with using the File association option (in Tools > Options > Miscellaneous > Files ) is that it won't let me add '.' in extension like blade.php, it works with single worded extensions like php, html, css etc. Will be grateful if anybody can help me with this! 回答1: As I can see the problem is more NetBeans

Including SVG contents in Laravel 5 Blade template

感情迁移 提交于 2019-11-29 16:53:04
问题 What is the best way to include the contents of an SVG file (located in the assets folder) in a Laravel 5 blade template? I don't want to use image/object/embed tags, this should be an inline SVG for reasons of speed. I know I could use <?php file_get_contents("file.svg") ?> but is there a better way specific to Laravel/Blade? Edit: to clarify, the method should work with all SVG files, including the one below. <?xml version="1.0" encoding="UTF-8"?> <svg xmlns="http://www.w3.org/2000/svg">

Displaying laravel stored images on shared hosting

懵懂的女人 提交于 2019-11-29 15:47:33
问题 I have successfully deployed my first laravel application on a live server. Everything looks great except the fact that I am unable to display the images that are being uploaded to the /myproject_src/storage/app/public/myfolder1 folder. Here is my folder hierarchy on HostGator: /myproject_src/ Here are all the laravel source files (except the public folder) /public_html/mydomain.com/ Here goes all my contents of the public directory I am storing the file path into the database in the

how to make an input date field greater than or equal to another date field using validation in laravel

冷暖自知 提交于 2019-11-29 13:53:29
Hi iam developing an application using laravel is there any way to make an input date field greater than or equal to another date field using validation. I know that i can achieve this through jquery and i have already got that working, but i want to know whether is this achievable through laravel validation since laravel has got some predefined validations. For Example protected $validationRules = array ( 'a' => 'date', 'b' => 'date|(some validation so that the b value is greater than or equal to that of 'a')' ); EDIT If there is any other approach to solve the problem using laravel concept

How to do {{ asset('/css/app.css') }} in Lumen?

99封情书 提交于 2019-11-29 10:09:41
In Lumen, I can do this in my blade template: {{ url('/css/app.css') }} In Laravel I could do {{ asset('/css/app.css') }} Is the url helper all I have to work with in Lumen? Have look at Lumen UrlGenerator source code , the Lumen framework supports just url and route helpers. Of course, you can write the asset helper if you want. Had the same problem, moving from laravel to lumen. As @hieu-le says, I made an asset helper as below. if (!function_exists('urlGenerator')) { /** * @return \Laravel\Lumen\Routing\UrlGenerator */ function urlGenerator() { return new \Laravel\Lumen\Routing\UrlGenerator

use DELETE method in route with Laravel 5.4

我怕爱的太早我们不能终老 提交于 2019-11-29 06:22:08
I'm working on a Laravel (v 5.4) project and i did the CRUD to manage categories. Currently, i can create a new category and i would be able to delete. I created the view (with blade) to delete the categories : <table class="table"> <thead> <th>Name</th> <th>Action</th> </thead> <tbody> @foreach ($categories as $category) <tr> <td>$category->name</td> <td> <a href="{{ url('/categories', ['id' => $category->id]) }}"> <button class="btn btn-default"> Delete </button> </a> </td> </tr> @endforeach </tbody> </table> And in the routing file web.php, i wrote : Route::delete('/categories/{id}',

Passing multiple parameters to controller in Laravel 5

旧城冷巷雨未停 提交于 2019-11-29 05:39:06
In my application, a user has the ability to remind another user about an event invitation. To do that, I need to pass both the IDs of the event, and of the user to be invited. In my route file, I have: Route::get('events/{id}/remind', [ 'as' => 'remindHelper', 'uses' => 'EventsController@remindHelper']); In my view, I have: {!!link_to_route('remindHelper', 'Remind User', $parameters = array($eventid = $event->id, $userid = $invitee->id) )!!} In my controller, I have: public function remindHelper($eventid, $userid) { $event = Events::findOrFail($eventid); $user = User::findOrFail($userid);

Laravel returning children of parents in same table

本小妞迷上赌 提交于 2019-11-29 02:56:42
问题 Using Laravel 5.1, I am trying to create a menu list from a MySQL categories table. My service provider returns data, but I don't understand how to create the child categories in a foreach loop. When I perform the loop, only the last row of the child query is returned. Any guidance would be appreciated. categories Table id | cat_name | cat_parent_id --- | --------------| ------------- 1 | Parent Cat 1 | NULL 2 | Parent Cat 2 | NULL 3 | Child Cat 1 | 2 4 | Child Cat 2 | 2 5 | Parent Cat 3 |

Laravel 5.1 @can, how use OR clause

依然范特西╮ 提交于 2019-11-29 02:55:34
I did not find how to use a clause (OR, AND) in view with @can, for checking multiple abilities ... I tried: @can(['permission1', 'permission2']) @can('permission1' or 'permission2') @can('permission1' || 'permission2') But dont work ;( You can use the Gate facade: @if(Gate::check('permission1') || Gate::check('permission2')) @endif The @canany blade directive has been added to Laravel v.5.6.23 on May 24, 2018 Usage: @canany(['edit posts', 'delete posts']) <div class="actions"> @can('edit posts') <button>Edit post</button> @endcan @can('delete posts') <button>Delete post</button> @endcan </div