lundi 28 mai 2018

Laravel - Redirect Catch / Redirect Urls with an .php ending

I have an old static PHP Website, which I would like to update and rebuild it with Laravel. My Problem, all the SEO Links are already indexed with a .php ending.

Is there any chance to catch the URLs with a .php ending and redirect to URLs without a .php ending?

www.website.com/index.php -> www.website.com
www.website.com/en/products.php -> www.website.com/en/products

Thanks for your, help!



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

Laravel how to set middleware to kc finder

i've set Session after i login

session_start();
$_SESSION['ckfinder_auth'] = true;

where Can i set middleware



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

Laravel 5.5 autoload a function for each page without calling that function for each controller

I'm going to create a dynamic left navigation (menu) for each users. I have already created the database table for the same. Also, I have generated the menu structure based on the user logged in. The Left navigation is located as partial view (leftnav.blade.php). I'm currently passing the left nav data (generated from database values) to the view as like:

$data['tree'] = $this->generateSiteTree(0); // left nav generated
$data['bla] = 'bla bla etc';
return view('Administrator.permission.index', $data);

But, I do not want to generate the menu structure for each page individually by writing the same code again for another controller. I know how to create Helper function. My question is - how to automatically call the function for each page?



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

Override primary key with foreign key in hasMany relation using laravel

Here are my tables

Posts

id | name | created_At

Comments

id | comment | post_id | created_at

Post Model

function comments(){
      return $this->hasMany('App\Models\Comment','id','post_id');
 }

PostsController

function index()
{
    Post::with('comments')::get();
}

Now how can i get list of all posts along with comments?

I am trying to match post_id in the child table.



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

Search column not working in datatable

I've Two table join table 1 and table 2, I used datatables working properly but search column not working for table 2 column i.e location. location_id is saved in table1. There is no error in ajax response.



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

How to get data from intermediate table in laravel?

I have 3 table like this,

kelas

id | kelas | romawi

jurusan

id | alias | motto | visi | misi | tahun

kelas_jurusan (intermediate table)

id | id_kelas (from table kelas) | id_jurusan (from table jurusan)

I want to get data 'kelas' in table kelas with accessing the kelas_jurusan table, thanks for your helping



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

dimanche 27 mai 2018

Laravel blade not working with in custom js file

Laravel blade works fine when i place the code in footer section at the bottom. But when i move the code into a custom js file the laravel blade is not working. I am not able to figure out what is the issue.

$(document).ready(function() {

    var url = "{!! url('/') !!}";

    alert(url);

});



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