Laravel

112

Solutions

135

Contributors

Laravel is a free, open-source PHP web application framework for the development of web applications following the model–view–controller (MVC) architectural pattern. Some of the features of Laravel are a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, utilities that aid in application deployment and maintenance, and its orientation toward syntactic sugar. Laravel is regarded as one of the most popular PHP frameworks.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hi All,

I use laravel. I want to update database using

$data = DB::connection('sqlsrv2')->statement('exec [spname] ?, ?',  [$empcode, $pwd])';

The response is ok, but it does not update database.

What is the problem?

Thank you.
0
CompTIA Network+
LVL 13
CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

Hi All,

I have application that created using laravel.
When idle the current screen still appear.
Could we set it back to login form at idle time is reached without user interference?

Thank you.
0
I'm working my way through a Laravel tutorial and it's going well.

I'm creating my migrations and doing my "seeding" and I understand THAT you have to use "composer dump-overload," what I don't understand is WHY.

Why is that a needful part of "seeding?" What's going on under the hood that "composer dump-overload" is necessary?

Thanks!
0
Hi All,

I use laravel to show the screen format. See the attachment.

The problem is at the gadget. There is no scroll bar for filter part.
There is scroll bar for the chart part.

How to solve this problem?

Thank you.
GADGET-VIEW.jpeg
BROWSER-VIEW.PNG
0
Hi,
I'm using the below code as an example in Laravel 5.0 to retrieve a vehicle's history.
This works, but it seems like I'm not really utilizing laravel at all and doing it using a clunky curl setup.
Laravel 5 has a SoapClient I can include, but no clue how I'd utilize based on below.

the company I'm retrieving data from has a number of operations and a few ways to get the data ie: xml, json and soap1.2 (which is what I'm referencing).
https://partnerhub.pbsdealers.com/metadata

example below is: RepairOrderContactVehicleGet

Do you know of a better/simpler way I can utilize this API in Laravel 5?

I like the idea of the json one, but no idea how I'd use it. Or a better way of the soap approach.


		$username	= "myuser";
		$password	= "mypass";
		$pbs 		= 7111;
		
	$request = '
	<soap12:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soap12="http://www.w3.org/2003/05/soap-envelope">
    <soap12:Body>
	<RepairOrderContactVehicleGet xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/PBS.PartnerHub.ServiceModel">
	<OpenDateSince>2017-01-01T00:00:00</OpenDateSince>
	<SerialNumber>'.$pbs.'</SerialNumber>
	<VehicleRef>a37cf36b-f756-4d18-bafe-7c90c750e794</VehicleRef>
	</RepairOrderContactVehicleGet>
	
	</soap12:Body>
	</soap12:Envelope>';


$requestURL ="https://partnerhub.dealers.com/soap12";
	$ch = curl_init();
	$header[] = "Content-type: 

Open in new window

0
Hi All,

I use coreUI template and laravel.
Is there any way to change the grid row height. Just  set once using blade. and it could be used for all page?

Thank you.
1
Hi All,

I have below display.
Please have a look at the image.
Is there possible to put the button at the same row with the data filter (drop down) ?

Thank you.
Arrange-Display.PNG
0
Im having trouble iterating through this nested array.

I cant seem to figure out how to reference the groups[] first value for each row. I'm trying to insert it into the GroupID column. For example the '2125a02a-f28e-11e4-ad33-89d58f4ed955' in the first one below would be the first GroupID

Looks like:

groups[2125a02a-f28e-11e4-ad33-89d58f4ed955]
0	4ec28c6a-6294-5329-fe01-57dc3228e4c2
1	a6a1f81f-33f1-79d8-3f61-5c8fb5e27e16

groups[24cd7e3c-f28e-11e4-ad33-89d58f4ed955]
0	4ec28c6a-6294-5329-fe01-57dc3228e4c2
1	364a7c59-da10-567d-268d-57dc323de111

groups[3efd3a5e-f28e-11e4-ad33-89d58f4ed955]
0	4e666186-4c18-eb53-c36a-5cebf8286305
1	4ec28c6a-6294-5329-fe01-57dc3228e4c2
2	a6a1f81f-33f1-79d8-3f61-5c8fb5e27e16

Open in new window


I'm iterating through it like:
foreach($groups as $group)
		{
			foreach($group AS $rep)
			{
				DB::table('connect_teams')->insert([
				'dealer_id'	=> $dealer_id,
				'UserId'	=> $rep,
				'GroupId'	=> how to get the $groups[currentvalue]??
				]);
		
			}
		}

Open in new window

any help would be much appreciated
0
I have a page (http://einsteinsolutions.xyz/chaminuka/public/home) that loads artwork images which are a lot. I am using Lazysizes (https://github.com/aFarkas/lazysizes) to lazyload the images in order to quicken the page load time and only display images that are in focus on the page.

The problem I am facing is that the images are being jumbled up (refer to attachment) together resulting in an undesired result. Please note that, I want to use the "non-responsive" option for this.

Code snippet
<script src="lazysizes.min.js" async=""></script> // include the lazysizes library

<!-- html extract -->
<div class="row">
    <div class="col-md-12">
        <ul class="grid effect" id="grid">
            @foreach($artworks as $artwork)
                @foreach(json_decode($artwork->photos) as $photo)
                <li>
                    <a class="fancybox" data-fancybox-group="gallery" title="{{ $artwork->name }}" href="{{ route('artwork_profile_path', ['artwork' => $artwork->slug]) }}">
                        <img class="lazyload" data-src="{{ asset($photo) }}" alt="" />
                    </a>
                </li>
                @endforeach
            @endforeach
        </ul>
    </div>
</div>

Open in new window

Untitled.jpeg
0
I am having issues installing Laravel, please see the pic, I need a guide on how to install it.

Thank you
Laravel.jpg
1
OWASP: Threats Fundamentals
LVL 13
OWASP: Threats Fundamentals

Learn the top ten threats that are present in modern web-application development and how to protect your business from them.

Hi Experts,

Need help in php laravel with an art gallery application.  We are setting up a private art collection online and taking high res professional images.  We have a laravel backend and can upload art, but content team is entering large images e.g. 24mb for one image.   In our front-end website gallery, we need to compress the uploaded images for web so they do not consume data.  When zoom on art, it is loading the 24mb file but we wish to compress to max 500kb per image regardless of size but dimensions remain the same.  Please help with how we can get this done as new to laravel and have basic php skills not used in a long time.

Thanks
0
Hi,
I'm sure its simply something obvious but I can't seem to figure it out:

I have a query in Laravel that I'm getting to retrieve all my users.

$users = DB::table('users')
      ->join('dealerships', 'users.dealership_id', '=', 'dealerships.id')
      ->join('roles', 'users.role_id', '=', 'roles.id')
      ->select('users.*','roles.*','dealerships.name')

Currently this returns all the users that are assigned to a dealership (records that have a value for users.dealership_id) . Problem is I need all the users regardless if a dealership has been assigned to them. I could skip the join, but I need the dealership name for those records that have a dealership assigned to them

if there someway to join the tables so I get all users and within my results also the dealership name for those that have one?



 Hope that makes sense. Thanks in advance.
0
I need to deploy AWS server for online test.
On my App I'm using PHP 7.2 , laravel and mysql as database,
The test is made of 10 questions with 5 true or false answers on each question.
The problem is because this online test is for about 4,000 students at the same time.
The test will be taken two times a month.
What's the better deploy and the better configuration for me.
0
I'm new to Laravel and I'm trying to figure this out.

I'm working through the tutorial at https://www.youtube.com/watch?v=v6SZerzfgIg.

My code right now looks like this:

Here's my "home.blade.php:"

<form action="/insert" method="Post">

Open in new window


My web.php page has my routes structured like this:

Route::get('/home', 'HomeController@index')->name('home');

Route::get('/display','InsertController@index');

Route::post('/insert', 'InsertController@add');

Open in new window


My InsertController looks like this:

use Illuminate\Http\Request;

class InsertController extends Controller
{
	
	public function display() {
		
	}
	
    public function add(Request $request) {
		
		add::display(Request::all());

	}
   
}

Open in new window


I'm thinking that "add::display(Request::all())" is targeting my "add" model sitting in my "app" directory. At that point, I've got this:

<?php

namespace App;

use Illuminate\Database\Eloquent\Model;

class add extends Model
{
    protected $fillable = ['question_text', 'keywords', 'required', 'type', 'answer_a', 'answer_b', 'answer_c', 'answer_d', 'answer_e'];
}

Open in new window


I'm wrong, apparently. Because when I submit my form, I get this error:

Class 'App\Http\Controllers\add' not found

What am I doing wrong? And am I right in assuming that this code:

add::display(Request::all());

...is going to submit my data and then grab the "display" method and show that page?

I'm a mess...

Straighten me out, please...
0
What is the cleanist way to make ajax calls on content that is dynamically generated? For example  i have a laravel controller that returns data organized into divs:

$counter = 1;
foreach($data_set as $data){
<div id="$counter" data-content="$id">$data</div>

$counter++
}

endforeach;

Open in new window


So if i return 3 results
<div id="1" data-content="45">$data</div>
<div id="2" data-content="66">$data</div>
<div id="3" data-content="22">$data</div>

Open in new window


Now i want to use an ajax call to drill further down into that data so i need an ajax call to grab the data-content field from id="1" which will then return me another subset of data

<div id="1" data-content="45">$data</div>
                       <div id="1a" data-content="45">$item</div>
                       <div id="1b" data-content="45">$item</div>
                       <div id="1c" data-content="45">$item</div>
<div id="2" data-content="66">$data</div>
<div id="3" data-content="22">$data</div>

Open in new window


What is the easiest way to do this with JAvascript if my ID's are being generated dynamically? Use a loop and a this keyword to get the array key of the element being clicked ?
0
I am having trouble finding out how to do routing with PHP.

I know WordPress and Laravel use it, but I was wondering how to code it.

I realize it would use Apache mod rewrite, but I'm having trouble figuring out how to do routing without a framework in PHP.
1
I'm starting a new web development project and have decided on using PHP with the latest version of the Laravel framework (currently v5.7). I'll likely be deploying to AWS, and will be using Amazon Aurora as the database engine (which is supposed to be MySQL compatible).  As I prepare to dive in, a few questions have come to mind that I'm hoping someone here can answer.  I'm relatively new to the Laravel framework, I must say, so I a apologize in advance for my ignorance.

1) What options are available to me for setting up a local development environment under Windows 10 Home Edition (64-bit)?  So far, I've read about using Vagrant/Homestead, (which sounds complicated and like it might require Windows 10 Professional) -- and also using WAMP, which I already have installed and running on my machine. By any chance, does some kind of pre-configured Virtual Box disk image exist anywhere that I could download and install that would simplify things for me?  

2) Is there anything important that I need to keep in mind (that's not so obvious) regarding the supposed MySQL compatibility of Amazon's Aurora database engine as I'm developing and/or deploying?  Can I safely treat Amazon's Aurora as a normal MySQL database engine, or are there any "gotchas" that I should be aware of such as driver compatibility, etc?

3) What's the most current trend regarding which templating system to use with Laravel? I know that it comes with the Blade templating engine, and I've heard some …
0
We´re providing online exam for ours members. The exam can be done in computer, tablet or smartphone. The exam have from 5 to 10 questions with 5 true or false afirmatives in each question. The exam have especific date, time and duration (20 minutes),  occurs quartely in all country, on centers with supervisors. The System use PHP language with laravel and Mysql. My question is if there´s any way to know if anyone during the exam copy the screen with the question and answer ? (like print scr button, or press three fingers on android screen)
0
How do I separate this "tue-09:00 AM-10:00 AM" in the format Start Time: 9:00 AM End Time: 10.00AM using angularjs?
I have table in which the day and time is getting stored in this ("tue-09:00 AM-10:00 AM" ) format, when I have to view the data I want it to be in the above format.
How can it be done?
0
Bootstrap 4: Exploring New Features
LVL 13
Bootstrap 4: Exploring New Features

Learn how to use and navigate the new features included in Bootstrap 4, the most popular HTML, CSS, and JavaScript framework for developing responsive, mobile-first websites.

I'm a few months away from starting to take on Freelancing gigs.

I was wondering how to do my books/bill clients.

I had a fantasy about using Laravel to create a separate site on a subdomain that would bill clients and export a CSV. But I've been thinking about using Freshbooks.

I will probably offer subscription services (hosting/maintenance) which I want to bill using the web.

My website will be WordPress.

I'm not sure how to handle billing, and I want to have a good system down when I start. I know that Freshbooks has an API.

What would be the best way to handle this?
0
I have written a function to insert data into database. I want to know how to update the row data when inserting again?
public function detailsInsertion(Request $request) {
Log::info($request->all());

$link = \App\Models\Gallery::where(['id'=>$this->getSelectedSchoolId()])->first();

if($link){
  $input=$request->all();
  if ($request->hasFile('file')) {
      $file = $request->file('file');
      $file->move('images/'.$this->getSelectedSchoolId().'/websitehome', $link->id.'.'.$file->getClientOriginalExtension());
      $copy='/images/'.$this->getSelectedSchoolId().'/websitehome/'.$link->id.'.'.$file->getClientOriginalExtension();
       $input['source_url']=$copy;
       }
       $link->fill($input);
       $link->save();
       Log::info("checking");
}else{
        $link =  \App\Models\Gallery::create(['id'=>$this->getSelectedSchoolId(),'source_url'=>'images/image-not-found.png']+$request->all());
        if(count($request->social_media)!=0 && count($request->social_url)!=0)
        {
          $social_media = $request->social_media;
          $social_url = $request->social_url;
          foreach (array_combine($social_media,$social_url) as $media=>$link) {
           
            $insert_social_link = \App\Models\Gallery::create(['section_type'=>'social_media','name'=>$media,'description'=>$media,'source_url'=>$link]);
          }
        }
        if ($request->hasFile('file')) {
            $file = $request->file('file');
            

Open in new window

0
How to get attendance per day of a student in jquery? I have combo box where there are 2 options "full day", "subject wise". On click of subject wise entire teacher data, date time is shown but if its full day then how to write in jquery to get student attendance for the entire day?
0
Hi Experts

Could you point what is needed in terms of Apache2.x  configurations to runs Laravel apps ?

The examples I had run uses Laravel's internal server
 http://localhost:8000/

Open in new window


And I want to run from Apache.

Thanks in advance!
0
Hi Experts

Could you point how to correctly configure PHP to use with Laravel?

After a composer update this error occurs
- laravel/framework v5.2.9 requires ext-mbstring * -> the requested PHP extension mbstring is missing from your system.

To enable extensions, verify that they are enabled in your .ini files:
    - /etc/php/7.2/cli/php.ini
    - /etc/php/7.2/cli/conf.d/10-mysqlnd.ini
    - /etc/php/7.2/cli/conf.d/10-opcache.ini
    - /etc/php/7.2/cli/conf.d/10-pdo.ini
    - /etc/php/7.2/cli/conf.d/20-calendar.ini
    - /etc/php/7.2/cli/conf.d/20-ctype.ini
    - /etc/php/7.2/cli/conf.d/20-exif.ini
    - /etc/php/7.2/cli/conf.d/20-fileinfo.ini
    - /etc/php/7.2/cli/conf.d/20-ftp.ini
    - /etc/php/7.2/cli/conf.d/20-gettext.ini
    - /etc/php/7.2/cli/conf.d/20-iconv.ini
    - /etc/php/7.2/cli/conf.d/20-json.ini
    - /etc/php/7.2/cli/conf.d/20-mysqli.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_mysql.ini
    - /etc/php/7.2/cli/conf.d/20-pdo_sqlite.ini
    - /etc/php/7.2/cli/conf.d/20-phar.ini
    - /etc/php/7.2/cli/conf.d/20-posix.ini
    - /etc/php/7.2/cli/conf.d/20-readline.ini
    - /etc/php/7.2/cli/conf.d/20-shmop.ini
    - /etc/php/7.2/cli/conf.d/20-sockets.ini
    - /etc/php/7.2/cli/conf.d/20-sqlite3.ini
    - /etc/php/7.2/cli/conf.d/20-sysvmsg.ini
    - /etc/php/7.2/cli/conf.d/20-sysvsem.ini
    - /etc/php/7.2/cli/conf.d/20-sysvshm.ini
    - /etc/php/7.2/cli/conf.d/20-tokenizer.ini
  You can also run `php --ini` inside terminal to see which files are used by 

Open in new window

0
I've been asked to submit a code sample using JQuery and Laravel. It's done and I'm getting ready to zip things up to hand to the administrator but I've got a question.

When I go to zip up the entire Laravel project, the "vendor" and the "node_modules" folders are enormous.

The exercise itself is pretty simple. I think I could get the point across with a couple of blades and the controller. Still, I want them to see the entire site, so here's my question:

Do those who work in Laravel typically expect those two directories? Is there a more streamlined approach to sharing the code to a Laravel site or do you have to box up the whole thing?

Basic question, I know, but it's worth asking if there's a more expeditious way to do things.
0

Laravel

112

Solutions

135

Contributors

Laravel is a free, open-source PHP web application framework for the development of web applications following the model–view–controller (MVC) architectural pattern. Some of the features of Laravel are a modular packaging system with a dedicated dependency manager, different ways for accessing relational databases, utilities that aid in application deployment and maintenance, and its orientation toward syntactic sugar. Laravel is regarded as one of the most popular PHP frameworks.

Top Experts In
Laravel
<
Monthly
>