Laravel multiple file download validation

I am currently working in a form. I have some issue with multiple file upload validation. I have only one field in a form which allows multiple file upload. <input type="file" name="file[]" multiple="multiple"> And this

Laravel Model Property in View

I want to access static property of my model class in views I have tried {{ \App\task::$accounts_currency }} {{ \App\task::accounts_currency }} But nothing seems work. Please guide Thanks my model class <?php namespace App; use Illuminate\Database\El

Event Manager Not Receiving Laravel Event

I am with L5.4 working on notification system. I have created events & listeners. I do have a test route for firing this event. Event is fired successfully and I can even recieve it using Pusher in my blade views. But for some reason I have to stop w

Update user profile

I work on a project to learn Laravel. So, I creat a database with users and all users got profile informations{city,country,etc...} I create a table named 'profiles' where i have a id / user_id / contry / city ... My web file with routes looks like:

Laravel giving a CORS error just for a route / controller

Note: Edit at the bottom of this question I am having a very strange problem and Im starting to pull my hair out on this one. I am using Angular and Laravel 5.4. I am using Barryvdh\Cors and it is working perfectly. However for some reason I am getti

How to remove / update a specific migration in laravel

I am working on a large project which has many migrations. I want to add a column in a table and I don't want to maintain multiple migrations for one table. How can I do that? Is there any way to migrate:refresh for only one migration?I think migrati

Fill a dropdown list in laravel with more than 2 attributes

So far I know how to populate dropdown using Eloquent (and pluck) is this public function create() { $items = Item::all()->pluck('name', 'id'); return view('admin.item.create', compact('items')); } And with this {!! Form::select('item_id', $items, nu

Sign in / Register API with Laravel 5

How do i can create an API with laravel 5,That will be used for login /register for mobile app ? Is there any useful tutorial for this type of API. Like when someone send a request from mobile application,i need to authenticate and then send the prop

Laravel 5 date_format validation does not valid

here is input value : FIRST_TIME_ARRIVAL_DATE_AT_DAW : 2016-21-5 17:21:35 here is validation rule : public static $createRules = [ 'FIRST_TIME_ARRIVAL_DATE_AT_DAW' => 'date_format:"Y-m-d H:i:s"', ]; and it doesn't validatate, it return : {&qu

Send an email to Laravel using Gmail

I have been using Laravel for a little while now, so thought I would dive into HTML emails, so I followed a tutorial. The issue I have, as well as seemingly quite a few others is this: Swift_TransportException in StreamBuffer.php line 269: Connection

Eloquent calculate if I have more results

I'm building a Products API. I need to return a collection of products and a variable telling me if I have more results starting from the last the answer has just returned me to show or hide a load more button. This is all I have until now: $query =

Pagination Laravel AJAX?

By default Laravel pagination refresh page every time. I don't want this to happen public function getPaginate($n) { return $this->model->with('professional') ->orderBy('extras.created_at', 'desc') ->paginate($n); } In the controller : $extras

Show name instead of Laravel ID

I have two tables; Students and Grade. Students contains foreign key grade_id referencing Grade. For viewing students, I have used following code; Controller: public function viewStudent() { $students=Student::all(); return $students('grade_id'); $gr

Laravel: How to connect to INFO to separate the file

How to specify a separate file for logging INFO in Laravel 5.1? Any immediate help will be highly appreciable. ThanksDo you want to specifically log info to one log file and another log type to another location? My solution might not help in that cas

Authentication Views for Laravel 5.1

Laravel 5.1 has just been released, I would like to know how could I tell the AuthController to get the login & register view from a custom directory? the default is: resources/views/auth... The trait AuthenticateAndRegisterUsers only has this: trait

Laravel: Is it bad practice to switch models to views?

In the examples I have seen so far, concrete values are always passed to views - be it as separate variables, or as arrays. Example from the Laravel documentation: $view = View::make('greeting')->with('name', 'Steve'); Is it a bad idea to pass a mode

Call the Artisan Retry queue from php

I am having issue about calling artisan queue from php. I want to make the list of fail jobs in Beanstalkd queue and make a button to retry. I want to call php artisan queue:retry{id} So, I put this code in the route.php Route::get('retry/{id}', func

Error after Laravel file transfer in production

I just moved my project to new server and after that I'm getting this message: Whoops, looks like something went wrong. I've changed permissions to "storage" folder and sub-folders... to 777 and nothing changed... I wanted to see the logs... but

Set the session variable in laravel

I would like to set a variable in the session using laravel this way Session::set('variableName')=$value; but the problem is that I don't know where to put this code, 'cause I would like to set it for one time (when the guest visite the home page or

how to use sql NOW () function in laravel

I have used sql's now() function several times in normal query in php db connectivity... But in laravel it does not displays anything and also the data is not inserted the code I am using is: $exercise = Exercise::insert( array( 'fk_users_id' => '1',

Regex validation with decimal

Working on a regex validation, where I validate as XX,XX. With mine regex I can write 2,233 and it will still go through: 'regex:/[\d]{1,2},[\d]{2}/', Maybe you should add start and end limits as follows: 'regex:/^\d{1,3},\d{2}$/' Demo: http://regex1

Adding Google php API for google calendar in laravel

I want to use the Google php api for accessing the calendars. I'm working with laravel. I already added the package on composer and it's downloading fine, the thing is what I have to do with the providers and aliases or whatever to link the api with

Laravel 4 migrate restore issues

I can easily run the artisan migrate etc, but when i try to roll it back, with migration:rollback i keep getting this error, c:\xampp\htdocs\laravel>php artisan migrate:rollback {"error":{"type":"Symfony\\Component\\Debug\\Exce

Shared folder permissions in Vagrant 1.1.5

Trying to set up a little Vagrant development environment right now using the Laravel framework and need to make my /vagrant/storage/views folder writeable, but I cannot get the permissions on the folder to change no matter what! I have done: sudo ch