LaravelSponsored by Jamf Now

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

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
Get expert help—faster!
LVL 12
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

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
Why Laravel is best PHP framework for web development  

As per Google Trends, Stack Overflow Trends, and stars on GitHub, Laravel is not only the most popular PHP framework, it also beats the competition by a substantial margin. The trend has been found in most of the world with India, The US, and China taking the lead.


Read more:  https://goo.gl/LoFKuo
0
using laravel 5.6 only( latest version)Creating a webpage with a form that has the following text input fields: Product name, Quantity in stock, Price per item. The submitted data of the form should be saved in an XML / JSON file with valid XML / JSON syntax. Underneath of the form, the web page should display all of the data which has been submitted in rows ordered by date time submitted, the order of the data columns should be: Product name, Quantity in stock, Price per item, Datetime submitted, Total value number. The "Total value number" should be calculated as (Quantity in stock * Price per item). The last row should how a sum total of all of the Total Value numbers. Solution requirements: Use Php / Html / Javascript / Css. Use Twitter Bootstrap. The form should be submitting the data and updating the data being displayed on the page using Ajax. Thanks in advance.
0
Laravel Logo
Laravel is the most sought after web development framework. It comes with ample amount of features that make it easy for developers to work around it. Know about its features in detail.
0
I have XAMPP running on Windows 10. I am trying to setup a Virtual Host so that when I use "myapp.dev" as a domain I get directly to my public folder of laravel project.
Laravel is located at C:/xampp/htdocs/myapp/public.
By using http://localhost:8000/myapp/public/ i can access laravel index.php
So far i have tried the following:
http v-host.conf file
#this is the default address of XAMPP    
<VirtualHost *:8000>
   DocumentRoot "C:/XAMPP/htdocs/"
   ServerName localhost
</VirtualHost>


<VirtualHost *:8000>
    DocumentRoot "C:/xampp/htdocs/myapp/public"
    ServerName myapp.test
    SetEnv NS_ENV variable_value
</VirtualHost>

and in C:\Windows\System32\drivers\etc\host file

127.0.0.1 localhost
127.0.0.1:8000 myapp.test

and after restarting apache and typing myapp.test leads to iis homepage instead of index.php in public folder.
0
I would like to find out whether is there a way to perform the following:

1) Include (when $id is not null) and exclude (when $id is null) in the where clause for the code below.
2) Switch between sortByDesc and sortBy based on condition ($sort=='asc' then.... $sort=='desc' then...) for the code below.

if($id){
   $maxlimit = Product::where('category_id_fk',$id)->with(['child','price','variant','thumbnail','image','description'])->count();
   $products = Product::where('category_id_fk',$id)->with(['child','price','variant','thumbnail','image','description'])->take($recperpage)->get()->sortByDesc('price.list_price');
}else{
   $maxlimit = Product::with(['child','price','variant','thumbnail','image','description'])->count();
   $products = Product::with(['child','price','variant','thumbnail','image','description'])->take($recperpage)->get()->sortByDesc('price.list_price');
}

Open in new window


The objective is to simplify the code above as much as possible but achieve the same result.

Your help is kindly appreciated.
0
Laravel is one of the best solutions for increasing the revenues of your business. It takes extremely less time for the development of web app using Laravel. The development using laravel is easy and fast. When you are looking for web design services, you want a framework that not only satisfies your specific needs but, a framework, which satisfies multiple needs. A laravel service provider is capable of doing this.
How-Do-Laravel-Development-Services-.jpgWhile doing this, it can boost your business revenue. This blog explains, what makes Laravel service providers the best choice for you to boost your business?
0
Cloud Class® Course: Certified Penetration Testing
LVL 12
Cloud Class® Course: Certified Penetration Testing

This CPTE Certified Penetration Testing Engineer course covers everything you need to know about becoming a Certified Penetration Testing Engineer. Career Path: Professional roles include Ethical Hackers, Security Consultants, System Administrators, and Chief Security Officers.

I am a college student. I have some money I inherited and I was thinking about starting an eCommerce site for vapes and juices.

I wanted some advice to see what platform I should use. To show you where my coding skills are at a project I am working on is available at wookify.com.

I've played around with Woocommerce. I'm intrigued by Magento.

I've also wondered about building an ecommerce site from scratch or with Laravel.

Thanks for your help, if I could make 1k a month I could pay expenses. What do I need to begin researching? Is this a foolish use of my money?
0
can I deploy laravel project without need to install composer into godaddy ?!!
I can't access through SSH , is their another way to work with that .

I start to learn laravel, and in my local machine work fine, I try to deploy at godaddy, most of tutorial need ssh to remotely access and install composer as far as my understanding, and type command line codes to sort things out .

Found a tutorial at youtube allowed me to work laravel without composer, which worked but I couldn't make 404 page work , neither other viewer pages.


working link : http://stchrisapp.com/youtube/
not working 404 page as should be : http://stchrisapp.com/youtube/404   ' it keep show standard godaddy 404 page :( , even if i create other page do same .

I am deploy from windows to Linux server
0
Here are the codes I have written to submit my shopping cart details to paypal.


        private $_api_context;

	public function __construct(){
             $paypal_conf = Config::get('paypal');		
             $this->_api_context = new ApiContext(new OAuthTokenCredential($paypal_conf['client_id'], $paypal_conf['secret']));
             $this->_api_context->setConfig($paypal_conf['settings']); //the problem is here
        }


       //PayPal
        $payer = new Payer();
        $payer->setPaymentMethod('paypal');


        //PayPal
       $items = new ItemList();
       $items->setItems(array(
	     'name'=>$v['name'],
	     'currency'=>'USD',
	     'quantity'=>$v['quantity'],
	     'price'=>$v['price'] * $v['quantity']
       ));


       //PayPal
      $amount = new Amount();
      $amount->setCurrency('USD')
	->setTotal($ship[0]['total_grand']);
				
      $transaction = new Transaction();
      $transaction->setAmount(2.55)
	->setItemList($items)
	->setDescription('Your transaction description');
										
      $redirect_urls = new RedirectUrls();
										
      $payment = new Payment();
      $payment->setIntent('Sale')
			->setPayer($payer)
			->setTransactions(array($transaction));
								
       Log::info($payment);
							
	try {
		$payment->create($this->_api_context);
	}catch (\PayPal\Exception\PPConnectionException $ex){
		Log::info($e->getMessage());
		Log::info($e->getData());
	}catch (Exception $ex) {
		die($ex);
	}
							
	$approvalUrl = 

Open in new window

0
I installed Laravel.

I created a virtual host on my computer with the hostname laravel.local.

When I installed Laravel I chose the name sample-application, and when it installed it, it  created a directory in my public directory that was called sample-application.

My question is really dumb, but because of apache mod rewrite, you won't have to move files around to display a page for laravel.local right?



Screenshot-from-2018-01-20-10-39-25.pngScreenshot-from-2018-01-20-10-39-28.pngScreenshot-from-2018-01-20-10-39-21.png
0
Hi,
I have a datatables table I am using to allow a person to resort the row order of the slides (see attached as example). In my mysql table I am using an additional column to set the row order of each row.
So essentially in mysql I have
id - primary auto increment
SlideOrder - I am using for the sequence
SlideTitle
and a couple created/modified datetime etc.

 
table example
When the user drops a row into place the code I'm using is below to send to server ( I start getting sketchy here on in):

oTable.on( 'row-reorder', function ( e, diff, edit ) 
{
var result;
var sendloop = [];
 		
	for ( var i=0, ien=diff.length ; i<ien ; i++ )
	{
		var rowData = oTable.row( diff[i].node ).data();
		result = ''+diff[i].newData+','+diff[i].oldData+'';
		sendloop.push(result);
	}
        	
	var jsonString = JSON.stringify(sendloop);
   
$.ajax({
        type: "GET",
        url: "/dealboxx/ohs/admin/sort",
        data: {data : jsonString}, 
        cache: false
    });
    });

Open in new window


The result of which sends an ajax request and the data variable (when I drag row 1 below row 4 for example):
data["1,2","2,3","3,4","4,1"]

Had I dragged row 2 below row 3 initially I'd be sending:
data["2,3","3,2"]

Had I dragged row 3 in front of row 1:
data["1,3","2,1","3,2"]

When the data gets to my server (my wrong code) does this:
public function sortCourse(Request $request)
    {
	$obj = json_decode($request->input('data'), true);
	
	foreach($obj as $row)
	{
     
		$insertArray = explode(",",$row);
		
		$slidechange = DB::table('ohs_courses_content')
			->select('id')
			->where('SlideOrder',$insertArray[1])
		    ->first();
		
    
	DB::table('ohs_courses_content')
            ->where('id', $slidechange->id)
            ->update(['SlideOrder' => $insertArray[0]]);
 	 	}
	
    
    }

Open in new window


Depending on what I initially dragged it may work (if I'm dragging down or up). Couple drags into it and its a mess.

So my logic etc is no doubt totally wrong.

any help would be very much appreciated as always.
tj
0
I am running composer global require "laravel/installer"

I'm getting the following output

brian@brian-XPS-13:~$ composer global require "laravel/installer"
Changed current directory to /home/brian/.composer
Cannot create cache directory /home/brian/.composer/cache/repo/https---packagist.org/, or directory is not writable. Proceeding without cache
Cannot create cache directory /home/brian/.composer/cache/files/, or directory is not writable. Proceeding without cache
./composer.json is not writable.

Open in new window


I'm running Ubuntu 16.04.
0
I want to display message with ajax  :
but i have this error in the console :
Cannot use 'in' operator to search for 'length' in L'email ou le mot de passe est incorrect.

Function Ajax
<script type="text/javascript">
   $(document).ready(function() {
        $(".login-btn").click(function(e){
             e.preventDefault();


            var _token = $("input[name='_token']").val();
            var email = $("input[name='email']").val();
            var password = $("input[name='password']").val();


            $.ajax({
                url: "/login",
                type:'POST',
                cache: false,
                data: {_token:_token,email:email, password:password},
                dataType: "json",
                success: function(data) {
                    if($.isEmptyObject(data.error)){
                        window.location = 'home';
                    }else{
                        // $(".print-error-msg").find("ul").html('');
                        // $(".print-error-msg").css('display','block');
                        // $.each( data, function( key, value ) {
                        //     $(".print-error-msg").find("ul").append('<li>'+data.error+'</li>+');
                        // });
                        printErrorMsg (data.error);

                    }
                },
                error: function(response){
                    $(".print-error-msg").find("ul").html('');
                    

Open in new window

0
I've been taking on the occasional client, undercharging for my hours to meet market rates, but I just discovered Wordpress and I realized I can have enough output (you know for the average site someone wants to have built) and I can charge extra for custom plugins or Laravel or other solutions that require something more than Wordpress.

After 2018 I would like to start taking on clients - I would like to have the following on my portfolio
-Ecommerce site for local business built with Woocommerce
-Ecommerce site built for another local business built with Woocommerce
-consolidatedutilities.com rewritten in Laravel, possibly with a new design
-effinghamministorage.com possibly redone with wordpress
-pwsmeetup.com - a social media site for people with prader willi syndrome written in Laravel
-umstream.net - a streaming audio site for Umphrey's Mcgee written with Laravel and React

Would listing these sites be a good idea or a bad idea? Should I use Google Adwords? How much do I need to save up for advertising when I build a site advertising services?

I'm going to offer hosting and security. I'm studying Cyber Security and I don't know if I should put that.

I have Schizophrenia and Bipolar and it's a lot harder for me to communicate professionally that it is for most people. Presenting myself well will be a challenge, but I know that my work will be good. I have to work very hard at this, it doesn't come naturally to me, at least not since my diagnosis.

0
I want to create a streaming audio site for a band that allows taping. A site that it will be similar to is this one http://www.panicstream.com/vault/widespread-panic-04192009-orange-beach-al/

How do I create a Streaming Audio site?

I'm not going to mess with Laravel right now, but I want to create a primitive Model View Controller for this site. Can you reference materials on how to build a MVC site?

Thanks
0
Introducing Cloud Class® training courses
LVL 12
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

I am a Cyber Security major. I've done a lot of programming as a hobbyist, and when I got into Java (and later when I looked at Swift) I felt like I was experiencing some major breakthroughs with Object Oriented Programming and PHP.

I have Crohn's so I didn't even complete the first course which only went up to multidimensional arrays.

So now I need some guidance - do I work out of PHP Patterns Objects and Practice before learning a framework? That book covers Object Oriented Design as well as the concepts.

Should I do that or just move to Laravel and start learning that?

What would be best.

A huge question I have about object oriented frameworks are - can you add functionality that's not built into the framework into your application?

When designing a complex website do you want to use an existing framwork or build your own? If you use an existing one and functionality isn't built in how do you add functionality?
0
I have 5 tables namely product, category, price, inventory and image.

In my product table I have a foreign key column (category_id_fk) referencing to category table primary key column (id). In my product model I have the following function defined:

    public function price(){
		return $this->hasOne('App\Models\Price','product_id_fk');
    }
	
    public function inventory(){
		return $this->hasOne('App\Models\Inventory','product_id_fk');
    }
	    
    public function image(){
		return $this->hasMany('App\Models\Image','product_id_fk');
    }
	
    public function category(){
                return $this->belongsTo('App\Models\Category','id');
    }

Open in new window



In my category model I have the following function defined:

      public function product(){
		return $this->hasMany('App\Models\Product','category_id_fk');
      }

Open in new window


I have performed the following query:

$product = Product::with('price','inventory','image')->get();

Open in new window


The result is it return all records that exist in the product table and associated tables (price, inventory, image) which is correct.

However when I attempt to perform similar action by including the category table

$product = Product::with('category','price','inventory','image')->get();

Open in new window


The result is it return all records that exist in the product table and associated tables (price, inventory, image) but the category record is incorrect (either null or unrelated record).
incorrect.txt
0
We are currently running a laravel 5.3 site using php 5.6 and would like to use caffeine for those users who insist on leaving forms open  on their devices for extended periods of time.
Unfortunately, it seems that the only version of caffeine I can find to install requires php 7.0, which we will not be prepared to upgrade to for some time.
Does anyone have a workaround?
Thanks!
0
Hey, guys!

Here's a snippet from a page called "user.class.php:"

 function updateDevices() {
        global $S;
        global $CN;
        date_default_timezone_set('America/Chicago');
        $maxHistory = date('Y-m-d',strtotime("now - 2 weeks"));
        $R = new xajaxResponse();
        $fitBitCalls = array( '/1/user/-/body/weight/date/'.date('Y-m-d').'/'.$maxHistory.'.json',
        '/1/user/-/body/fat/date/'.date('Y-m-d').'/'.$maxHistory.'.json',
        '/1/user/-/body/log/weight/goal.json',
        '/1/user/-/body/log/fat/goal.json',
        '/1/user/-/activities/steps/date/today/max.json',
        '/1/user/-/activities/calories/date/today/'.$maxHistory.'.json',
        '/1/user/-/activities/distance/date/today/'.$maxHistory.'.json',
        );
        //See if this user any devices that have not been synced.
        $stmt = $CN->prepare("SELECT * 	FROM hraUserDevices  UD INNER JOIN hraUserDeviceTypes UT  ON UD.udtID = UT.udtID  WHERE usrID = ? AND (DATEDIFF(day,udFetchedLastDate,getdate()) IS NULL OR DATEDIFF(day,udFetchedLastDate,getdate()) >=1) AND (udUpdating IS NULL  OR udUpdating !=1 OR DATEDIFF(day,udFetchedLastDate,getdate()) >=2)");
        $stmt->execute(array($S->usrID));
        $devices = $stmt->fetchAll();
        $update = $CN->prepare("UPDATE  hraUserDevices SET udUpdating = ? WHERE udID = ? ");

Open in new window


The question I have is, "What is $CN?"

Obviously, it's a database connection. My problem is that it's not defined anywhere on the page, nor is EVER defined that I can see anywhere in the app.

You do, however, have this at the top of the same page:

	private $cn; // $cn = VARIABLE HOLDING THE DB CONNECTION

	function __construct(PDO $conn) {
		if (!isset($conn))
			throw new Exception('User objects must be passed a PDO Connection object ($this->cn) upon construction');
		$this->cn = $conn;
	}

Open in new window


Is there a convention that I'm missing? $CN is not equivalent to $cn, and yet throughout the entire app you see repeated references to $CN but I can't find anywhere that $CN is actually defined.

Any ideas?
0
Hi I want to update the DB when drag and drop.

I post here the question on SO and you can check all the code.

I will be really appreciated, i'm really stocked.

Link: https://stackoverflow.com/questions/45839623/update-database-when-drag
0
Have integrated social for facebook. It provides only name .But i require birthdate, first and last name, email and phone number.
Same for twitter and google

[token] => XXX
    [id] => 11111111111111
    [nickname] =>
    [name] => Treo Infotech
    [email] =>
    [avatar] => https://graph.facebook.com/v2.10/11111111111111/picture?type=normal
    [user] => Array
        (
            [name] => Treo Infotech
            [id] => 11111111111111
        )

    [firstname] =>
    [lastname] =>
    [avatar_original] => https://graph.facebook.com/v2.10/11111111111111/picture?width=1920
0

LaravelSponsored by Jamf Now

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
>