Questions tagged [laravel]

31249 questions
-1

votes
0

answer
19

Views

getting error [TypeError: Cannot read property 'data' of undefined] while fetching data through vuex action [on hold]

I am learning vuex, but I am getting an error: [TypeError: Cannot read property 'data' of undefined] Deposit module: Store-index: Controller: Route:
Jagat Kar-Key
0

votes
0

answer
16

Views

How to pass multiple string variables to a Laravel Gate

I have a “security” service which I want to gradually move over to a Laravel Gate, so I can benefit from the helper methods that Laravel provides within the rest of the APP. I defined the gate as follows now: Gate::define('denja', function($user, $module, $permission) { // validation of access t...
David Heremans
4

votes
3

answer
92

Views

php artisan migrate on Azure (in BitBucket pipeline)

I have setup a pipeline in BitBucket to automatically deploy my master branch of my project to an Azure Web App instance. The app deploys the files and runs composer update as expected (although it does warn that it's running as root), but php artisan migrate --force returns: Illuminate\Database\Que...
Richard Hedges
0

votes
0

answer
6

Views

PDF generation using laravel

I am trying to generate a report in pdf format, I have a foreach loop which is looping though the objects, for some reason the data is not being displayed on the downloaded pdf. any help is appreciated here is my view page: Row No. Entry ID DC Customer Name ID No. Referance No. Entry Purpose Time In...
Abdul
-2

votes
2

answer
31

Views

I'm facing problem in laravel that is “This site can’t be reached 127.0.0.1 refused to connect.”

I face this error only when "php artisan serve" command is not running. If this command is running then there is no such a error, but as i closed command prompt this error occurs. i have also changed port but no vain. Kindly help me.I would like to mention here that I'm using Window 10 OS. Thanks in...
Ali Bhutta
0

votes
0

answer
24

Views

How to connect Laravel with DB2

I have to use Laravel 5.6 with DB2. I actually have no idea how to do that.I found this laravel package laravel-db2 .I have Configure all as instruction which is given but i am not able to connect to my DB2. It's error some thing like this. php artisan serve In Connector.php line 68: SQLSTATE[IM002]...
Dipendra Deshar
0

votes
0

answer
29

Views

Group collection by month and type user

I have a collection of invoices and to make a chart from it I want to group them in months and in those months a subdivision by the type of the user. UPDATE: If I group by month or group by user type separately they work but if I want to group them by month and in that month by the user type it's no...
EnzoTrompeneers
1

votes
1

answer
7.9k

Views

Use of undefined constant App - assumed 'App' in Laravel

I am trying to create application with laravel 4. I created Answer Model with the following code.
Naing Lin Aung
1

votes
1

answer
2.1k

Views

Using setConnection on Laravel 4 Models

I am trying to set the connection in use by a model in Laravel 4 before getting instances of the model from a secondary database. I have correctly filled in the information for the secondary connection in Config/database.php, but for some reason Laravel is reverting back to the default connection wh...
Zac Crites
1

votes
1

answer
3.5k

Views

laravel 4 sentry 2 how to change password and rehash

In my app there's a view that allows the logged in user to enter a new password. How am I to hash the new password? Using native Laravel Auth I would just Hash::make($input['password']); is it the same for Sentry 2? If it is, after performing a reset and updating the user table I get a WrongPassword...
Jared Eitnier
1

votes
2

answer
1.3k

Views

Laravel https route for form

Is there way to submit a form over https using the blade syntax? I have {{Form::open(['route' => 'pages.store', 'class' => 'crud-form'])}} but this uses http://
Ben
1

votes
1

answer
3.8k

Views

Laravel 4 custom validation error message

so I was trying to add a custom validation rules like this: public function validateDateAfterField($attribute, $value, $params) { return strtotime($value) > strtotime($this->data[$params[0]]); } It takes the value and validate with another field in array of data being validate I wanted it to produce...
Jonathan Chow
0

votes
1

answer
15

Views

How to write raw query in Laravel

I need to write a raw query in Laravel Database: Query Builder, That outputs size of specific table In core mysql query is as following SELECT table_name "Name_of_the_table", table_rows "Rows Count", round(((data_length + index_length)/1024/1024),2) "Table Size (MB)" FROM information_schema.TABLES W...
Hemant Maurya
-3

votes
0

answer
19

Views

The server responded with a status of 405 (Method Not Allowed) Using GET Method

The server responded with a status of 405 (Method Not Allowed) Using the GET Method. Can you tell me where is the issue that I am facing? CODE SAMPLE $('.itemName').select2({ placeholder: 'Select an item', ajax: { type: "GET", url: '{{ route('autocomplete.fetch') }}', contentType: "application/json;...
gaurav Nectarbits
0

votes
0

answer
18

Views

Problem with Multidimensional array in vuejs

Multidimensional Arrays Event Table We have multiple objects, inside each object we have got arrays and each array have objects.[Multidimensional Arrays] We want to check if problem.user_id is exist in users.id(current logged in user) If it does then button will be disabled and if it doesn't then i...
Anirban Roy
1

votes
0

answer
6

Views

Laravel 5.7 Can't write image data to path Image intervention

I want to save all my uploaded files into public. Everytime the superadmin create a new company it will create a folder that can be found in the public $path = public_path().'/attachments/'.$company_id; if (!File::exists($path)) { File::makeDirectory($path, 777, true, true); } When I tried to upload...
Angel
1

votes
1

answer
539

Views

How to route to a laravel controllers method

I'm quite new to laravel4 but with some codeigniter background. I try to figure out how do I route with url to a controller method my url should look like /admin/products{controller_name}/parser{controller_method} than controller
fefe
1

votes
1

answer
1.3k

Views

Laravel Relationship error trying to call a relationship within the model

On Laravel "4.1.x-dev", How can I call a method on a relation within the model? From the below example public function userLink() { return $this->user->link; } My function userLink gives me the error : Relationship method must return an object of type Illuminate\Database\Eloquent\Relations\Relatio...
user391986
1

votes
1

answer
1.4k

Views

Laravel merge 2 collection with paginator

I need to do paging with two different collection. Have priority listing. Money that is placed in the priority list. Why do not you do a single query, you can say the priority list. Reason, when using filtering; city, county, category I choose. However, the site owner, having priority listing in th...
Actionsee
1

votes
1

answer
4.5k

Views

Segfault with Laravel - how to debug?

I'm having a bit of an issue with my Laravel install—everything works fine with no errors until I run a php artisan optimize. When I php artisan serve after that, the server crashes immediately after I try to load any page. I tried serving it with php -S and got the same crash (though this time I...
gautam
1

votes
1

answer
2.1k

Views

Laravel Auth, custom database & table, {“error”:{“type”:“ErrorException”,“message”:“Undefined index: password”

Creating a login route & function using Laravel's Auth class and my database. Not using Eloquent due to the large legacy database that must be used. I know SHA1 shouldn't be used but the thousands of accounts in the database use it and I haven't migrated. Route::post('login', function() { $user = a...
user3817533
1

votes
1

answer
2.8k

Views

What happens when --memory limit reached during php artisan queue:listen with Beanstalkd

I am creating a Laravel 4.2 app with MySQL database on NGINX. I am trying to research options to reduce CPU usage at any given time using queues. I would like any queued task to stay under a certain level of memory usage; but what I do not understand is what actually happens if the task being run e...
Douglas.Sesar
1

votes
1

answer
645

Views

Model::insert() is not updating timestamps

I added the timestamps in the Migration(Schema) and the model $table->timestamps(); //In the Schema public $timestamps = true; //In the model I made an array with all fields of the database and inserted into the database. Checkin::insert($input); In the table, it updates all the fields except the u...
Abhijith
1

votes
2

answer
1.4k

Views

Delete row from db and table but stay on same page Laravel

hi all I've got a table displaying data in my view in laravel-4. When the user selects a row to delete a pop up displays asking them are they sure they want to delete this row. When they click confirm I remove the row and I would also like to remove the data from the database However this is my prob...
Javacadabra
1

votes
5

answer
1.7k

Views

Laravel - Better Error Tracking

After we have develop the web application using Laravel, we need tool for better tracking and monitoring for any possible bug & error occur. Is there any nice free tool / plugin that works well with Laravel for tracking & monitoring errors? Thank you.
user1995781
-1

votes
1

answer
18

Views

Laravel monthly user cron

I am working on a project and users can upload photos, every month they pay x amount of money for the uploaded photos. How can I track how much they have used each month? So I want for every user that he updates which photo he has uploaded that month and that he resets a kind of counter every month...
Jur Dekker
-1

votes
2

answer
11

Views

How to activate laravel

php artisan serve Heading ##enter image description here php artisan serve
Asim Abobakr
0

votes
0

answer
4

Views

Laravel: Querying by id

I am facing a very basic issue but just can´t solve. Two tables: car_models and gear_type. Like this: At home page, I must show all models and witch car with its gear description. So, I am doing: $modelos = Modelo::all(); foreach ($modelos as $modelo) { $cambio = Cambio::where('id', '=', $modelo->c...
Marcello Patto
0

votes
0

answer
4

Views

Get relationship collection groupBy column and not null

I want to get all the App\Device where column location is not null or empty AND distinct. For example: Device 1->location = "Athens" Device 2->location = "Athens" Device 3->location = NULL Device 4->location = "Berlin" The result i am looking for is an array which will have as key the location name...
1

votes
2

answer
1.5k

Views

How to count number of weekends in a given month (Carbon Object)?

I am trying to count how many weekends (Saturday and Sunday) that falls in a given month. This will allow me to subtract these weekends to get number of actual weekdays required in my application. What I am doing now is, firstly I created Carbon object like this: $thisDate = Carbon::createFromDate(...
Nirmalz Thapaz
1

votes
1

answer
1.4k

Views

Adding multiple values to Laravel Session

I am trying to figure out the best way to accomplish this issue. I have a Session that's triggered when someone visits a number amount of pages. When they visit the page the Session should add that page ID to the history session. Then when they go to the history page all of the pages they went to w...
Lynx
1

votes
1

answer
4.1k

Views

Laravel Intervention Image not working

I installed Laravel Intervention Image class by composer, from this tutorial, And when I type composer update, composer returns: D:\WEB\htdocs\zanbil>composer update Loading composer repositories with package information Updating dependencies (including require-dev) - Installing intervention/image (...
1

votes
2

answer
3.8k

Views

Laravel Intervention/ Image Maximum execution time of 30 seconds exceeded

I have a photography website I am working on in Laravel. I utilize a package called Intervention / Image. In the sites administrative area is a place where admins can create projects then upload any number of images to that project. The problem is that if the images are sizable 4mb or bigger and the...
Tom Bird
1

votes
1

answer
1.3k

Views

Laravel if field is empty

I'm new to laravel I have a host-profile.blade.php that has and i got UserController.php public function host(){ $this->params['creditcard'] = Creditcard::where('user_id', '=', $user->id)->first(); return View::make('users.host-profile', $this->params); } the thing is, it throws an error if my tabl...
Hades Hades
1

votes
1

answer
2.5k

Views

Updating model - email is required to be unique [duplicate]

This question already has an answer here: Laravel 4 validation email unique constraint 2 answers I have a view that shows a form with pre-populated data related to a user model. This is for updating the model data. When the form is submitted, however, there's a conflict because the email address is...
babbaggeii
1

votes
4

answer
1.7k

Views

Laravel 5 Twilio Namepace

I am implementing Twilio in Laravel 5, the tutorial I am using is very good https://www.twilio.com/blog/2014/09/getting-started-with-twilio-and-the-laravel-framework-for-php.html. Do you know what the namespace is for laravel 5? I am getting Class 'Services_Twilio_Twiml' not found Thanks
user3459394
1

votes
2

answer
2.8k

Views

Laravel 5 yield & section

I have the following structure: - master.blade { @yield('menu') // here I load the one and only menu I have @yield('content') // here I load different pages } - menu.blade { @extends('master') @section('menu') main menu @stop } - other pages using the same format { @extends('master') @section('conte...
Uber Crash
1

votes
2

answer
1.2k

Views

Laravel 5 Blade Not Working on CentOS 7

I tried to install a fresh laravel project on CentOS 7 running Apache/PHP 5.6/MariaDB. on /var/www : composer create-project laravel/laravel devil chmod -R 777 devil/storage chmod -R 777 devil/vendor When I tried to access it from browser, it seems the blade extension is not working. It keep showing...
Adzar Karomy
1

votes
1

answer
585

Views

Laravel Eloquent add a prefix to an attribute

I have a table with names of districts in my country. Is there a good and easy way to add 'District' string before every name? There is my table structure: +------------------------+ | id | name | +----+-------------------+ | 1 | Sofia | +----+-------------------+ | 2 | Sh...
mertindervish
1

votes
2

answer
4.5k

Views

laravel artisan error when listing routes

I'm a bit new to laravel and have come across something I don't know how to fix, or even where to start looking. Can anyone explain this, please? When I run php artisan route:list I get: [Symfony\Component\Debug\Exception\FatalErrorException] syntax error, unexpected ',' I've only made a couple of c...

View additional questions