Laravel

67

Solutions

80

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

I want to know your opinion about site bayt, I want to ask developer framework laravel or other framework, what is the estimated time to realize a site like https://www.bayt.com/fr/
0
On Demand Webinar - Networking for the Cloud Era
LVL 8
On Demand Webinar - Networking for the Cloud Era

This webinar discusses:
-Common barriers companies experience when moving to the cloud
-How SD-WAN changes the way we look at networks
-Best practices customers should employ moving forward with cloud migration
-What happens behind the scenes of SteelConnect’s one-click button

We need a website for offering jobs and recruitment just like this one https://www.bayt.com
there are different ways to do that. we can develop our own frame work for it or we can use open source for the backend and maybe tamplates for the front end.
I want you to analyse this project requirements .
Please help me to find the requirements for this project.
0
Hi everybody.
So I finally decided to start with Laravel. I have followed this tut after having found not clear enough the official doc (since following that I didn't succeed accessing the example website): https://medium.com/@eaimanshoshi/i-am-going-to-write-down-step-by-step-procedure-to-setup-homestead-for-laravel-5-2-17491a423aa

With everything in place, I typed first
git clone https://github.com/laravel/homestead.git Homestead

Open in new window

Then this
cd Homestead
bash init.sh

Open in new window

I have edited the homestead.yaml:
---
ip: "192.168.10.10"
memory: 2048
cpus: 1
provider: virtualbox

authorize: ~/.ssh/id_rsa.pub

keys:
    - ~/.ssh/id_rsa

folders:
    - map: m:/htdocs/LARAVEL_PROJ
      to: /home/vagrant/Code

sites:
    - map: homestead.app
      to: /home/vagrant/Code/Laravel/public

databases:
    - homestead

# blackfire:
#     - id: foo
#       token: bar
#       client-id: foo
#       client-token: bar

# ports:
#     - send: 50000
#       to: 5000
#     - send: 7777
#       to: 777
#       protocol: udp

Open in new window

A first doubt: homestead.yaml should be .homestead directory but I get it in Homestead directory in my personal directory. Did something went wrong?
And edited the Windows hosts file.
I have created  the ssh key
ssh-keygen -t rsa -C “your_email@example.com”

Open in new window

and I have logged in
homestead ssh

Open in new window

I have launched vagrant (with or without using the shorcut described in the tutorial)
Then I have created a laravel project
composer create-project --prefer-dist laravel/laravel Laravel

Open in new window

The folder Laravel is created ion the virtual machine but not on my hard disk: I can't get it!

Any idea?
0
I am attempting to apply multiple if condition along with the where condition for filtering purpose as below

		$name=$request->input('name');
		$age=$request->input('age');
		$gender=$request->input('gender');
		$company=$request->input('company');
					
		$employees = DB::table('employee')
								->select('id', 'name', 'age', 'gender', 'company')
								->where(function($query) use($name){
										if(!empty($name)){
											$query->where('name','=',$name);
										}
										if(!empty($age)){
											$query->where('age','=',$age);
										}
										if(!empty($gender)){
											$query->where('gender','=',$gender);
										}
										if(!empty($company)){
											$query->where('company','=',$company);
										}
										return $query;
								})
								->get();

Open in new window


However only this condition applies

if(!empty($name)){
											$query->where('name','=',$name);
										}

Open in new window


where else the other conditions are ignored.

Your help is kindly appreciated.
0
Here's the HTML that sets everything in motion:

 <li role="presentation"><a href="#summary" aria-controls="summary" role="tab" data-toggle="tab">Health Summary</a></li>

"#summary" - triggers this function:

    $('a[href="#summary"]').on('click', function(){
        setTimeout(function(){
            HealthSummary.init();
        }, 250);
    });

HealthSummary.init - not sure what that means other than, "initialize." There's another script has this:

var HealthSummary = {
    
    initialized: false,
    
    init: function(){
        var self = this;
        
        if (self.initialized) {
            return true;
        }
        
        $('.health-summary[data-id]').each(function(i){
            
            var $this = $(this),
                id = $this.attr('data-id');
            
            if (id === '') {
                $this.html('<h3 class="text-center">Invalid health summary reference</h3>');
                return true;
            }
            
            $this.html('<h3 class="text-center"><i class="fa fa-refresh fa-spin"></i> &nbsp;Loading Health Summary...<br /><small>(This should only take a few seconds.)</small></h3>');
            
            $.get('/health-summary/' + id, function(resp){
                if (resp.error) {
                    $this.html('<div class="alert alert-danger">' + resp.msg + '</div>');
                    return false;
                }
                
                $this.html(resp.data.html);
   

Open in new window

0
Hi Experts, trying to install a Laravel application, and everything seems to be loading fine as intended, although when i try to install..any link is clicking through to localhost/appname instead of localhost:8888 ..not sure how to update this in laravel app, must be an .htdoc issue maybe...?  I am running on localhost.  Help much appreciated
0
Employee.php

			<tbody>
				<tr ng-repeat="person in employee | orderBy:orderByField:reverseSort">
					<td>{{person.name}}</td>
					<td>{{person.age}}</td>
					<td>{{person.gender}}</td>
					<td>{{person.company}}</td>
					<td>
						 <div class="btn-toolbar" role="toolbar">
							<button class="btn" ng-click="viewEmployee(person.id)"><span class="glyphicon glyphicon-eye-open"></button> 
							<button class="btn" ng-click="editEmployee(person.id)"><span class="glyphicon glyphicon-pencil"></button> 
							<button class="btn" ng-click="deleteEmployee(person.id)"><span class="glyphicon glyphicon-trash"></button>
						 </div>
					</td>
				</tr>
			</tbody>
			<tfoot>
				<tr>  
                    <td align="center" colspan="6">  
                        <div class="pull-right">  
                             <pagination total-items="totalCount" ng-change="pageChanged()" items-per-page="pageSizeSelected" direction-links="true" ng-model="pageIndex" max-size="maxSize" class="pagination" boundary-links="true" rotate="false" num-pages="numPages"></pagination>  
                             <a class="btn btn-primary">Page: {{pageIndex}} / {{numPages}}</a>  
                        </div>  
                     </td>  
                </tr>  
			</tfoot>

Open in new window



EmployeeController.php

	scope.maxSize = 5;
	scope.totalCount = 0;
	scope.pageIndex = 1;
	scope.pageSizeSelected = 5;

        scope.init = function(){
              $http({
			method: 'GET',
			url: "/api/v1/employee/list?pageIndex=" + scope.pageIndex + "&pageSize=" + scope.pageSizeSelected
              }).then(function successCallback(response){
			scope.totalCount = response.data.length; 
                        scope.numPages =  Math.ceil(scope.totalCount / scope.pageSizeSelected);			
		        scope.employee = response.data;
              });
        };

       scope.pageChanged = function(){
		scope.init();
	};

Open in new window


How do I handle pageIndex in laravel? Apart from that I am receiving an error: [orderBy:notarray] when returning in the following manner:

  public function lsAll(){
        $employee = Employee::paginate(5);
	return $employee; 
  }

Open in new window

0
how to get the column value in database for using laravel query?
0
Upon pressing the search button, the values in the form-control disappear.  How do I retain the form control values after triggering the search action.

Employee.php

	<div class="panel panel-default">
		 <div class="panel-heading">Search Employee</div>
		 <div class="panel-body">
			<div class="row">
				<div class="col-md-6">
                    <div class="form-group">
                        <label class="control-label" for="name">Name</label>
                        <input class="form-control" type="text" name="name" id="name" ng-model="employee.name">                    
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="age">Age</label>
                        <input class="form-control" type="age" name="age" id="age" ng-model="employee.age">                    
                    </div>
				</div>
				<div class="col-md-6">
				    <div class="form-group">
                        <label class="control-label" for="gender">Gender</label>
                        <input class="form-control" type="text" name="gender" id="gender" ng-model="employee.gender">                    
                    </div>

                    <div class="form-group">
                        <label class="control-label" for="company">Company</label>
                        <input class="form-control" type="company" name="company" id="company" ng-model="employee.company">                    
      

Open in new window

0
<div class="col-xs-12">
<h2>Listing Employee</h2>
<hr>
<div class="employeeGrid">  
    <table>
        <tr>
            <th><a href="" ng-click="orderByField='name'; reverseSort = !reverseSort">Name</a></th>
            <th><a href="" ng-click="orderByField='age'; reverseSort = !reverseSort">Age</a></th>
            <th><a href="" ng-click="orderByField='gender'; reverseSort = !reverseSort">Gender</a></th>
            <th><a href="" ng-click="orderByField='company'; reverseSort = !reverseSort">Company</a></th>
            <th>Action</th>
        </tr>
        <tr ng-repeat="person in employee | orderBy:orderByField:reverseSort"">
            <td>{{person.name}}</td>
            <td>{{person.age}}</td>
            <td>{{person.gender}}</td>
            <td>{{person.company}}</td>
            <td>
                 <button class="btn" ng-click="viewEmployee(person.id)"><span class="glyphicon glyphicon-eye-open"></button> 
                 <button class="btn" ng-click="editEmployee(person.id)"><span class="glyphicon glyphicon-pencil"></button> 
                 <button class="btn" ng-click="deleteEmployee(person.id)"><span class="glyphicon glyphicon-trash"></button>
            </td>
        </tr>
    </table>        
</div>

Open in new window


EmployeeController.js

scope = $scope;

scope.employee = [];

scope.$on('$stateChangeSuccess', function () {
    scope.init();   
});

scope.init = function(){
    $http({
        method: 'GET',
        url: '/api/v1/employee/list'
    }).then(function successCallback(response){
        scope.employee = response.data;
    });
}

scope.editEmployee = function(val){

    empScope = $scope;

    $uibModal.open({
        animation: false,
        templateUrl: '../assets/templates/modal/employee/updateEmployee.php',
        controller: 'UpdateEmployeeController',
        size: '',
        backdrop: 'static',
        resolve: { empId: function () { return val; } }
    }).result.catch(function(res) {       
          if (!(res === 'cancel' || res === 'escape key press')) {
            throw res;
          }
    });
};

Open in new window


UpdateEmployeeController.js

scope = $scope;

scope.employee = [];

$http({
       method: 'GET',
       url: '/api/v1/employee/get/' + scope.$resolve.empId
}).then(function successCallback(response){
       scope.employee = response.data;
});

scope.updateEmployee = function(){

       $http({
            method: 'POST',
            url: '/api/v1/employee/update/' + scope.$resolve.empId,
            data: {
                name:scope.employee.name,
                age:scope.employee.age,
                gender:scope.employee.gender,
                company:scope.employee.company
            }
       }).then(function successCallback(response){
            //console.log(response.data);                       
       }, function errorCallback(response) {
            console.log(response.data);
       });

       //scope.$dismiss('cancel');
}

Open in new window


EmployeeController.php

public function lsAll(){
    $employee = Employee::all();
    return $employee;
}

public function getOne($id){
    $employee = Employee::find($id);
    return $employee;
}

public function update(Request $request, $id){
    $employee = Employee::findOrFail($id);      

    $name=$request->input('name');
    $age=$request->input('age');
    $gender=$request->input('gender');
    $company=$request->input('company');

    $employee->name = $name;
    $employee->age = $age;
    $employee->gender = $gender;
    $employee->company = $company;

    if($employee->save()){ 
        return response()->json(['response' => 'The employee record is updated successful']);
    }else{
        return response()->json(['response' => 'Failed to update the employee record']);
    }
}

Open in new window



QUESTION

How do I parse an event from UpdateEmployeeController to EmployeeController during an edit action and render (reload) a specific record with the updated data from database.
0
The Orion Papers
The Orion Papers

Are you interested in becoming an AWS Certified Solutions Architect?

Discover a new interactive way of training for the exam.

I did a method to filter the results, I want for example looking for a hotel in a city and whose price and between 0 and 49, I have 4 checkbox 0-49, 50-99,100-149,150-200 I want If I click on the first it gives me the names of the hotels whose city given in query and the price that is in the value of checkbox

For example:

If I look for the city Casablanca, it gives me the name of the hotels that have in Casablanca and when I click on the checkbox 0-49 it gives me the hotels that have in Casablanca and whose price is between 0 and 49 and so on For other checkboxes when I click on the first checkbox that contains the value 0-49 and the second one that contains the value 50-99, it gives me the hotels that have in Casablanca and whose price is between 0 and 49 and 50 -99 and so on

The method works very well, the problem is in pagination, when I click on a single checkbox it gives the exact page number and the number of element to display in the pages is 25

 $ Perpage = 25;

I have made $ product to display the names of hotels and $ afica to calculate the total number of results, because the method "totalHits ()" only works with the get () method,


$ Books = $ product [0]; // this line stores the first results that is to say when I have a single checkbox but when I click on several checkbox it enters the loop for:

 for($i=1;$i<count($product);$i++){
                    
            $collection  = new Collection();
            $collection2 = new 

Open in new window

0
ErrorException in Macroable.php line 74:
Method appends does not exist. (View: C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php) (View: C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php)

foreach($books as $key => $value)

            <article class="one-third">
              <figure><a href="#" title=""><img src="{{ $value['photo_url'] }}" alt="" style="height: 215px!important;" /></a></figure>

              <div class="details">
           
                <h3>{{ $value['name'] }}
                  <span class="stars">{{ $value['class'] }} 
                    <i class="material-icons">&#xE838;</i>
                    <i class="material-icons">&#xE838;</i>
                    <i class="material-icons">&#xE838;</i>
                    <i class="material-icons">&#xE838;</i>
                  </span>
                </h3>
                <span class="address">{{ $value['city_hotel'] }},{{ $value['address'] }}  <a href="hotel?query={{ $value['name'] }}">Show on map</a></span>
                <span class="rating">{{ $value['preferred'] }}</span>
                <span class="price">Max rate  <em>$ {{ $value['maxrate'] }}</em> </span>
                <span class="price">Min rate  <em>$ {{ $value['minrate'] }}</em> </span>
                <div class="description">
                  <p>{{ $value['desc_en'] }}<a href="hotel.html">More info</a></p>
                </div>   
                <a href="{{ $value['hotel_url'] }}" 

Open in new window

0
I find myself defending PHP on a consistent basis and often think about the reason for all of the hate? PHP was the first language I learned in order to get into web development. Granted, the syntax isn't my favorite, but I find a lot of the prejudice is aimed the lack of structure and canned architecture which has been addressed by some great frameworks such as Laravel. Other complaints I hear are about the lack of OO in PHP which is simply untrue anymore.

However, I must admit, that even though I am an advocate of the language I do not use it for new web projects anymore (opting instead for Javascript / Express / SQL stacks), so maybe my affinity is simply misapplied nostalgia.
6
 
LVL 110

Expert Comment

by:Ray Paseur
I've just discovered this new blog-looking thingie on the E-E home page.  Looks like fun!  

Here is my favorite article about PHP.  You can agree with all of it and still get quick results with PHP, hence its popularity.
https://eev.ee/blog/2012/04/09/php-a-fractal-of-bad-design/

In unrelated matters, here's what you get if you search E-E for Gene Richardson.  Why, oh why?
no_sign_of_gene.png
2
 
LVL 1

Expert Comment

by:Bill Torchia
I have worked with PHP as the core language at a past job. We did not use a frame work because they did not exist when the company started. From that experience my opinion of PHP is that is a great language that has gotten a bad rep because of bad practices. You will see a lot of the same problems that people complain about in PHP in other, older, languages.
2
Hi, I want to select all hotels where minrate between 0 and 49 it marche perfectly , but when i want to select all hotels where minrate between 0-49 and 50-99 It is you to say when it enters the loop "for" it return this error

ErrorException in Macroable.php line 74:
Method appends does not exist. (View: C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php) (View: C:\xampp\htdocs\elasticsearch\resources\views\presult.blade.php)

Function Laravel
public function pricefilter(Request $request)
    {
         $query = Input::get('query', false);
       $brans = request()->priceFilter;
         $books = new Collection(); 
if(!empty($brans))
        { 
            $product = "";

foreach($brans as $data){
               $minMax = explode("-",$data);
              
            
                $product[] = Afica::search()
                    ->multiMatch(['name','city_hotel'], $query, ['fuzziness' => 'AUTO'])
                    ->filter()
                    ->range('minrate',['from'=>$minMax[0],'to'=>$minMax[1]])
                    ->paginate(26)
                    ->appends('priceFilter' , request('priceFilter'));
            
            
                
     
         }
          $books= $product[0];
          for($i=1;$i<count($product);$i++){
              $books=$books->union($product[$i]);
        

          }
         }
        else 
        {
               $books = Afica::search()
            ->paginate(26);
   
        

Open in new window

0
I am trying to run this command : "php artisan serve " in laravel 5.1 and its giving me a massage "could not open input file artisan"
0
I want to build Laravel based CMS with following requirements:

1. Multi-sites (running on sub-domains, manage own database) each with API access.
2. Admin (manage all sites/database).
3. Same Codebase (can be replicated if needed).
4. Same Database with different data for each site.

Can someone guide me how to develop such system using Laravel 5.4.

I know there are some packages that I can use i.e
Multi Tenant Laravel

This package create separate database/tables for each site, which I think makes problem for me to create single super admin.

Any thoughts?

Thanks.
2
Hi,

I am using PHP Laravel. I am storing the count of items in a table.  When a customer purchases an item, we first look at the count of items available, then there are some other related DB operations that are done and there is a logic to reduce the item count and store it back.

However, if 2 customers purchase the item at the same time, there is a race condition and the count gets reduced only by 1. There is a lot of other backend logic and DB operations that happen before the value is updated in the table.

How can I manage the race condition either at the DB level, so that the table is locked for reading till the previous transaction is completed or at the code level, the code is considered as a critical section and locked till the complete code for one purchase goes through.

Help will be appreciated.
0
I'm creating pagination manually for results using Eloquent ORM. The pagination works fine except it's defaulting to display only back and next buttons (simplePaginate()) rather than back, next and page number links.

Here's how I'm generating the pagination;

$data = new \Illuminate\Pagination\Paginator($allRecipes, $perPage, $page, ["path" => "recipes"]);

Open in new window


Is there a way I can ask for the pagination to not be the equivalent of calling 'simplePaginate()'?
0
I'm using Laravel and the Eloquent ORM, I seem to be having a strange issue not being able to call static methods on an eloquent object. I keep getting the error below;


BadMethodCallException in Builder.php line 2405:
Call to undefined method Illuminate\Database\Query\Builder::searchRecipes()

The object I'm trying to call looks like this;

<?php
namespace App\Models;

use Illuminate\Database\Eloquent\Model;

/**
 * Class Recipe
 * @package App\Models
 * @property int $id
 * @property string $title
 * @property string $description
 * @property string $web_url
 * @property int $servings
 * @property string $photo_url
 * @property string $thumbnail_url
 * @property boolean $is_published
 * @property string $chef_name
 * @property string $chef_url
 * @property int $cook_time
 * @property int $prep_time
 * @property string $source_url
 * @property boolean $vegetarian
 * @property boolean $vegan
 * @property boolean $dairy_free
 * @property boolean $gluten_free
 * @property boolean $very_healthy
 * @property int $ww_points
 * @property boolean $cheap
 * @property int $category_id
 * @property int $course_id
 * @property string $created_at
 * @property string $updated_at
 */
class Recipe extends Model
{
    protected $table = 'recipe';

    public static function searchRecipes($criteria)
    {
        if (!empty($criteria->title) || $criteria->categoryId > 0) {
            $query = self::where('title', 'like', "%$criteria->title%");
            if 

Open in new window

0
On Demand Webinar: Networking for the Cloud Era
LVL 8
On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

I'm trying to get the Auth portion of an application I'm building done. I'm using Laravel 5.3 and VueJs 2 as my JS framework.
In my login component, I have something along the lines of this.
<template>
    <form @submit="test" method="POST" action="/test">
        <input v-model='input' type='text'>
        <button type='submit'>Submit</button>
    </form>
</template>

<script>
    export default {
        data() {
            return {
                data: {
                    input: "hello"
                }
            }
        },
        mounted() {
            console.log('Component ready.')
        },
        methods: {
            test: function() {
                this.$http.post('/test', {
                    headers: {
                        'X-CSRF-TOKEN': $('meta[name=_token]').attr('content')
                    }
                })
                .then(res => {
                    console.log(res);
                })
                .catch(err => {
                    console.error(err);
                });
            }
        }
    }
</script>
</template>

Open in new window


I also have the CSRF token set as metadata in the head of my HTML document.

<meta name="_token" content="{{ csrf_token() }}">

Open in new window


Laravel 5.3's Illuminate\Foundation\Http\Middleware\VerifyCsrfToken spits the error out, saying there is a token mismatch.
I'm currently var_dumping out all the $request info that gets passed into this class' handle() function.

public function handle($request, Closure $next)
    {
        var_dump($request);
        if (
            $this->isReading($request) ||
            $this->runningUnitTests() ||
            $this->shouldPassThrough($request) ||
            $this->tokensMatch($request)
        ) {
            return $this->addCookieToResponse($request, $next($request));
        }
        throw new TokenMismatchException;
    }

Open in new window


I don't see the CSRF token being passed with the ajax request I'm sending. What's odd is that if I don't use ajax and do a normal form submit such as
{{csrf_field()}}

Open in new window

inside the form tags, the middleware successfully auths the token. This leads me to believe this is a problem with ajax/vue-resource that I'm using. I may be doing something wrong but I've scoured google posts/stackoverflow/youtube videos about this issue but nothing's fixed the error. I've done a workaround where I force a XSRF-TOKEN cookie to be compared to the token but this makes me think about security issues and what happens when a user accidentally or unknowingly deletes their cookies while using the application. Not sure if that would cause errors but I've talked to other devs/engineers and they say its not a good idea to force the cookie to be compared in the middleware instead of a CSRF_TOKEN.

Here are some other things I've tried.

Open in new window

0
I like learning object oriented php

but do not want to be bogged down by html, css, jquery, javascript, ajax

I know I can use command line php but if a client is paying me; client usually wants artwork.
A css designer will draw a picture of an expected form and I am forced CODE the html and css to the exact layout of the picture

then the client states the the textbox is 1 inch (.5 cm) too tall.



do other object oriented languages force me to learn so much design software


Please add many other object oriented programming zones
0
Hi,
I've attached a pic thinking that may be the best way to illustrate my challenge.
At the end of each day a dealer will submit how many vehicles they sold for the day into our system.
Because the number each day will vary, I've created the form so the user can add/delete additional rows (1 row per vehicle).

So, I'm not sure how to submit the fields? I'm guessing for example each field name would be an array ie: for stock number input: name="stockno[]", for vehicle input: name="vehicle[]" etc.

The user submits the form, I would then need to merge each array I'm thinking together (1st item in each array is the first vehicle to insert, 2nd item in each array is the second vehicle to insert).

Is that the way I should be approaching it?

Lastly if so, how do I take each of the arrays and merge them properly so row 1 is together, row 2 and so on?

Hope that makes some sense. Tricky to explain

screenshot
0
Hi,
I am keeping a record of days a store is closed for the year ie:

2017-01-01
2017-01-03
2017-01-04
2017-01-09

So I'm using multi-datepicker which allows me to select closed days for the year, and inserts them into a hidden text field to include along with the rest of my form's POST submission.

Like this:  2017-01-01,2017-01-03,2017-01-04,2017-01-09 etc.

Was thinking I'd use 'explode' and insert each into the DB separately into a date column and dealer_id.

Then I began to wonder wouldn't I be better off to simply insert the values as an 'array' something like this into a single record for the year ie:
closed: ["2017-01-01","2017-01-03","2017-01-04","2017-01-09"]
dealer_id: XXXXXX

Going forward I'd be checking the table daily to see if the above 'array' contains todays date in case they are closed.

So my question is:
What is the best way to store that kind of data? As a comma-separated string or a separate entry per date?
0
Not a question, just a heads-up to the E-E community.  PHP 5 is circling the drain, with active support continuing only 21 more days at this writing.  Time to upgrade to PHP 7+
http://php.net/supported-versions.php

Of particular importance is the removal of MySQL, which has been deprecated for years.  More information here:
https://www.experts-exchange.com/articles/11177/PHP-MySQL-Deprecated-as-of-PHP-5-5-0.html

If your PHP framework or application depends on any version of PHP < 7.0, you may have a sudden load of technical debt, and a difficult decision to make.
1
Hi Experts


Could you point how to call an Angular view from inside an Angular controller?

Accordingly to:

Angular View's code:

 <div class="wrapper-md" ng-controller="usersController">
        <div class="panel panel-default">
            <div class="panel-heading" translate="nav.USERS">Users</div>  
            <table st-table="users" class="table table-bordered table-striped">
                <thead>
                    <tr>
                        <th>Nome</th>
                        <th>Nome de Usuário</th>
                        <th>Email</th>
                        <th>Status</th>
                        <th>Opções</th>
                    </tr>
                </thead>
                <tbody>
                        <tr ng-repeat="row in usersCollection" st-select-row="row">
                        <td>{{row.name}}</td>
                        <td>{{row.username}}</td>
                        <td>{{row.email}}</td>
                        <td>{{row.status}}</td>
                        <td><button type="button" ng-click="view(row.id)"><i class="fa fa-eye"></i></button><button type="button" ng-click="edit(row.id)"><i class="fa fa-edit"></i></button><button type="button" ng-click="del(row.id)"><i class="fa fa-trash"></i></button></td>
                    </tr>
                </tbody>
                    
            </table>
                   
        </div>

Open in new window



Angular controller:

'use strict';
angular.module("app").controller("usersController", ['$scope','usersService', function ($scope,usersService) {
      usersService.get().then(function(data){
         $scope.usersCollection = data;
      }).catch(function(){
        console.log('Erro!');  
      });
      
      
     $scope.view = function() {
        console.log('view');
        //  ??? How to call a view from here ???
    };
    
    
     $scope.edit = function() {
        console.log('edit');
    };
    
     $scope.del = function() {
        console.log('del');
    };
    
      
}]);

Open in new window


Angular structure (with Laravel)

img001
Thanks in advance.
0

Laravel

67

Solutions

80

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
>