dimanche 1 octobre 2017

Headless chrome on centos server not working

I am using Centos 7 server to host php laravel 5.5 application. I have written laravel dusk browser tests. To run these tests on server I will need to run google chrome in headless mode. I have installed google chrome and chromium driver on my server. I have also tried with Xvfb. None of this working. It always gives error that shared memfd open() failed: Function not implemented. Added error which I am getting

Any suggestion to make laravel dusk automated test working on centos 7 with headless google chrome? We are using Jenkins for continuous integration.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xJqcYu
via IFTTT

PHP DateTime Invalid Auction end date

I have coded an Laravel Auction Bid Script for Products.

If i want create an new Product i can enter the "End Date" for the Auction.

But i get always this Error: "Invalid end date"

I have try now all Dates variants and i am a little bit desperate.

My code line for the Auction End Date in Laravel 5 ProductController:

if (validateDate($request->end_date)) {
          $end_date = DateTime::createFromFormat('Y-m-d\TH:i',$request->end_date);
          $now = date('Y-m-d\TH:i');
          $end_date1 =  date_format($end_date,'Y-m-d\TH:i');
          if ($end_date1 < $now) {
            session()->flash('errormessage','Invalid end date');
            return redirect()->back()->withInput();
          }

Now i must enter the Date and Clock in this formate,right?

2017-10-22\15:00

End Date and time



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2g0CbXJ
via IFTTT

Laravel: MariaDB - artisan migrate:refresh hangs

I'm using Debian 9 with MariaDB 10.1.27, Composer 1.4.2 and Laravel 5.5.13.

I've created an empty database using CREATE DATABASE 'laravel', configured it in Laravel's .env config file and now I've sometimes the problem, that database actions hangs (nothing happens) or in the browser I get an timeout exceeded message. Connecting to the database using mysql -u laravel -p laravel is still possible - like SELECT's.

php artisan migrate

...is sometimes working like migrate:refresh and sometimes not. If it's not working, I always have to restart the MariaDB service and usually, it works then the first time again.

migrate:refresh for example clears the database and imports / loads most of the time 10 migrations and then, it's just doing nothing. I've already waited about 1 hour for this task, but it only keeps saying, that the migration table was missing and added and nothing more. Artisan doesn't even say, that it has imported / loaded 9 other tables...

For sending emails, I'm using supervisor, but it shouldn't be in use, while running migrate:refreshh;

Increasing the execution timeout doesn't help anything. So, what's the problem? In Homestead it's just working perfect. Are there any specific settings in MariaDB required? Or do I need to create the database with specific parameters like default charset?

Btw: If the application is running, I'm also sometimes getting the execution timeout error message, while browsing the web site.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2xHKD8o
via IFTTT

Laravel use package in package

I'm developing a package in Laravel 5.5 where I need this package:

http://ift.tt/1dvwKFA

The problem is that It's not registering for some reason. When I dd in the JavaScriptServiceProvider.php nothing happens. When I use the Javascript facade I get an error that it does not exists?!

My package composer.json file:

"require": {
        "php" : "^7.0",
        "illuminate/support": "~5.5.0",
        "laracasts/utilities": "^3.0"
    },

I use Laravel 5.5 so it should be registered by default (composer.json from laracasts package):

"extra": {
        "laravel": {
            "providers": [
                "Laracasts\\Utilities\\JavaScript\\JavaScriptServiceProvider"
            ],
            "aliases": {
                "JavaScript": "Laracasts\\Utilities\\JavaScript\\JavaScriptFacade"
            }
        }
    }

What am I doing wrong here?



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2fDeSCT
via IFTTT

Delete Data From all tables using Load() Laravel 5.5

i am trying to delete Model from Model table and all of its comments from Comments table...my current code delete the model but not its comments from the other table...

Here is my destroy function

public function destroy(Request $request,CadModel $cadmodel)
    {
        $cadmodel->load('comments')->delete();
        $request->session()->flash('message.level', 'success');
        $request->session()->flash('message.content', 'File Deleted Successfully!');
        return redirect()->route('dashboard');
    }

Here is the relationship i defined in CadModel Laravel Model...

 public function comments()
    {
        return $this->hasMany(Comment::class);
    }

Please Reply and suggest me a solution to delete both..Model and its Comments



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kdf8xf
via IFTTT

Create A laravel 5.1 Api Documentation

i need to know if there is package to make the api documentation for me
knowing that i tried to use laravel-apidoc-generator
but it does not accept Laravel 5.1 .
so any help please i don't want to make the API doc manually .
thanks in advance .



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2yB3AGy
via IFTTT

Session changes on page refresh in laravel 5.2

I am running on Laravel 5.2. Every time I run page refresh the session id changes. I haven't added 'Web middleware' as it's added by default to routes.php. Found like this issues floating on forums but none really seems to be the solution. Help will be appreciated.



from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2kbAo6y
via IFTTT