Category : laravel-blade

I am quite new to Laravel,and I dont understand why the pagination is not working properly in my case. It displays all of the hostnames, not only the 48. view.: @if($posts->isNotEmpty()) @foreach($posts as post) <div class="col-xl-3 col-lg-3 col-md-3 col-sm-3 col-4" style="padding-right:5px; padding-left:5px; padding-top:5px;"> <ul class="list-group" style="text-align:center;"> <a href="hiperlink/template/{{post -> hostname }}" class="list-group-item list-group-item-action">{{ $post .. Read more Currently I am struggling with finding the best approach, to implement the following, maybe not everyday, requirement. I plan to develop a Laravel application. The very general idea of this application is to generate the for websites, which are based on Laravel too, but completely working independent. So as an example: I, as an user, .. Read more foreach ($packages as $package) { <input type="file" id="invoice" value="{{$package->item_id }}" class="btn btn-success invoice_button" name="invoice_file" onchange="upload(event, ‘{{$package->item_id}}’"> } When i alert or console.log second argument in function upload, i get only$packages[0]->item_id. Sourc..

Read more

I’m working on a project where I use Livewire to create components that will be rendered in a view. Basic stuff, but I’ve come across this weird problem that I haven’t been able to find the answer to in a few days. When I load a component in my blade, it just pops up for ..

Read more

i have created a profile where users can add their education fields. when there is no value in the database it throws an error. how can i get rid of this ? Attempt to read property "degree" on null. public function myEducations() { return $this->hasMany(‘AppModelsEducation’,’user_id’)->orderByDesc(‘endDate’); } controller public function myProfile(AppModelsUser$user) { $user = Auth::user(); .. Read more I want to use the drop down menu, and I have a table below. How do I show the data in this table on Blade? My problem is showing submenus. (Parent_id and child item) public function up() { Schema::create(‘menu_items’, function (Blueprint$table) { $table->id();$table->unsignedBigInteger(‘menu_id’); $table->string(‘title’,255);$table->string(‘url’,255)->nullable(); $table->string(‘target’,255)->nullable();$table->string(‘icon_class’,255)->nullable(); $table->string(‘color’,255)->nullable();$table->integer(‘order’); $table->string(‘route’,255)->nullable();$table->text(‘parameters’)->nullable(); $table->foreign(‘menu_id’)->references(‘id’)->on(‘menus’);$table->integer(‘parent_id’)->nullable(); ..

Read more

I have an error: "Trying to get property ‘id’ of non-object (View: C: xampphtdocsklikdesakuresourcesviewsadminpostscreate.blade.php)" I had used it without laravel collective form (i don’t know its name) example: {{!! Form::select() !!}} This is my code: create.blade.php @foreach ($categories as$category ) <option value="{{$category->id}}">{{$category->name}}</option> PostController.php public function create(){         $this->authorize(‘create’, Post::class);$categories = Category::pluck(‘name’,’id’)->all();         return view (‘admin.posts.create’, [‘categories’=>$categories]); } public function store(){$this->authorize(‘create’, Post::class);         $inputs = request()->validate([ ‘title’=>’required’, ‘post_image’=>’file’, //mime: jpeg, png ‘body’=>’required’, ‘category_id’=> ‘required’ ]); if(request(‘post_image’)){$inputs[‘post_image’] = request(‘post_image’)->store(‘images’);         } ..

Read more

Vue Version: 2.6 Laravel Version: 5.4 I have VueJS DOM with :disabled flag within laravel blade file(laravel mix), main data contain, images object like code below: data() { return { images: {} } } then below is piece of button source code: <button :disabled="!images.pict0" @click="showPict(‘pict0’)"> Show Image </button> Communication: Asynchronous Problem: when asynchronous data came, ..

Read more

In Vue3, inline-templates were depreciated and now slots are used. Is it possible to have 2-way binding of variables for Vuejs components written in blade templates? I want to have 2-way binding for Vue components that’s written inline with blade templates. Although I know I can pass data like <example-component name="Hello World"> It is a ..

Read more

I have some custom blade elements (defined inside the boot function of the AppServiceProvider) that I use normally on other pages, but since I recently updated to Laravel 8 my custom elements are rendered like this like this , basically, the page is just rendered as it is without using the components (even though they ..

Read more

I´m traying to create one button that it has width 100% in blade if only have only one post in blog. i explaning better. i´m doing a blog. When open post i can see my post and two button (previous and next) if i´m in last post i want that previous button has withd 100% ..

Read more

I´m traying to create one button that it has width 100% in blade if only have only one post in blog. i explaning better. i´m doing a blog. When open post i can see my post and two button (previous and next) if i´m in last post i want that previous button has withd 100% ..

Read more

I’m getting into laravel and I’m trying to work with blade templating but its not rendering. All my examples are coming for the laravel documentation. This has made me made for 3 days. Please HELP So here is my demo.blade.php located in resources/views/demo.blade.php <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Pagetittle</title> </head> <body> <h2>Template’s content</h2> ..

Read more

I have been searching for the net to get my problem solved, but I can’t find the specific one. Now I resolved it by myself, I decided to share it. Imagine you are calling api to get posts via axios in vue component, and you want to view the detail of the selected post and ..

Read more

How i can get data from view and send it to controller for exmple $banner[‘Top-right’] how i can send "Top-right" to controller to select all banner in this location //$location = Top-right $banner=Banners::where(‘location’,$location)->first(); Sourc..

Read more

How i can get data from view and send it to controller for example $banner[‘Top-right’] how i can send "Top-right" to controller to select all banner in this location //$location = Top-right $banner=Banners::where(‘location’,$location)->first(); Sourc..

Read more

Hi i have laravel collection data as shown on images below, i need the data collection show as format below | ID | UMUR 1 | UMUR 2 | UMUR 3 | UMUR 4 | SUM | | — | —— | —— | —— | —— | —–| | 1 | 0 | 0 ..

Read more

I’m using Laravel blades/views to generate files by templates from the custom console command. Unfortunately, any of the variants from official documentation are not working. This is how I’m trying to pass data to the view: $info = ‘Some info’; view(‘my_template’, compact(‘info’)); or view(‘my_template’, [‘info’=>’Some info’]); or view(‘my_template’)->with([‘info’=>’Some info’]); or use View as View; View:make(‘my_template’,[‘info’=>’Some .. Read more I’m working with livewire on laravel 8 and I have a component that contains a table, some buttons and a set of modals to make some operations with the date from the tables. There’s one modal that contains three @Foreach loops for three select input fields, whose values are being gotten from the component’s controller. .. Read more Okay, so when i just add to Laravel blade view another blade with @include it throw me a code as plain text. blade1.blade <div class="container-fluid"> @include(‘chat’) </div> chat.blade <div class="row"> <div class="col-md-5"> @role(‘Admin’) @if($data[‘users’]->count() > 0) @foreach($data[‘users’] as$user) <div class="panel panel-default start" style="display:block"> <div class="panel-heading chat-toggle" data-id="{{ $data[‘messages’] }}" data-user="{{$user->to_user }}"> <h3 class="panel-title"><i ..

Read more

I am currently building a feature where a user can select an option from a select box, once an item is selected you can click a button which hits my endpoint which submits and stores it. However if i dont select anything but then click the button it just hits a 404 page on the ..

Read more

I know about something like this: {{ old(‘contents’, $page->contents ?? null) }} But what about more complicated cases, like checkboxes and selects? <select id="custom_template" name="custom_template"> {{–default empty option, if nothing is selected yet–}} <option label=" " {{ ($page->custom_template == null)? "selected" : "" }}></option> @foreach($templates as$template) <option value="{{ $template->id }}" {{ ($page->custom_template == \$template->id)? ..

Read more

I have a drop-down menu on the page, when I click "Logout" and when I click Exit, I want it to perform its function and return to the main page (welcome), and when I click "Logout", it gives an error 404, NOT FOUND. I don’t understand how to change the path (logout button at the ..

Read more

Cannot resolve file ‘logo.png’ – said the HTML <img src="logo.png" alt="Logo" width="314" height="70"> The HTML keeps saying it can’t find it, but it works. Meanwhile, if I tell it that it’s in public/logo.png, then its a broken image. If this is a feature, how can I turn off this markup. If It works, I don’t ..

Read more

I am a newbie to laravel. Please humour me. I am working on a website that can be used in two different languages. I have two files, en.json and te.json, in resources/lang: // en.json "language-text": "English" // te.json "language-text": "తెలుగు" I need to make it obvious to the visitors that they can use the website ..

Read more