Conflict in config.php

Hello every body,

I think I have a conflict in my config.php.
Here is the part of the code :

/*

---------------------------------------
Download last
---------------------------------------

*/

c::set('routes', array(
  array(
    'pattern' => 'downloads/latest',
    'action'  => function() {

      page('downloads')
        ->files()
        ->filterBy('extension', 'zip')
        ->last()
        ->download();

    }
  )
));


/*

---------------------------------------
Kirby authentication
---------------------------------------

*/

c::set('roles', array(
  array(
    'id'      => 'admin',
    'name'    => 'Admin',
    'default' => true,
    'panel'   => true
  ),
  array(
    'id'      => 'editor',
    'name'    => 'Editor',
    'panel'   => true
  ),
  array(
    'id'      => 'client',
    'name'    => 'Client',
    'panel'   => false
  )
));


c::set('routes', array(
  array(
    'pattern' => 'logout',
    'action'  => function() {
      if($user = site()->user()) $user->logout();
      go('login');
    }
  )
));

I need the to actions, but don’t know how to fix that.
Besides that, some new improvments here : www.phtgrph.fr
Thanks

You’re setting routes twice. I think you’re overwriting the first declaration by setting routes a second time.

Try this instead:

c::set('routes', array(
  array(
    'pattern' => 'downloads/latest',
    'action'  => function() {

      page('downloads')
        ->files()
        ->filterBy('extension', 'zip')
        ->last()
        ->download();
    }
  ),
  array(
    'pattern' => 'logout',
    'action'  => function() {
      if($user = site()->user()) $user->logout();
      go('login');
    }
  )
));

I was thinking something like that.
Thank you for the solution ! Seems to work great !

Thanks Paul,